single.html 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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. <div class="author-profile ml-auto align-self-lg-center">
  36. <img class="rounded-circle" src='{{ partial "helpers/get-author-image.html" . }}' alt="Author Image">
  37. <h5 class="author-name">{{ partial "helpers/get-author-name.html" . }}</h5>
  38. <p class="text-muted">{{ .Page.Date | time.Format ":date_full" }}{{ if site.Params.features.readingTime }} | {{ .ReadingTime }} {{i18n "minute" .ReadingTime }}{{ end }}</p>
  39. </div>
  40. <div class="title">
  41. <h1>{{ .Page.Title }}</h1>
  42. </div>
  43. {{ if site.Params.features.tags.enable }}
  44. {{partial "misc/tags.html" .Params.tags }}
  45. {{ end }}
  46. <div class="post-content" id="post-content">
  47. {{ .Page.Content }}
  48. </div>
  49. <!-- Share or Contribute -->
  50. <div class="row pl-3 pr-3">
  51. <!--Social Media Share Buttons-->
  52. <div class="col-md-6 share-buttons">
  53. {{ if site.Params.features.blog.shareButtons }}
  54. <strong>{{ i18n "share_on" }}:</strong>
  55. {{ if site.Params.features.blog.shareButtons.facebook }}
  56. <a class="btn icon-button bg-facebook" href="https://www.facebook.com/sharer.php?u={{ .Permalink }}" target="_blank">
  57. <i class="fab fa-facebook"></i>
  58. </a>
  59. {{ end }}
  60. {{ if site.Params.features.blog.shareButtons.twitter }}
  61. <a class="btn icon-button bg-twitter" href="https://twitter.com/share?url={{ .Permalink }}&text={{ .Title }}&via={{- site.Title -}}" target="_blank">
  62. <i class="fab fa-twitter"></i>
  63. </a>
  64. {{ end }}
  65. {{ if site.Params.features.blog.shareButtons.reddit }}
  66. <a class="btn icon-button bg-reddit" href="https://reddit.com/submit?url={{ .Permalink }}&title={{ .Title }}" target="_blank">
  67. <i class="fab fa-reddit"></i>
  68. </a>
  69. {{ end }}
  70. {{ if site.Params.features.blog.shareButtons.tumblr }}
  71. <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">
  72. <i class="fab fa-tumblr"></i>
  73. </a>
  74. {{ end }}
  75. {{ if site.Params.features.blog.shareButtons.pocket }}
  76. <a class="btn icon-button bg-pocket" href="https://getpocket.com/save?url={{ .Permalink }}&title={{ .Title }}" target="_blank">
  77. <i class="fab fa-get-pocket"></i>
  78. </a>
  79. {{ end }}
  80. {{ if site.Params.features.blog.shareButtons.linkedin }}
  81. <a class="btn icon-button bg-linkedin" href="https://www.linkedin.com/shareArticle?url={{ .Permalink }}&title={{ .Title }}" target="_blank">
  82. <i class="fab fa-linkedin"></i>
  83. </a>
  84. {{ end }}
  85. {{ if site.Params.features.blog.shareButtons.diaspora }}
  86. <a class="btn icon-button bg-diaspora" href="https://share.diasporafoundation.org/?title={{ .Title }}&url={{ .Permalink }}" rel="nofollow" target="_blank">
  87. <i class="fab fa-diaspora"></i>
  88. </a>
  89. {{ end }}
  90. {{ if site.Params.features.blog.shareButtons.mastodon }}
  91. <a class="btn icon-button bg-mastodon" href="https://mastodon.social/share?text={{ .Title }} - {{ .Permalink }}" target="_blank">
  92. <i class="fab fa-mastodon"></i>
  93. </a>
  94. {{ end }}
  95. {{ if site.Params.features.blog.shareButtons.whatsapp }}
  96. <a class="btn icon-button bg-whatsapp" href="https://api.whatsapp.com/send?text={{ .Title }} {{ .Permalink }}" target="_blank">
  97. <i class="fab fa-whatsapp"></i>
  98. </a>
  99. {{ end }}
  100. {{ if site.Params.features.blog.shareButtons.email }}
  101. <a class="btn icon-button" href="mailto:?subject={{ .Title }}&body={{ .Permalink }}" target="_blank">
  102. <i class="fas fa-envelope-open-text"></i>
  103. </a>
  104. {{ end }}
  105. {{ end }}
  106. </div>
  107. <!--- Improve this page button --->
  108. {{ if site.Params.GitRepo }}
  109. {{ if site.Params.GitBranch }}
  110. {{ .Scratch.Set "GitBranch" site.Params.GitBranch }}
  111. {{ else }}
  112. {{ .Scratch.Set "GitBranch" "main" }}
  113. {{ end }}
  114. <div class="col-md-6 btn-improve-page">
  115. {{ if ( eq site.Params.GitForge "gitlab" ) }}
  116. <a href="{{ site.Params.GitRepo }}/-/edit/{{ .Scratch.Get "GitBranch" }}/content/{{ .File.Path }}" title="{{ i18n "improve_this_page" }}" target="_blank" rel="noopener">
  117. {{ else if ( eq site.Params.GitForge "gitea" ) }}
  118. <a href="{{ site.Params.GitRepo }}/_edit/{{ .Scratch.Get "GitBranch" }}/content/{{ .File.Path }}" title="{{ i18n "improve_this_page" }}" target="_blank" rel="noopener">
  119. {{ else }} <!--- Make Github-style the default -->
  120. <a href="{{ site.Params.GitRepo }}/edit/{{ .Scratch.Get "GitBranch" }}/content/{{ .File.Path }}" title="{{ i18n "improve_this_page" }}" target="_blank" rel="noopener">
  121. {{ end }}
  122. <i class="fas fa-code-branch"></i>
  123. {{ i18n "improve_this_page" }}
  124. </a>
  125. </div>
  126. {{ end }}
  127. </div>
  128. <!---Next and Previous Navigator -->
  129. <hr />
  130. {{ partial "navigators/next-prev-navigator.html" . }}
  131. <hr />
  132. <!----- Add comment support ----->
  133. {{ if site.Params.features.comment.enable }}
  134. {{ partial "comments.html" site.Params.features.comment.services }}
  135. {{ end }}
  136. <!-- Keep backward compatibility with old config.yaml -->
  137. {{ if site.DisqusShortname }}
  138. {{ partial "comments/disqus.html" (dict (slice "disqus" "shortName") site.DisqusShortname) }}
  139. {{ end }}
  140. </div>
  141. </div>
  142. </div>
  143. <!--scroll back to top-->
  144. <a id="scroll-to-top" class="btn"><i class="fas fa-chevron-circle-up"></i></a>
  145. </section>
  146. {{ end }}
  147. {{ define "toc" }}
  148. <section class="toc-section" id="toc-section">
  149. {{ if and site.Params.features.toc.enable ( .Params.enableTOC | default true ) }}
  150. <div class="toc-holder">
  151. <h5 class="text-center pl-3">{{ i18n "toc_heading" }}</h5>
  152. <hr>
  153. <div class="toc">
  154. {{ .TableOfContents }}
  155. </div>
  156. </div>
  157. {{ end }}
  158. </section>
  159. {{ end }}