single.html 3.7 KB

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