<!--
The single_basic.html partial layout in Jekyll allows you to create custom HTML, CSS, and JavaScript
for individual pages on your site without modifying the default layout. 
This makes it easier to maintain consistency across your site
while still allowing you to customize individual pages as needed.
It also allows you to reuse the same code for multiple pages,
making it a useful tool for creating custom widgets or demos that can be added to multiple pages on your site.

Take a look at https://gohugo.io/methods/page/layout/

# An example of `layouts/posts/foo.html`
# Then you can use it as layout = "foo" in .MD files' meta in your `content/posts` folder
{{ define "head" }}

###
HERE INSERT ANY CUSTOM <script/> or <style/>
###

{{ end }}{{ define "main" }}
<div class="post">
  # The post itself
  {{ partial "single_basic.html" . }}

  ###
  HERE INSERT ANY CUSTOM HTML
  ###
  
  # Comments block
  {{ if eq .Type $.Site.Params.contentTypeName }} {{ partial
  "posts_pagination.html" . }} {{ end }} {{ if not (.Params.hideComments |
  default false) }} {{ partial "comments.html" . }} {{ end }}
</div>
{{ end }}
-->

<h1 class="post-title">
  <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
<div class="post-meta">
  {{ if .Params.Date }}
    <span class="post-date">
      {{ .Date.Format "2006-01-02" }}
      {{ if $.Site.Params.showLastUpdated }}
        [{{or $.Site.Params.updatedDatePrefix "Updated"}}: {{ .Lastmod.Format "2006-01-02" }}]
      {{ end }}
    </span>
  {{ end }}
  {{ with .Params }}
    <span class="post-author">
      {{ if .AuthorTwitter }}
      <a href="https://x.com/@{{ .AuthorTwitter }}" target="_blank">{{ .Author }}</a>
      {{ else }}
      {{ .Author }}
      {{ end }}
    </span>
  {{ end }}
  <!-- comments counter -->
  {{ partial "comments_counter.html" . }}
  {{ if and (.Param "readingTime") (eq (.Param "readingTime") true) }}
    <span class="post-reading-time"> {{ .ReadingTime }} {{ $.Site.Params.minuteReadingTime | default "min read" }} ({{ .WordCount }} {{ $.Site.Params.words | default "words" }})</span>
  {{ end }}
</div>

{{ if .Params.tags }}
<span class="post-tags">
  {{ range .Params.tags }}
  #<a href="{{ (urls.JoinPath "tags" (urlize .) "/") | absLangURL }}">{{ . }}</a>&nbsp;
  {{ end }}
</span>
{{ end }}
{{ partial "cover.html" (dict "ctx" . "isCoverCaptionEnabled" true) }}

{{ if (.Params.Toc | default .Site.Params.Toc) }}
  <div class="table-of-contents">
    <h2>
      {{ (.Params.TocTitle | default .Site.Params.TocTitle) | default "Table of Contents" }}
    </h2>
    {{ .TableOfContents }}
  </div>
{{ end }}

<div class="post-content">
  {{- with .Content -}}
    <div>
      {{ . | replaceRE "(<h[1-9] id=\"([^\"]+)\".+)(</h[1-9]+>)" `${1}<a href="#${2}" class="hanchor" ariaLabel="Anchor">&#8983;</a> ${3}` | safeHTML }}
    </div>
  {{- end -}}
</div>