moving list and single templates to _default

This commit is contained in:
kentnek 2020-06-20 03:19:28 +08:00
parent 53ceca769e
commit 37ce67b758
4 changed files with 48 additions and 62 deletions

View File

@ -0,0 +1,27 @@
{{ define "stylesheets" }}
<link rel="stylesheet" href="/css/posts.css" />
{{ end }}
{{ define "main" }}
<div class="post-list__container">
<ul class="post-list">
{{ range .Pages }}
<li class="post">
<div class="post__header">
<time class="post__date" datetime="{{ .Date }}"
>{{ .Date.Format "Jan 2 2006" }}</time
>
<h2 class="post__title">
<a href="{{.RelPermalink}}">{{ .Title }}</a>
</h2>
{{ partial "tags.html" .}}
</div>
</li>
{{ end }}
</ul>
{{ partial "browse-by-tag.html" .}}
</div>
{{ end }}

View File

@ -4,11 +4,26 @@
{{ define "main" }}
<div class="single__container">
{{ .Content }}
<div class="post">
<header class="post__header">
<h1 class="post__title">{{.Title}}</h1>
<time datetime="{{ .Date }}" class="post__date"
>{{ .Date.Format "Jan 2 2006" }}</time
>
</header>
<article class="post__content">
{{ partial "anchored-headings.html" .Content }}
{{ if or .Params.math .Site.Params.math }}
{{ partial "math.html" . }}
{{ end }}
</article>
{{ partial "tags.html" .}} {{ partial "post-pagination.html" .}}
</div>
{{ partial "social-icons.html" .}}
{{ end }} {{ define "footer" }}
<footer>
{{ partial "social-icons.html" .}}
<p>{{ replace .Site.Copyright "{year}" now.Year }}</p>
</footer>
{{ end }} {{ define "scripts" }}
<script src="https://unpkg.com/prismjs@^1.2"></script>
{{ end }}

View File

@ -1,27 +0,0 @@
{{ define "stylesheets" }}
<link rel="stylesheet" href="/css/posts.css" />
{{ end }}
{{ define "main" }}
<div class="post-list__container">
<ul class="post-list">
{{ range .Pages }}
<li class="post">
<div class="post__header">
<time class="post__date" datetime="{{ .Date }}"
>{{ .Date.Format "Jan 2 2006" }}</time
>
<h2 class="post__title">
<a href="{{.RelPermalink}}">{{ .Title }}</a>
</h2>
{{ partial "tags.html" .}}
</div>
</li>
{{ end }}
</ul>
{{ partial "browse-by-tag.html" .}}
</div>
{{ end }}

View File

@ -1,29 +0,0 @@
{{ define "stylesheets" }}
<link rel="stylesheet" href="/css/post.css" />
{{ end }}
{{ define "main" }}
<div class="post">
<header class="post__header">
<h1 class="post__title">{{.Title}}</h1>
<time datetime="{{ .Date }}" class="post__date"
>{{ .Date.Format "Jan 2 2006" }}</time
>
</header>
<article class="post__content">
{{ partial "anchored-headings.html" .Content }}
{{ if or .Params.math .Site.Params.math }}
{{ partial "math.html" . }}
{{ end }}
</article>
{{ partial "tags.html" .}} {{ partial "post-pagination.html" .}}
</div>
{{ end }} {{ define "footer" }}
<footer>
{{ partial "social-icons.html" .}}
<p>{{ replace .Site.Copyright "{year}" now.Year }}</p>
</footer>
{{ end }} {{ define "scripts" }}
<script src="https://unpkg.com/prismjs@^1.2"></script>
{{ end }}