refactoring page layouts
This commit is contained in:
parent
cf95cacd15
commit
88d2987fc2
20 changed files with 346 additions and 235 deletions
|
@ -1,11 +1,19 @@
|
|||
{{ partial "head.html" . }}
|
||||
<body class="{{ .Site.Params.themeColor }} {{if .Site.Params.layoutReverse}}layout-reverse{{end}}">
|
||||
{{ partial "sidebar.html" . }}
|
||||
<div class="content container">
|
||||
{{ block "main" . }}{{ end }}
|
||||
<div class="footer">
|
||||
{{ block "footer" . }}{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ .Site.LanguageCode }}" class="wf-firasans-n4-active wf-active">
|
||||
<head>
|
||||
{{ block "header" . }}{{ end }}
|
||||
</head>
|
||||
<body class="{{ .Site.Params.themeColor }} {{if .Site.Params.layoutReverse}}layout-reverse{{end}}">
|
||||
{{ partial "sidebar.html" . }}
|
||||
<div class="content container">
|
||||
{{ block "content" . }}{{ end }}
|
||||
<div class="footer">
|
||||
{{ block "footer" . }}{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
<!-- Google Analytics -->
|
||||
{{ if .Site.GoogleAnalytics -}}
|
||||
{{ template "_internal/google_analytics_async.html" . }}
|
||||
{{- end }}
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,18 +1,10 @@
|
|||
{{ define "main" }}
|
||||
<h1 class="title">{{ .Title }}</h1>
|
||||
<ul class="posts">
|
||||
{{ range .Data.Pages -}}
|
||||
<li>
|
||||
<span><a href="{{ .Permalink }}">{{ .Title }}</a> <time class="pull-right post-list">{{ .Date.Format "Jan 2, 2006" }}</time></span>
|
||||
</li>
|
||||
{{- end }}
|
||||
</ul>
|
||||
{{- end }}
|
||||
{{ define "header" -}}
|
||||
{{ partial "header.html" . }}
|
||||
{{- end -}}
|
||||
|
||||
{{ define "footer" }}
|
||||
<!-- Footer -->
|
||||
{{ if .Site.GoogleAnalytics -}}
|
||||
{{ template "_internal/google_analytics_async.html" . }}
|
||||
{{- end}}
|
||||
<script src="{{ .Site.BaseURL }}js/main.js"></script>
|
||||
{{- end }}
|
||||
{{ define "content" -}}
|
||||
{{ partial "list_content.html" . }}
|
||||
{{- end -}}
|
||||
|
||||
{{ define "footer" -}}
|
||||
{{- end }}
|
||||
|
|
|
@ -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 -}}
|
||||
|
|
0
layouts/_default/summary.html
Normal file
0
layouts/_default/summary.html
Normal file
Loading…
Add table
Add a link
Reference in a new issue