refactoring page layouts
This commit is contained in:
parent
cf95cacd15
commit
88d2987fc2
20 changed files with 346 additions and 235 deletions
|
@ -1,63 +1,11 @@
|
|||
{{ define "main" -}}
|
||||
<div class="post">
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ if ne .Params.showpagemeta false }}
|
||||
<div class="col-sm-12 col-md-12">
|
||||
<span class="text-left post-date meta">
|
||||
{{ if ne .Params.showpdate false }}
|
||||
<!-- published date -->
|
||||
{{ if not .Date.IsZero }} {{ .Date.Format .Site.Params.dateformat }} {{end}}
|
||||
{{ end }}
|
||||
<!-- categories -->
|
||||
{{ if isset .Params "categories" }}
|
||||
{{ $total := len .Params.categories }}
|
||||
{{ if gt $total 0 }}
|
||||
in
|
||||
{{ $total := sub $total 1 }}
|
||||
{{ range $i, $cat := sort $.Params.categories }}
|
||||
<a class="meta" href="{{ "/categories/" | relURL }}{{ $cat | urlize }}">{{ $cat | upper }}</a>{{ if lt $i $total }}, {{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<!-- tags -->
|
||||
{{ if isset .Params "tags" }}
|
||||
{{ $total := len .Params.tags }}
|
||||
{{ if gt $total 0 }}
|
||||
●
|
||||
{{ $subtotal := sub $total 1 }}
|
||||
{{ range $i, $tag := sort $.Params.tags }}
|
||||
<a class="meta" href="{{ "/tags/" | relURL }}{{ $tag | urlize }}">#{{ $tag | upper }}</a>{{ if lt $i $subtotal }} {{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</span>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ .Content }}
|
||||
</div>
|
||||
{{- end }}
|
||||
{{ define "header" -}}
|
||||
{{ partial "header.html" . }}
|
||||
{{- end -}}
|
||||
|
||||
{{ define "content" -}}
|
||||
{{ partial "post_content.html" . }}
|
||||
{{- end -}}
|
||||
|
||||
{{ define "footer" -}}
|
||||
{{ if .Site.Params.highlightjs }}
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
|
||||
{{ range .Site.Params.highlightjslanguages }}
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/{{.}}.min.js"></script>
|
||||
{{ end }}
|
||||
<script type="text/javascript">
|
||||
hljs.initHighlightingOnLoad();
|
||||
</script>
|
||||
{{ end }}
|
||||
<!-- Google Analytics -->
|
||||
{{ if .Site.GoogleAnalytics }}
|
||||
{{ template "_internal/google_analytics_async.html" . }}
|
||||
{{ end }}
|
||||
<!-- Disqus-->
|
||||
{{ if .Site.DisqusShortname }}
|
||||
{{ if ne .Params.showcomments false }}
|
||||
<h2>Comments</h2>
|
||||
{{ partial "disqus.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<!-- Other Scripts -->
|
||||
<script src="{{ .Site.BaseURL }}js/main.js"></script>
|
||||
{{- end }}
|
||||
{{ partial "post_footer.html" . }}
|
||||
{{- end -}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue