single.html 3.4 KB

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