Skip to content

Instantly share code, notes, and snippets.

@jdheyburn
Last active April 14, 2020 07:52
Show Gist options
  • Save jdheyburn/35a10e346848379ec5f6f87cb48454cd to your computer and use it in GitHub Desktop.
Save jdheyburn/35a10e346848379ec5f6f87cb48454cd to your computer and use it in GitHub Desktop.
A hugo-coder modification to allow emojified titles and table of contents
{{ define "title" }}
{{ if .Site.Params.enableEmoji }}
{{ .Title | emojify }} · {{ .Site.Title | emojify }}
{{ else }}
{{ .Title }} · {{ .Site.Title }}
{{ end }}
{{ end }}
{{ define "content" }}
<section class="container post">
<article>
<header>
<div class="post-title">
<h1 class="title">
{{ if .Site.Params.enableEmoji }}
{{ .Title | emojify }}
{{ else }}
{{ .Title }}
{{ end }}
</h1>
</div>
<div class="post-meta">
<div class="date">
<span class="posted-on">
<i class="fas fa-calendar"></i>
<time datetime='{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}'>
{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}
</time>
</span>
<span class="reading-time">
<i class="fas fa-clock"></i>
{{ i18n "reading_time" .ReadingTime }}
</span>
</div>
{{ with .Page.Params.Categories }}{{ partial "taxonomy/categories.html" . }}{{ end }}
{{ with .Page.Params.Tags }}{{ partial "taxonomy/tags.html" . }}{{ end }}
</div>
</header>
<div>
{{ if .Params.featured_image }}
<img src='{{ .Params.featured_image }}' alt="Featured image"/>
{{ end }}
{{ partial "toc.html" . }}
{{ .Content }}
</div>
<footer>
{{ partial "posts/series.html" . }}
{{ partial "posts/disqus.html" . }}
{{ partial "posts/commento.html" . }}
{{ partial "posts/utteranc.html" . }}
</footer>
</article>
{{ partial "posts/math.html" . }}
</section>
{{ end }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment