mirror of
https://github.com/jbowdre/runtimeterror.git
synced 2024-11-29 09:52:19 +00:00
move dates/tags from sidebar to post frontmatter
This commit is contained in:
parent
85a5a68f46
commit
c100a122df
3 changed files with 55 additions and 27 deletions
|
@ -1,7 +1,24 @@
|
|||
{{ define "main" }}
|
||||
{{- $ageDays := div (sub now.Unix .Date.Unix) 86400 -}}
|
||||
<header class="content__header">
|
||||
<h1>{{ .Title | markdownify }}</h1>
|
||||
<div class="frontmatter">
|
||||
<hr>
|
||||
<table class="frontmatter">
|
||||
<tr><td class="label">title:</td><td class="title">{{ .Title | markdownify }}</td></tr>
|
||||
{{- if .Params.date }}
|
||||
{{- $postDate := .Date.Format "2006-01-02" }}
|
||||
{{- $updateDate := .Lastmod.Format "2006-01-02" }}
|
||||
<tr><td class="label">posted:</td><td class="content">{{ $postDate }}</td></tr>
|
||||
{{- if ne $postDate $updateDate }}
|
||||
<tr><td class="label">updated:</td><td class="content">{{ $updateDate }}</td></tr>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{- with .Params.tags }}{{- $tagCount := len . }}
|
||||
<tr class="frontmatter_tags"><td>tags:</td><td>{{- if gt $tagCount 5 }}<details><summary>See all {{ $tagCount }} tags...</summary>{{- end }}["<a href="/tags">all</a>" {{- range . }}{{- $tag := urlize . }}{{ if $tag }}, {{ end }}"<a href='{{ absLangURL (printf "tags/%s" $tag) }}'>{{ . }}</a>"{{- end }}]{{- if gt $tagCount 5 }}</details>{{- end }}</td></tr>
|
||||
{{- end }}
|
||||
</table>
|
||||
<hr>
|
||||
</div>
|
||||
</header>
|
||||
{{- with .Param "lastmod" -}}
|
||||
{{- $ageDays = div (sub now.Unix .Unix) 86400 -}}
|
||||
|
|
|
@ -1,11 +1,4 @@
|
|||
{{- $postDate := .Date.Format "2006-01-02" }}
|
||||
{{- $updateDate := .Lastmod.Format "2006-01-02" }}
|
||||
{{ if or (.Params.description) (.Params.date) }}
|
||||
{{ if .Params.description }}<p>{{ .Params.description }}</p>{{ end }}
|
||||
<p>
|
||||
{{ if .Params.date }}<table><tr><td>posted:</td><td>{{ $postDate }}</td></tr>{{- if ne $postDate $updateDate }}<tr><td>updated:</td><td>{{ $updateDate }}</td></tr>{{ end }}</table>{{ end }}
|
||||
</p>
|
||||
<hr>
|
||||
{{ if .Params.description }}<p>{{ .Params.description }}</p><hr>{{ end }}
|
||||
{{ if and (gt .WordCount 400 ) (gt (len .TableOfContents) 180) }}
|
||||
<p>
|
||||
<h3>On this page</h3>
|
||||
|
@ -13,19 +6,6 @@
|
|||
<hr>
|
||||
</p>
|
||||
{{ end }}
|
||||
{{- with .Params.tags -}}
|
||||
<p>
|
||||
<h3>Tags</h3>
|
||||
[<a href="/tags">all</a>]
|
||||
{{- range . }}
|
||||
{{- $tag := urlize . -}}
|
||||
[<a href='{{ absLangURL (printf "tags/%s" $tag) }}' title="{{ . }}">{{ . }}</a>]
|
||||
{{- end }}
|
||||
<br><br>
|
||||
<hr>
|
||||
</p>
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if isset .Params "categories" }}
|
||||
{{$related := where .Site.RegularPages ".Params.categories" "eq" .Params.categories }}
|
||||
|
|
|
@ -303,3 +303,34 @@ button.tinylytics_kudos:hover {
|
|||
transform: scale(1.1);
|
||||
text-shadow: var(--off-fg) 0 0 1px;
|
||||
}
|
||||
|
||||
/* post front matter styling*/
|
||||
.frontmatter hr {
|
||||
margin-bottom: 0rem;
|
||||
margin-top: 0rem;
|
||||
}
|
||||
|
||||
.frontmatter h1 {
|
||||
margin-top: 0rem;
|
||||
}
|
||||
|
||||
.frontmatter .label {
|
||||
color: var(--off-fg);
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.frontmatter .title {
|
||||
color: var(--fg);
|
||||
font-weight: 600;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
.frontmatter table {
|
||||
overflow-wrap: break-word;
|
||||
margin-bottom: 0rem;
|
||||
}
|
||||
|
||||
.frontmatter_tags {
|
||||
font-size: 0.8rem;
|
||||
color: var(--off-fg);
|
||||
}
|
Loading…
Reference in a new issue