single.html 8.5 KB

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