single.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. {{ define "header" }}
  2. <meta name="description" content="{{ if .Description }}{{ .Description }}{{ else }}{{ .Title }}{{ end }}" />
  3. <link
  4. rel="stylesheet"
  5. href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/styles/atom-one-dark.min.css"
  6. />
  7. <link rel="stylesheet" href="{{ "/css/layouts/single.css" | relURL }}"/>
  8. <link rel="stylesheet" href="{{ "/css/navigators/sidebar.css" | relURL }}">
  9. <!--================= custom style overrides =========================-->
  10. <link rel="stylesheet" href="{{ "/css/style.css" | relURL }}"/>
  11. {{ end }}
  12. {{ define "navbar" }}
  13. {{ partial "navigators/navbar-2.html" . }}
  14. {{ end }}
  15. {{ define "sidebar" }}
  16. <section class="sidebar-section" id="sidebar-section">
  17. <div class="sidebar-holder">
  18. <div class="sidebar" id="sidebar">
  19. <form class="mx-auto" method="get" action="{{ "search" | relLangURL }}">
  20. <input type="text" name="keyword" value="" placeholder="Search" data-search="" id="search-box" />
  21. </form>
  22. <div class="sidebar-tree">
  23. <ul class="tree" id="tree">
  24. <li id="list-heading"><a href="{{ "/posts" | relLangURL }}" data-filter="all">{{ i18n "posts" }}</a></li>
  25. <div class="subtree">
  26. {{ partial "navigators/sidebar.html" (dict "menuName" "sidebar" "menuItems" site.Menus.sidebar "ctx" .) }}
  27. </div>
  28. </ul>
  29. </div>
  30. </div>
  31. </div>
  32. </section>
  33. {{ end }}
  34. {{ define "content" }}
  35. <section class="content-section" id="content-section">
  36. <div class="content">
  37. <div class="container p-0 read-area">
  38. <!--Hero Area-->
  39. <div class="hero-area col-sm-12" id="hero-area" style='background-image: url({{ strings.TrimSuffix "/" site.BaseURL }}{{ partial "helpers/get-hero.html" . }});'>
  40. </div>
  41. <!--Content Start-->
  42. <div class="page-content">
  43. <div class="author-profile ml-auto align-self-lg-center">
  44. <img class="rounded-circle" src='{{ partial "helpers/get-author-image.html" . }}' alt="Author Image">
  45. <h5 class="author-name">{{ partial "helpers/get-author-name.html" . }}</h5>
  46. <p>{{ .Page.Date.Format "January 2, 2006" }}</p>
  47. </div>
  48. <div class="title">
  49. <h1>{{ .Page.Title }}</h1>
  50. </div>
  51. <div class="post-content" id="post-content">
  52. {{ .Page.Content }}
  53. </div>
  54. <!--- Improve this page button --->
  55. {{ if site.Params.GitRepo }}
  56. <div class="btn-improve-page">
  57. <a href="{{ site.Params.GitRepo }}/edit/{{ site.Params.GitBranch }}/content/{{ .File.Path }}" title="{{ i18n "improve_this_page" }}" target="_blank" rel="noopener">
  58. <i class="fas fa-code-branch"></i>
  59. {{ i18n "improve_this_page" }}
  60. </a>
  61. </div>
  62. {{ end }}
  63. <!---Next and Previous Navigator -->
  64. <hr />
  65. {{ partial "navigators/next-prev-navigator.html" . }}
  66. <hr />
  67. <!-- Add Disqus forum -->
  68. {{ if site.DisqusShortname }}
  69. {{ partial "disqus.html" . }}
  70. {{ end }}
  71. </div>
  72. </div>
  73. </div>
  74. <!--scroll back to top-->
  75. <a id="scroll-to-top" class="btn"><i class="fas fa-chevron-circle-up"></i></a>
  76. {{ if .IsTranslated }}
  77. {{ partial "navigators/floating-lang-selector.html" . }}
  78. {{ end }}
  79. </section>
  80. {{ end }}
  81. {{ define "toc" }}
  82. <section class="toc-section" id="toc-section">
  83. {{ if site.Params.enableTOC }}
  84. <div class="toc-holder">
  85. <h5 class="text-center pl-3">{{ i18n "toc_heading" }}</h5>
  86. <hr>
  87. <div class="toc">
  88. {{ .TableOfContents }}
  89. </div>
  90. </div>
  91. {{ end }}
  92. </section>
  93. {{ end }}
  94. {{ define "scripts" }}
  95. <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/highlight.min.js"></script>
  96. <script src="{{ "/js/single.js" | relURL }}"></script>
  97. <script>
  98. hljs.initHighlightingOnLoad();
  99. </script>
  100. {{ if .Params.math }}
  101. {{ partial "math.html" . }}
  102. {{ end }}
  103. {{ end }}