mirror of
https://github.com/Brandon-Rozek/website-theme.git
synced 2025-10-09 10:11:14 +00:00
Refactored template code
This commit is contained in:
parent
b28e531f9f
commit
c3e09727a6
20 changed files with 332 additions and 395 deletions
|
@ -1,10 +1,12 @@
|
|||
{{ define "main"}}
|
||||
{{ define "main" }}
|
||||
{{ partial "header.html" . }}
|
||||
<!-- content -->
|
||||
<main>
|
||||
<div id="contentBody">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
<main class="h-entry">
|
||||
{{ .Scratch.Set "beforeDateString" "Published on "}}
|
||||
{{ partial "date.html" . }}
|
||||
<div class="e-content">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
</main>
|
||||
{{ partial "footer.html" . }}
|
||||
{{ end }}
|
|
@ -3,7 +3,8 @@
|
|||
"ref": "{{ $page.Permalink }}",
|
||||
"title": {{ $page.Title | jsonify }},
|
||||
"section": "{{ $page.Section }}",
|
||||
"tags": {{ $page.Params.tags | jsonify }},
|
||||
"date" : {{ $page.Date.Format "2006.01.02" | jsonify }},
|
||||
"body": {{ $page.Plain | jsonify }}
|
||||
}
|
||||
{{ end }}]
|
||||
{{ end }}]
|
|
@ -1,24 +1,10 @@
|
|||
{{ define "main"}}
|
||||
{{ partial "header.html" . }}
|
||||
<main>
|
||||
{{ if not .Date.IsZero }}
|
||||
<!-- date -->
|
||||
{{ $singlePageDateFormat := .Site.Params.singlePageDateFormat | default "January 2, 2006"}}
|
||||
<p class="date">{{ .Date.Format $singlePageDateFormat }}</p>
|
||||
{{ end }}
|
||||
<!-- tags -->
|
||||
<div id="tags">
|
||||
<ul>
|
||||
{{ range .Param "tags" }}
|
||||
{{ $name := . }}
|
||||
{{ with $.Site.GetPage (printf "/tags/%s" ($name | urlize)) }}
|
||||
<li><a href="{{ .Permalink }}">{{ $name }}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
{{ partial "date.html" . }}
|
||||
{{ partial "tags_list_page.html" . }}
|
||||
<!-- content -->
|
||||
<div id="contentBody">
|
||||
<div class="e-content">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
</main>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue