-
-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3e78ce4
commit e5d9b6b
Showing
2 changed files
with
66 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,54 @@ | ||
{{ define "main" }} | ||
<main> | ||
<article> | ||
<div class="title"> | ||
<h1 class="title">{{ .Title }}</h1> | ||
<div class="meta">Posted on {{ dateFormat ":date_medium" .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 }} | ||
<article> | ||
<div class="post-container"> | ||
<!-- Main Content --> | ||
<div class="post-content"> | ||
<div class="title"> | ||
<h1 class="title">{{ .Title }}</h1> | ||
<div class="meta">Posted on {{ dateFormat ":date_medium" .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> | ||
</div> | ||
|
||
{{ if isset .Params "toc" }} | ||
<div class="toc"> | ||
<strong>Table of contents:</strong> | ||
{{ .TableOfContents }} | ||
</div>{{ end }} | ||
<!-- TOC --> | ||
{{ if isset .Params "toc" }} | ||
<div class="toc"> | ||
<strong>Table of contents:</strong> | ||
{{ .TableOfContents }} | ||
</div> | ||
{{ end }} | ||
</div> | ||
|
||
<section class="body"> | ||
{{ .Content }} | ||
</section> | ||
<!-- Disqus --> | ||
{{- $.Scratch.Set "isDisqus" true -}} | ||
{{ if not .Site.Config.Services.Disqus.Shortname }} | ||
{{- $.Scratch.Set "isDisqus" false -}} | ||
{{ end }} | ||
|
||
<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> | ||
{{- if eq ($.Scratch.Get "isDisqus") true -}} | ||
{{- partial "disqus.html" . -}} | ||
{{- end -}} | ||
</article> | ||
</main> | ||
{{ end }} |