c194169315
* .Site.IsServer was deprecated in Hugo v0.120.0, replaced by hugo.IsServer * .Site.DisqusShortname was deprecated in Hugo v0.120.0, replaced by .Site.Config.Services.Disqus.Shortname * Use .RenderString instead of markdownify (solves #104) * The "tweet" shortcode requires two named parameters user and id. * Replace .Site.BaseURL by absURL (solves #103)
43 lines
1 KiB
HTML
43 lines
1 KiB
HTML
{{ define "main" }}
|
|
<main>
|
|
<article>
|
|
<div class="title">
|
|
<h1 class="title">{{ .Title }}</h1>
|
|
<div class="meta">Posted on {{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</div>
|
|
</div>
|
|
{{ if isset .Params "tldr" }}
|
|
<div class="tldr">
|
|
<strong>tl;dr:</strong>
|
|
{{ .Params.tldr }}
|
|
</div>{{ end }}
|
|
|
|
<section class="body">
|
|
{{ .Content }}
|
|
</section>
|
|
|
|
<div class="post-tags">
|
|
{{ if ne .Type "page" }}
|
|
{{ if gt .Params.tags 0 }}
|
|
<nav class="nav tags">
|
|
<ul class="tags">
|
|
{{ range .Params.tags }}
|
|
<li><a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a></li>
|
|
{{ end }}
|
|
</ul>
|
|
</nav>
|
|
{{ end }}
|
|
{{ end }}
|
|
</div>
|
|
{{- $.Scratch.Set "isDisqus" true -}}
|
|
<!-- Check if disqus short name is given -->
|
|
{{ if not .Site.Config.Services.Disqus.Shortname }}
|
|
{{- $.Scratch.Set "isDisqus" false -}}
|
|
{{ end }}
|
|
|
|
{{- if eq ($.Scratch.Get "isDisqus") true -}}
|
|
{{- partial "disqus.html" . -}}
|
|
{{- end -}}
|
|
</article>
|
|
</main>
|
|
{{ end }}
|