Skip to content

Instantly share code, notes, and snippets.

@am1t

am1t/single.html Secret

Created November 30, 2022 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save am1t/d8ffe5773b49ec3c037933895f6b6863 to your computer and use it in GitHub Desktop.
Save am1t/d8ffe5773b49ec3c037933895f6b6863 to your computer and use it in GitHub Desktop.
Single post layout for Anatole theme
{{ define "main" }}
<div
class="post {{ with .Site.Params.doNotLoadAnimations }}
.
{{ else }}
animated fadeInDown
{{ end }} h-entry "
>
{{ if .Params.thumbnail }}
<div class="post__thumbnail-wrapper">
<img class="post__thumbnail" src="{{ .Params.thumbnail | relURL }}" alt="Thumbnail image" />
</div>
{{ end }}
<div class="post__content">
<h1 class="p-name">{{ title .Title }}</h1>
{{ if or (eq .Type "post") (eq .Type .Site.Params.postSectionName) }}
<ul class="post__meta">
<li class="post__meta-item">
<em class="fas fa-calendar-day post__meta-icon"></em>
<span class="post__meta-text dt-published">{{ time.Format ":date_medium" .Date }}</span>
<a class="u-url" href="{{ .RelPermalink }}" style="display:none;"/>
</li>
<li class="post__meta-item">
<em class="fas fa-stopwatch post__meta-icon"></em>
<span class="post__meta-text">{{ i18n "reading_time" .ReadingTime }}</span>
</li>
</ul>
{{ end }}
{{- partial "expirationnote.html" . -}}
{{- if (eq .Params.toc true) -}}
<h3>Table of Contents</h3>
{{ .TableOfContents }}
{{- end -}}
<span class="e-content">
{{ .Content }}
</span>
{{- if isset .Params "series" -}}
{{- partial "series.html" . -}}
{{- end -}}
{{- if (eq .Site.Params.relatedPosts true) -}}
{{- partial "related.html" . -}}
{{- end -}}
{{- if (eq .Params.contact true) -}}
{{- partial "contact.html" . -}}
{{- end -}}
{{- if (eq .Site.Params.mermaid.enable true) -}}
{{- partial "mermaid.html" . -}}
{{- end -}}
</div>
<div class="post__footer">
{{ with .Page.Params.Categories }}
{{ partial "taxonomy/categories.html" . }}
{{ end }}
{{ with .Page.Params.Tags }}
{{ partial "taxonomy/tags.html" . }}
{{ end }}
</div>
<!-- Post Reply Plugins -->
{{ if eq .Type "post"}}
{{ if or (templates.Exists "partials/reply-by-email.html") (templates.Exists "partials/conversation-link.html") }}
<div class="post__footer post-reply">
{{ if templates.Exists "partials/reply-by-email.html" }}
{{ partial "reply-by-email.html" . }}
{{ end }}
{{ if templates.Exists "partials/conversation-link.html" }}
{{ partial "conversation-link.html" . }}
{{ end }}
</div>
{{ end }}
{{ end }}
{{ if and (or (eq .Type "post") (eq .Type .Site.Params.postSectionName)) (ne .Page.Params.disableComments true) }}
{{- if .Site.DisqusShortname -}}
<div id="comment">
<h2>{{ i18n "comments" }}</h2>
{{ template "_internal/disqus.html" . }}
</div>
{{- end -}}
{{- if .Site.Params.utterances.repo -}}
<div id="comment">
<h2>{{ i18n "comments" }}</h2>
{{ partial "comments/utterances.html" . }}
</div>
{{- end -}}
{{- if .Site.Params.CommentoURL -}}
<div id="comment">
<h2>{{ i18n "comments" }}</h2>
{{ partial "comments/commento.html" . }}
</div>
{{- end -}}
{{- if .Site.Params.gitalk.repo -}}
<div id="comment">
<h2>{{ i18n "comments" }}</h2>
{{ partial "comments/gitalk.html" . }}
</div>
{{- end -}}
{{ if .Site.Params.include_conversation }}
<script type="text/javascript" src="https://micro.blog/conversation.js?url={{ .Permalink }}"></script>
{{ end }}
{{ end }}
</div>
{{ end }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment