A web blog and personal homepage engine written in Go.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

224 lines
7.6 KiB

  1. {{ define "title" }}{{ end }}
  2. {{ define "scripts" }}{{ end }}
  3. {{ define "layout" }}
  4. <!DOCTYPE html>
  5. <html lang="en">
  6. <head>
  7. <meta charset="utf-8">
  8. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  9. <title>{{ template "title" . }} - {{ .Title }}</title>
  10. <!-- Bootstrap core CSS -->
  11. <link rel="stylesheet" href="/_builtin/bootstrap/css/bootstrap.min.css">
  12. <link rel="stylesheet" href="/_builtin/theme/theme.css">
  13. <link rel="stylesheet" href="/_builtin/blog-core.css">
  14. <!-- <link rel="stylesheet" href="/css/gfm.css"> -->
  15. </head>
  16. <body>
  17. <nav class="navbar navbar-expand-md fixed-top bluez-navbar">
  18. <a href="#" class="navbar-brand">{{ .Title }}</a>
  19. <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
  20. <span class="navbar-toggler-icon"></span>
  21. </button>
  22. <div class="collapse navbar-collapse" id="navbarCollapse">
  23. <ul class="navbar-nav mr-auto">
  24. <li class="nav-item active">
  25. <a href="/" class="nav-link">Home <span class="sr-only">(current)</span></a>
  26. </li>
  27. <li class="nav-item">
  28. <a href="/about" class="nav-link">About</a>
  29. </li>
  30. <li class="nav-item">
  31. <a href="/tagged" class="nav-link">Tags</a>
  32. </li>
  33. <li class="nav-item">
  34. <a href="/archive" class="nav-link">Archive</a>
  35. </li>
  36. <li class="nav-item">
  37. <a href="/contact" class="nav-link">Contact Me</a>
  38. </li>
  39. </ul>
  40. <form class="form-inline mt-2 mt-md-0">
  41. <input class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="Search">
  42. <button class="btn btn-outline-light my-2 my-sm-0" type="submit">Search</button>
  43. </form>
  44. </div>
  45. </nav>
  46. <div class="bluez-header">
  47. <div class="container">
  48. <h1 class="bluez-title">{{ .Title }}</h1>
  49. <p class="lead bluez-description">{{ .Description }}</p>
  50. </div>
  51. </div>
  52. <div class="container mb-5">
  53. <div class="row">
  54. <div class="col-9">
  55. {{ if .SetupNeeded }}
  56. <div class="alert alert-success">
  57. Your web blog needs to be set up!
  58. Please <a href="/admin/setup">click here</a> to
  59. configure your blog.
  60. </div>
  61. {{ end }}
  62. {{ range .Flashes }}
  63. <div class="alert alert-success">
  64. {{ . }}
  65. </div>
  66. {{ end }}
  67. {{ if or .Error .ValidationError }}
  68. <div class="alert alert-danger">
  69. <strong>Error:</strong> {{ or .Error "Validation Error" }}.
  70. {{ if .ValidationError }}
  71. <ul>
  72. {{ range $key, $val := .ValidationError }}
  73. {{ range $bullet := $val }}
  74. <li>{{ $key }}: {{ $bullet }}</li>
  75. {{ end }}
  76. {{ end }}
  77. </ul>
  78. {{ end }}
  79. </div>
  80. {{ end }}
  81. {{ template "content" . }}
  82. </div>
  83. <div class="col-3">
  84. <div class="card mb-4">
  85. <div class="card-body">
  86. <h4 class="card-title">About</h4>
  87. <p>Hello, world!</p>
  88. </div>
  89. </div>
  90. <div class="card mb-4">
  91. <div class="card-body">
  92. <h4 class="card-title">Pages</h4>
  93. <ul class="list-unstyled">
  94. <li class="list-item"><a href="/comments">Recent Comments</a></li>
  95. <li class="list-item"><a href="/guestbook">Guestbook</a></li>
  96. </ul>
  97. </div>
  98. </div>
  99. {{ if .LoggedIn }}
  100. <div class="card mb-4">
  101. <div class="card-body">
  102. <h4 class="cart-title">Control Center</h4>
  103. <p>
  104. Logged in as: <a href="/account">{{ .CurrentUser.Name }}</a>
  105. </p>
  106. <ul class="list-unstyled">
  107. {{ if .CurrentUser.IsAdmin }}
  108. <li class="list-item"><a href="/admin">Admin Center</a></li>
  109. {{ end }}
  110. <li class="list-item"><a href="/logout">Log out</a></li>
  111. </ul>
  112. <h5>Manage Blog</h5>
  113. <ul class="list-unstyled">
  114. <li class="list-item"><a href="/blog/edit">Post Blog Entry</a></li>
  115. <li class="list-item"><a href="/blog/drafts">View Drafts</a></li>
  116. <li class="list-item"><a href="/blog/private">View Private</a></li>
  117. <li class="list-item"><a href="/blog/unlisted">View Unlisted</a></li>
  118. </ul>
  119. </div>
  120. </div>
  121. {{ end }}
  122. <div class="card mb-4">
  123. <div class="card-body">
  124. <h4 class="card-title">Archives</h4>
  125. <ul class="nav flex-column">
  126. <li class="nav-item">
  127. <a class="nav-link" href="#">March 2018</a>
  128. </li>
  129. <li class="nav-item">
  130. <a class="nav-link" href="#">February 2018</a>
  131. </li>
  132. <li class="nav-item">
  133. <a class="nav-link" href="#">January 2018</a>
  134. </li>
  135. </ul>
  136. </div>
  137. </div>
  138. <div class="card">
  139. <div class="card-body">
  140. <h4 class="card-title">Elsewhere</h4>
  141. <ul class="nav flex-column">
  142. <li class="nav-item">
  143. <a class="nav-link" href="#">Facebook</a>
  144. </li>
  145. <li class="nav-item">
  146. <a class="nav-link" href="#">Twitter</a>
  147. </li>
  148. </ul>
  149. </div>
  150. </div>
  151. </div>
  152. </div>
  153. </div>
  154. <footer class="bluez-footer">
  155. <div class="container">
  156. <div class="row">
  157. <div class="col-8">
  158. <ul class="nav">
  159. <li class="nav-item">
  160. <a class="nav-link" href="#">RSS</a>
  161. </li>
  162. <li class="nav-item">
  163. <a class="nav-link" href="#">Random</a>
  164. </li>
  165. <li class="nav-item">
  166. <a class="nav-link" href="#">Archive</a>
  167. </li>
  168. <li class="nav-item">
  169. <a class="nav-link" href="#">Ask me anything</a>
  170. </li>
  171. <li class="nav-item">
  172. <a class="nav-link" href="#">Back to top</a>
  173. </li>
  174. {{ if .LoggedIn }}
  175. <li class="nav-item">
  176. <a class="nav-link" href="/logout">Log out</a>
  177. </li>
  178. {{ else }}
  179. <li class="nav-item">
  180. <a class="nav-link" href="/login">Log in</a>
  181. </li>
  182. {{ end }}
  183. </ul>
  184. </div>
  185. <div class="col-4">
  186. Copyright 2017
  187. </div>
  188. </div>
  189. </div>
  190. </footer>
  191. {{ template "scripts" or "" }}
  192. </body>
  193. </html>
  194. {{ end }}