single.html 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. {{ define "header" }}
  2. <meta name="description" content="{{ if .Description }}{{ .Description }}{{ else }}{{ .Title }}{{ end }}" />
  3. {{ end }}
  4. {{ define "navbar" }}
  5. {{ partial "navigators/navbar.html" . }}
  6. {{ end }}
  7. {{ define "sidebar" }}
  8. <section class="sidebar-section" id="sidebar-section">
  9. <div class="sidebar-holder">
  10. <div class="sidebar" id="sidebar">
  11. <form class="mx-auto" method="get" action="{{ "search" | relLangURL }}">
  12. <input type="text" name="keyword" value="" placeholder="{{ i18n "search" }}" data-search="" id="search-box" />
  13. </form>
  14. <div class="sidebar-tree">
  15. <ul class="tree" id="tree">
  16. <li id="list-heading"><a href="{{ "/posts/" | relLangURL }}" data-filter="all">{{ i18n "posts" }}</a></li>
  17. <div class="subtree">
  18. {{ partial "navigators/sidebar.html" (dict "menuName" "sidebar" "menuItems" site.Menus.sidebar "ctx" .) }}
  19. </div>
  20. </ul>
  21. </div>
  22. </div>
  23. </div>
  24. </section>
  25. {{ end }}
  26. {{ define "content" }}
  27. <section class="content-section" id="content-section">
  28. <div class="content">
  29. <div class="container p-0 read-area">
  30. <!--Hero Area-->
  31. <div class="hero-area col-sm-12" id="hero-area" style='background-image: url({{ partial "helpers/get-hero.html" . }});'>
  32. </div>
  33. <!--Content Start-->
  34. <div class="page-content">
  35. {{ if site.Params.features.blog.showAuthor | default true }}
  36. <div class="author-profile ml-auto align-self-lg-center">
  37. <img class="rounded-circle" src='{{ partial "helpers/get-author-image.html" . }}' alt="Author Image">
  38. <h5 class="author-name">{{ partial "helpers/get-author-name.html" . }}</h5>
  39. <p class="text-muted">{{ .Page.Date | time.Format ":date_full" }}{{ if site.Params.features.readingTime }} | {{ .ReadingTime }} {{i18n "minute" .ReadingTime }}{{ end }}</p>
  40. </div>
  41. {{ else }}
  42. <div style="margin-bottom: 80px;"></div>
  43. {{ end }}
  44. <div class="title">
  45. <h1>{{ .Page.Title }}</h1>
  46. </div>
  47. {{ if not (site.Params.features.blog.showAuthor | default true) }}
  48. <div class="author-profile ml-auto align-self-lg-center">
  49. <p class="text-muted">{{ .Page.Date | time.Format ":date_full" }}{{ if site.Params.features.readingTime }} | {{ .ReadingTime }} {{i18n "minute" .ReadingTime }}{{ end }}</p>
  50. </div>
  51. {{ end }}
  52. {{ if site.Params.features.tags.enable }}
  53. {{partial "misc/tags.html" .Params.tags }}
  54. {{ end }}
  55. <div class="post-content" id="post-content">
  56. {{ .Page.Content }}
  57. </div>
  58. <!-- Share or Contribute -->
  59. <div class="row pl-3 pr-3">
  60. <!--Social Media Share Buttons-->
  61. <div class="col-md-6 share-buttons">
  62. {{ if site.Params.features.blog.shareButtons }}
  63. <strong>{{ i18n "share_on" }}:</strong>
  64. {{ if site.Params.features.blog.shareButtons.facebook }}
  65. <a class="btn icon-button bg-facebook" href="https://www.facebook.com/sharer.php?u={{ .Permalink }}" target="_blank">
  66. <i class="fab fa-facebook"></i>
  67. </a>
  68. {{ end }}
  69. {{ if site.Params.features.blog.shareButtons.twitter }}
  70. <a class="btn icon-button bg-twitter" href="https://twitter.com/share?url={{ .Permalink }}&text={{ .Title }}&via={{- site.Title -}}" target="_blank">
  71. <i class="fab fa-twitter"></i>
  72. </a>
  73. {{ end }}
  74. {{ if site.Params.features.blog.shareButtons.reddit }}
  75. <a class="btn icon-button bg-reddit" href="https://reddit.com/submit?url={{ .Permalink }}&title={{ .Title }}" target="_blank">
  76. <i class="fab fa-reddit"></i>
  77. </a>
  78. {{ end }}
  79. {{ if site.Params.features.blog.shareButtons.tumblr }}
  80. <a class="btn icon-button bg-tumblr" href="https://www.tumblr.com/share/link?url={{ .Permalink }}&name={{ .Title }}{{- with .Params.description -}}&description={{- . -}}{{- end -}}" target="_blank">
  81. <i class="fab fa-tumblr"></i>
  82. </a>
  83. {{ end }}
  84. {{ if site.Params.features.blog.shareButtons.pocket }}
  85. <a class="btn icon-button bg-pocket" href="https://getpocket.com/save?url={{ .Permalink }}&title={{ .Title }}" target="_blank">
  86. <i class="fab fa-get-pocket"></i>
  87. </a>
  88. {{ end }}
  89. {{ if site.Params.features.blog.shareButtons.linkedin }}
  90. <a class="btn icon-button bg-linkedin" href="https://www.linkedin.com/shareArticle?url={{ .Permalink }}&title={{ .Title }}" target="_blank">
  91. <i class="fab fa-linkedin"></i>
  92. </a>
  93. {{ end }}
  94. {{ if site.Params.features.blog.shareButtons.diaspora }}
  95. <a class="btn icon-button bg-diaspora" href="https://share.diasporafoundation.org/?title={{ .Title }}&url={{ .Permalink }}" rel="nofollow" target="_blank">
  96. <i class="fab fa-diaspora"></i>
  97. </a>
  98. {{ end }}
  99. {{ if site.Params.features.blog.shareButtons.mastodon }}
  100. <a class="btn icon-button bg-mastodon" href="https://mastodon.social/share?text={{ .Title }} - {{ .Permalink }}" target="_blank">
  101. <i class="fab fa-mastodon"></i>
  102. </a>
  103. {{ end }}
  104. {{ if site.Params.features.blog.shareButtons.whatsapp }}
  105. <a class="btn icon-button bg-whatsapp" href="https://api.whatsapp.com/send?text={{ .Title }} {{ .Permalink }}" target="_blank">
  106. <i class="fab fa-whatsapp"></i>
  107. </a>
  108. {{ end }}
  109. {{ if site.Params.features.blog.shareButtons.email }}
  110. <a class="btn icon-button" href="mailto:?subject={{ .Title }}&body={{ .Permalink }}" target="_blank">
  111. <i class="fas fa-envelope-open-text"></i>
  112. </a>
  113. {{ end }}
  114. {{ end }}
  115. </div>
  116. <!--- Improve this page button --->
  117. {{ if site.Params.GitRepo }}
  118. {{ if site.Params.GitBranch }}
  119. {{ .Scratch.Set "GitBranch" site.Params.GitBranch }}
  120. {{ else }}
  121. {{ .Scratch.Set "GitBranch" "main" }}
  122. {{ end }}
  123. <div class="col-md-6 btn-improve-page">
  124. {{ if ( eq site.Params.GitForge "gitlab" ) }}
  125. <a href="{{ site.Params.GitRepo }}/-/edit/{{ .Scratch.Get "GitBranch" }}/content/{{ .File.Path }}" title="{{ i18n "improve_this_page" }}" target="_blank" rel="noopener">
  126. {{ else if ( eq site.Params.GitForge "gitea" ) }}
  127. <a href="{{ site.Params.GitRepo }}/_edit/{{ .Scratch.Get "GitBranch" }}/content/{{ .File.Path }}" title="{{ i18n "improve_this_page" }}" target="_blank" rel="noopener">
  128. {{ else }} <!--- Make Github-style the default -->
  129. <a href="{{ site.Params.GitRepo }}/edit/{{ .Scratch.Get "GitBranch" }}/content/{{ .File.Path }}" title="{{ i18n "improve_this_page" }}" target="_blank" rel="noopener">
  130. {{ end }}
  131. <i class="fas fa-code-branch"></i>
  132. {{ i18n "improve_this_page" }}
  133. </a>
  134. </div>
  135. {{ end }}
  136. </div>
  137. <!---Next and Previous Navigator -->
  138. <hr />
  139. {{ partial "navigators/next-prev-navigator.html" . }}
  140. <hr />
  141. <!----- Add comment support ----->
  142. {{ if site.Params.features.comment.enable }}
  143. {{ partial "comments.html" site.Params.features.comment.services }}
  144. {{ end }}
  145. <!-- Keep backward compatibility with old config.yaml -->
  146. {{ if site.DisqusShortname }}
  147. {{ partial "comments/disqus.html" (dict (slice "disqus" "shortName") site.DisqusShortname) }}
  148. {{ end }}
  149. </div>
  150. </div>
  151. </div>
  152. <!--scroll back to top-->
  153. <a id="scroll-to-top" class="btn" data-toggle="tooltip" data-placement="left" title="Scroll to top">
  154. <i class="fas fa-chevron-circle-up"></i>
  155. </a>
  156. </section>
  157. {{ end }}
  158. {{ define "toc" }}
  159. <section class="toc-section" id="toc-section">
  160. {{ if and site.Params.features.toc.enable ( .Params.enableTOC | default true ) }}
  161. <div class="toc-holder">
  162. <h5 class="text-center pl-3">{{ i18n "toc_heading" }}</h5>
  163. <hr>
  164. <div class="toc">
  165. {{ .TableOfContents }}
  166. </div>
  167. </div>
  168. {{ end }}
  169. </section>
  170. {{ end }}