header_html_file.go 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. package template
  2. var VarHeaderHtmlFile = []byte(`<!doctype html>
  3. <html lang="en">
  4. <head>
  5. <!-- Required meta tags -->
  6. <meta charset="utf-8">
  7. <meta name="theme-color" content="#205081" />
  8. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  9. <!-- Bootstrap CSS -->
  10. <link rel="stylesheet" href="{{$.System.PathCssBootstrap}}">
  11. <title>
  12. {{if not (eq $.Data.Module "404")}}
  13. {{if eq $.Data.Module "index"}}
  14. {{$.Data.Page.Name}}
  15. {{else if or (eq $.Data.Module "blog") (eq $.Data.Module "blog-post") (eq $.Data.Module "blog-category")}}
  16. {{if eq $.Data.Module "blog-category"}}
  17. Posts of category "{{$.Data.Blog.Category.Name}}" | Blog
  18. {{else if eq $.Data.Module "blog-post"}}
  19. {{$.Data.Blog.Post.Name}} | Blog
  20. {{else}}
  21. Latest posts | Blog
  22. {{end}}
  23. {{else if or (eq $.Data.Module "shop") (eq $.Data.Module "shop-product") (eq $.Data.Module "shop-category")}}
  24. {{if eq $.Data.Module "shop-category"}}
  25. Products of category "{{$.Data.Shop.Category.Name}}" | Shop
  26. {{else if eq $.Data.Module "shop-product"}}
  27. {{$.Data.Shop.Product.Name}} | Shop
  28. {{else}}
  29. Latest products | Shop
  30. {{end}}
  31. {{end}}
  32. {{else}}
  33. Error 404
  34. {{end}}
  35. </title>
  36. <meta name="keywords" content="{{$.Data.Page.MetaKeywords}}" />
  37. <meta name="description" content="{{$.Data.Page.MetaDescription}}" />
  38. <link rel="shortcut icon" href="{{$.System.PathIcoFav}}" type="image/x-icon" />
  39. <!-- Template CSS file from template folder -->
  40. <link rel="stylesheet" href="{{$.System.PathThemeStyles}}?v=2">
  41. </head>
  42. <body class="fixed-top-bar">
  43. <div id="wrap">
  44. <nav class="navbar navbar-expand-lg navbar-light bg-light">
  45. <div class="container">
  46. <a class="navbar-brand" href="/">Fave {{$.System.InfoVersion}}</a>
  47. <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
  48. <span class="navbar-toggler-icon"></span>
  49. </button>
  50. <div class="collapse navbar-collapse" id="navbarResponsive">
  51. <ul class="navbar-nav ml-auto">
  52. <li class="nav-item{{if eq $.Data.Page.Alias "/"}} active{{end}}">
  53. <a class="nav-link" href="/">Home</a>
  54. </li>
  55. <li class="nav-item">
  56. <a class="nav-link{{if eq $.Data.Page.Alias "/another/"}} active{{end}}" href="/another/">Another</a>
  57. </li>
  58. <li class="nav-item">
  59. <a class="nav-link{{if eq $.Data.Page.Alias "/about/"}} active{{end}}" href="/about/">About</a>
  60. </li>
  61. <li class="nav-item">
  62. <a class="nav-link{{if or (eq $.Data.Module "blog") (eq $.Data.Module "blog-post") (eq $.Data.Module "blog-category")}} active{{end}}" href="/blog/">Blog</a>
  63. </li>
  64. <li class="nav-item">
  65. <a class="nav-link{{if or (eq $.Data.Module "shop") (eq $.Data.Module "shop-product") (eq $.Data.Module "shop-category")}} active{{end}}" href="/shop/">Shop</a>
  66. </li>
  67. <li class="nav-item">
  68. <a class="nav-link{{if eq $.Data.Module "404"}} active{{end}}" href="/not-existent-page/">404</a>
  69. </li>
  70. </ul>
  71. </div>
  72. </div>
  73. </nav>
  74. <div id="main">
  75. <div class="bg-fave">
  76. <div class="container">
  77. <h1 class="text-left text-white m-0 p-0 py-5">
  78. {{if not (eq $.Data.Module "404")}}
  79. {{if eq $.Data.Module "index"}}
  80. {{if eq $.Data.Page.Alias "/"}}
  81. Welcome to home page
  82. {{else}}
  83. Welcome to some another page
  84. {{end}}
  85. {{else if or (eq $.Data.Module "blog") (eq $.Data.Module "blog-post") (eq $.Data.Module "blog-category")}}
  86. {{if eq $.Data.Module "blog-category"}}
  87. Blog category
  88. {{else if eq $.Data.Module "blog-post"}}
  89. Blog post
  90. {{else}}
  91. Blog
  92. {{end}}
  93. {{else if or (eq $.Data.Module "shop") (eq $.Data.Module "shop-product") (eq $.Data.Module "shop-category")}}
  94. {{if eq $.Data.Module "shop-category"}}
  95. Shop category
  96. {{else if eq $.Data.Module "shop-product"}}
  97. Shop product
  98. {{else}}
  99. Shop
  100. {{end}}
  101. {{end}}
  102. {{else}}
  103. Oops, page is not found...
  104. {{end}}
  105. </h1>
  106. </div>
  107. </div>
  108. <nav class="navbar navbar-expand-lg navbar-light bg-light navbar-cats">
  109. <div class="container">
  110. <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
  111. <span class="navbar-toggler-icon"></span>
  112. </button>
  113. <div class="collapse navbar-collapse" id="navbarSupportedContent">
  114. <ul class="navbar-nav mr-auto">
  115. {{range $.Data.Shop.Categories 0 1}}
  116. <li class="nav-item dropdown">
  117. <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{.Name}}</a>
  118. <div class="dropdown-menu" aria-labelledby="navbarDropdown">
  119. <a class="dropdown-item" href="{{.Permalink}}">All products</a>
  120. <div class="dropdown-divider"></div>
  121. {{range $index, $subcat := $.Data.Shop.Categories .Id 1}}
  122. <a class="dropdown-item" href="{{$subcat.Permalink}}">{{$subcat.Name}}</a>
  123. {{end}}
  124. </div>
  125. </li>
  126. {{end}}
  127. </ul>
  128. </div>
  129. </div>
  130. </nav>
  131. {{if or (eq $.Data.Module "blog") (eq $.Data.Module "blog-category") (eq $.Data.Module "blog-post")}}
  132. <div class="container clear-top pt-4">
  133. <nav aria-label="breadcrumb">
  134. <ol class="breadcrumb mb-0">
  135. {{if eq $.Data.Module "blog"}}
  136. <li class="breadcrumb-item">Blog</li>
  137. {{else}}
  138. <li class="breadcrumb-item"><a href="/blog/">Blog</a></li>
  139. {{end}}
  140. {{if eq $.Data.Module "blog-category"}}
  141. {{if $.Data.Blog.Category.Parent.Parent.Parent.Parent.Parent}}
  142. <li class="breadcrumb-item"><a href="{{$.Data.Blog.Category.Parent.Parent.Parent.Parent.Parent.Permalink}}">{{$.Data.Blog.Category.Parent.Parent.Parent.Parent.Parent.Name}}</a></li>
  143. {{end}}
  144. {{if $.Data.Blog.Category.Parent.Parent.Parent.Parent}}
  145. <li class="breadcrumb-item"><a href="{{$.Data.Blog.Category.Parent.Parent.Parent.Parent.Permalink}}">{{$.Data.Blog.Category.Parent.Parent.Parent.Parent.Name}}</a></li>
  146. {{end}}
  147. {{if $.Data.Blog.Category.Parent.Parent.Parent}}
  148. <li class="breadcrumb-item"><a href="{{$.Data.Blog.Category.Parent.Parent.Parent.Permalink}}">{{$.Data.Blog.Category.Parent.Parent.Parent.Name}}</a></li>
  149. {{end}}
  150. {{if $.Data.Blog.Category.Parent.Parent}}
  151. <li class="breadcrumb-item"><a href="{{$.Data.Blog.Category.Parent.Parent.Permalink}}">{{$.Data.Blog.Category.Parent.Parent.Name}}</a></li>
  152. {{end}}
  153. {{if $.Data.Blog.Category.Parent}}
  154. <li class="breadcrumb-item"><a href="{{$.Data.Blog.Category.Parent.Permalink}}">{{$.Data.Blog.Category.Parent.Name}}</a></li>
  155. {{end}}
  156. <li class="breadcrumb-item">{{$.Data.Blog.Category.Name}}</li>
  157. {{end}}
  158. {{if eq $.Data.Module "blog-post"}}
  159. <li class="breadcrumb-item active">{{$.Data.Blog.Post.Name}}</li>
  160. {{end}}
  161. </ol>
  162. </nav>
  163. </div>
  164. {{end}}
  165. {{if or (eq $.Data.Module "shop") (eq $.Data.Module "shop-category") (eq $.Data.Module "shop-product")}}
  166. <div class="container clear-top pt-4">
  167. <nav aria-label="breadcrumb">
  168. <ol class="breadcrumb mb-0">
  169. {{if eq $.Data.Module "shop"}}
  170. <li class="breadcrumb-item">Shop</li>
  171. {{else}}
  172. <li class="breadcrumb-item"><a href="/shop/">Shop</a></li>
  173. {{end}}
  174. {{if eq $.Data.Module "shop-category"}}
  175. {{if $.Data.Shop.Category.Parent.Parent.Parent.Parent.Parent}}
  176. <li class="breadcrumb-item"><a href="{{$.Data.Shop.Category.Parent.Parent.Parent.Parent.Parent.Permalink}}">{{$.Data.Shop.Category.Parent.Parent.Parent.Parent.Parent.Name}}</a></li>
  177. {{end}}
  178. {{if $.Data.Shop.Category.Parent.Parent.Parent.Parent}}
  179. <li class="breadcrumb-item"><a href="{{$.Data.Shop.Category.Parent.Parent.Parent.Parent.Permalink}}">{{$.Data.Shop.Category.Parent.Parent.Parent.Parent.Name}}</a></li>
  180. {{end}}
  181. {{if $.Data.Shop.Category.Parent.Parent.Parent}}
  182. <li class="breadcrumb-item"><a href="{{$.Data.Shop.Category.Parent.Parent.Parent.Permalink}}">{{$.Data.Shop.Category.Parent.Parent.Parent.Name}}</a></li>
  183. {{end}}
  184. {{if $.Data.Shop.Category.Parent.Parent}}
  185. <li class="breadcrumb-item"><a href="{{$.Data.Shop.Category.Parent.Parent.Permalink}}">{{$.Data.Shop.Category.Parent.Parent.Name}}</a></li>
  186. {{end}}
  187. {{if $.Data.Shop.Category.Parent}}
  188. <li class="breadcrumb-item"><a href="{{$.Data.Shop.Category.Parent.Permalink}}">{{$.Data.Shop.Category.Parent.Name}}</a></li>
  189. {{end}}
  190. <li class="breadcrumb-item">{{$.Data.Shop.Category.Name}}</li>
  191. {{end}}
  192. {{if eq $.Data.Module "shop-product"}}
  193. {{if $.Data.Shop.Product.Category.Id}}
  194. {{if $.Data.Shop.Product.Category.Parent.Parent.Parent.Parent.Parent}}
  195. <li class="breadcrumb-item"><a href="{{$.Data.Shop.Product.Category.Parent.Parent.Parent.Parent.Parent.Permalink}}">{{$.Data.Shop.Product.Category.Parent.Parent.Parent.Parent.Parent.Name}}</a></li>
  196. {{end}}
  197. {{if $.Data.Shop.Product.Category.Parent.Parent.Parent.Parent}}
  198. <li class="breadcrumb-item"><a href="{{$.Data.Shop.Product.Category.Parent.Parent.Parent.Parent.Permalink}}">{{$.Data.Shop.Product.Category.Parent.Parent.Parent.Parent.Name}}</a></li>
  199. {{end}}
  200. {{if $.Data.Shop.Product.Category.Parent.Parent.Parent}}
  201. <li class="breadcrumb-item"><a href="{{$.Data.Shop.Product.Category.Parent.Parent.Parent.Permalink}}">{{$.Data.Shop.Product.Category.Parent.Parent.Parent.Name}}</a></li>
  202. {{end}}
  203. {{if $.Data.Shop.Product.Category.Parent.Parent}}
  204. <li class="breadcrumb-item"><a href="{{$.Data.Shop.Product.Category.Parent.Parent.Permalink}}">{{$.Data.Shop.Product.Category.Parent.Parent.Name}}</a></li>
  205. {{end}}
  206. {{if $.Data.Shop.Product.Category.Parent}}
  207. <li class="breadcrumb-item"><a href="{{$.Data.Shop.Product.Category.Parent.Permalink}}">{{$.Data.Shop.Product.Category.Parent.Name}}</a></li>
  208. {{end}}
  209. <li class="breadcrumb-item"><a href="{{$.Data.Shop.Product.Category.Permalink}}">{{$.Data.Shop.Product.Category.Name}}</a></li>
  210. {{end}}
  211. <li class="breadcrumb-item active">{{$.Data.Shop.Product.Name}}</li>
  212. {{end}}
  213. </ol>
  214. </nav>
  215. </div>
  216. {{end}}
  217. <div class="container clear-top">
  218. <div class="row pt-4">
  219. {{if or (eq $.Data.Module "shop") (eq $.Data.Module "shop-category")}}
  220. <div class="col-sm-5 col-md-4 col-lg-3">
  221. {{template "sidebar-left.html" .}}
  222. </div>
  223. {{end}}
  224. {{if or (eq $.Data.Module "shop-product")}}
  225. <div class="col-md-12">
  226. {{else}}
  227. <div class="col-sm-7 col-md-8 col-lg-9">
  228. {{end}}`)