Move the rest of the _default templates from the theme
This commit is contained in:
parent
512c8ec2da
commit
8c4dd830b9
3 changed files with 123 additions and 0 deletions
49
layouts/_default/single.html
Normal file
49
layouts/_default/single.html
Normal file
|
@ -0,0 +1,49 @@
|
|||
{{ define "main" }}
|
||||
|
||||
<article class="post-single">
|
||||
<header class="post-title">
|
||||
<p>
|
||||
<time>{{ .Date | time.Format ":date_medium" }}</time>
|
||||
{{ if or .Params.Author site.Author.name }}
|
||||
<span>{{ .Params.Author | default site.Author.name }}</span>
|
||||
{{ end }}
|
||||
</p>
|
||||
<h1>{{ .Title }}</h1>
|
||||
</header>
|
||||
<section class="post-content">{{ .Content }}</section>
|
||||
|
||||
<!-- Post Tags -->
|
||||
{{ if .Params.tags }}
|
||||
<footer class="post-tags">
|
||||
{{ range .Params.tags }} {{ $href := print (absURL "tags/") (urlize .) }}
|
||||
<a href="{{ $href }}">{{ . }}</a>
|
||||
{{ end }}
|
||||
</footer>
|
||||
{{ end }}
|
||||
|
||||
<!-- Post Nav -->
|
||||
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}<!---->
|
||||
{{ if and (gt (len $pages) 1) (in $pages . ) }}
|
||||
<nav class="post-nav">
|
||||
{{ with $pages.Next . }}
|
||||
<a class="prev" href="{{ .Permalink }}"><span>←</span><span>{{ .Name }}</span></a>
|
||||
{{ end }} {{ with $pages.Prev . }}
|
||||
<a class="next" href="{{ .Permalink }}"><span>{{ .Name }}</span><span>→</span></a>
|
||||
{{ end }}
|
||||
</nav>
|
||||
{{ end }}
|
||||
|
||||
<!-- Disqus -->
|
||||
{{ if and site.DisqusShortname (not (eq .Params.comments false)) }}
|
||||
<div id="disqus_thread" class="post-comments"></div>
|
||||
<script>
|
||||
var disqusShortname = '{{ site.DisqusShortname }}';
|
||||
var script = document.createElement('script');
|
||||
script.src = 'https://' + disqusShortname + '.disqus.com/embed.js';
|
||||
script.setAttribute('data-timestamp', +new Date());
|
||||
document.head.appendChild(script);
|
||||
</script>
|
||||
{{ end }}
|
||||
</article>
|
||||
|
||||
{{ end }}
|
Loading…
Add table
Add a link
Reference in a new issue