{{ define "header" }}
<meta name="description" content="{{ if .Description }}{{ .Description }}{{ else }}{{ .Title }}{{ end }}" />
<link
  rel="stylesheet"
  href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/styles/atom-one-dark.min.css"
/>
<link rel="stylesheet" href="/assets/css/single.css" />
<link rel="stylesheet" href="/assets/css/navigators/sidebar.css">
{{ end }}

{{ define "navbar" }}
    {{ partial "navigators/navbar-2.html" . }}
{{ end }}

{{ define "sidebar" }}
  <section class="sidebar-section" id="sidebar-section">
    <div class="sidebar-holder">
      <div class="sidebar" id="sidebar">
        <input type="text" value="" placeholder="Search" data-search="" id="search-box" />
        <div class="sidebar-tree">
          <ul class="tree" id="tree">
            <li id="list-heading"><a href="/posts" data-filter="all">Posts</a></li>
            <div class="subtree">
                {{ partial "navigators/sidebar.html" (dict "menus" .Site.Menus.sidebar "ctx" .) }}
            </div>
          </ul>
        </div>
      </div>
    </div>
  </section>
{{ end }}

{{ define "content" }}
<section class="content-section" id="content-section">
  <div class="content">
    <div class="container p-0 read-area">
      <!--Hero Area-->
      <div class="hero-area col-sm-12" id="hero-area" style='background-image: url({{ strings.TrimSuffix "/" .Site.BaseURL }}{{ partial "helpers/get-hero.html" . }});'>
      </div>

      <!--Content Start-->
      <div class="page-content">
        <div class="author-profile ml-auto align-self-lg-center">
          <img class="rounded-circle" src='{{ partial "helpers/get-author-image.html" . }}'/>
          <h5 class="author-name">{{ partial "helpers/get-author-name.html" . }}</h5>
          <p>{{ .Page.Date.Format "January 2, 2006" }}</p>
        </div>

        <div class="title">
          <h1>{{ .Page.Title }}</h1>
        </div>

        <div class="post-content" id="post-content">
          {{ .Page.Content }}
        </div>

        <!--- Improve this page button --->
        {{ if .Site.Params.GitRepo }}
          <div class="btn-improve-page">
              <a href="{{ .Site.Params.GitRepo }}/edit/master/content/{{ .File.Path }}">
                <i class="fas fa-code-branch"></i>
                Improve This Page
              </a>
          </div>
        {{ end }}

        <!---Next and Previous Navigator -->
      <hr />
        {{ partial "navigators/next-prev-navigator.html" . }}
      <hr />
      <!-- Add Disqus forum  -->
      {{ if .Site.DisqusShortname }}
          {{ partial "disqus.html" . }}
      {{ end }}
      </div>
    </div>
  </div>
</section>
{{ end }}

{{ define "toc" }}
  <section class="toc-section" id="toc-section">
    {{ if site.Params.enableTOC }}
    <div class="toc-holder">
      <h5 class="text-center pl-3">Table of Contents</h5>
      <hr>
      <div class="toc">
        {{ .TableOfContents }}
      </div>
    </div>
    {{ end }}
  </section>
{{ end }}

{{ define "scripts" }}
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/highlight.min.js"></script>
<script src="/assets/js/single.js"></script>
<script>
  hljs.initHighlightingOnLoad();
</script>
{{ if .Params.math }}
    {{ partial "math.html" . }}
{{ end }}
{{ end }}
