Move footer tags list to a partial so photos and blogs can use the same template
Simplify the blog post layout by removing the <article> tag
This commit is contained in:
parent
c5427866c6
commit
ecb39a9298
5 changed files with 100 additions and 94 deletions
|
@ -1,24 +1,13 @@
|
||||||
:root {
|
:root {
|
||||||
--post-item-highlight-color: #efefef;
|
--post-item-highlight-color: #efefef;
|
||||||
|
|
||||||
--tag-foreground-color: rgb(var(--super-dk-gray));
|
|
||||||
--tag-background-color: rgb(var(--super-lt-gray));
|
|
||||||
--tag-spacer-foreground-color: rgb(var(--super-dk-gray));
|
|
||||||
--tag-hover-background-color: rgb(var(--sub-lt-gray));
|
|
||||||
}
|
}
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
:root {
|
:root {
|
||||||
--post-item-highlight-color: #121212;
|
--post-item-highlight-color: #121212;
|
||||||
|
|
||||||
--tag-foreground-color: rgb(var(--sub-lt-gray));
|
|
||||||
--tag-background-color: rgb(var(--dk-gray));
|
|
||||||
--tag-spacer-foreground-color: rgb(var(--super-dk-gray));
|
|
||||||
--tag-hover-background-color: rgb(var(--super-dk-gray));
|
|
||||||
--tag-hover-foreground-color: rgb(var(--mid-gray));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-content > .highlight { margin-block-end: var(--body-item-spacing); }
|
.blog > .highlight { margin-block-end: var(--body-item-spacing); }
|
||||||
|
|
||||||
.post-nav {
|
.post-nav {
|
||||||
align-items: baseline;
|
align-items: baseline;
|
||||||
|
@ -91,55 +80,3 @@
|
||||||
.blog.list > ul > li > :first-child {
|
.blog.list > ul > li > :first-child {
|
||||||
text-align: end;
|
text-align: end;
|
||||||
}
|
}
|
||||||
|
|
||||||
.blog .tags {
|
|
||||||
display: flex;
|
|
||||||
padding-inline-start: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.blog .tags li {
|
|
||||||
background-color: var(--tag-background-color);
|
|
||||||
color: var(--tag-foreground-color);
|
|
||||||
border-radius: 4px;
|
|
||||||
display: inline-block;
|
|
||||||
font-size: 75%;
|
|
||||||
letter-spacing: 1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.blog .tags li:hover {
|
|
||||||
background-color: var(--tag-hover-background-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.blog .tags li a {
|
|
||||||
color: inherit;
|
|
||||||
display: block;
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
padding: 0.6rem 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.blog .tags li a:hover {
|
|
||||||
color: var(--tag-hover-foreground-color);
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.blog .tags li + li { margin-inline-start: 1rem; }
|
|
||||||
.blog .tags li.chevron + li { margin-inline-start: 0 }
|
|
||||||
|
|
||||||
.blog .tags .chevron {
|
|
||||||
align-items: center;
|
|
||||||
border: 0;
|
|
||||||
border-radius: 0;
|
|
||||||
color: var(--tag-spacer-foreground-color);
|
|
||||||
background-color: inherit;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
margin-inline-start: 0;
|
|
||||||
padding-inline-start: 1px;
|
|
||||||
width: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.blog .tags .chevron:hover {
|
|
||||||
color: var(--tag-background-color);
|
|
||||||
background-color: inherit;
|
|
||||||
}
|
|
||||||
|
|
24
layouts/partials/footer_tags.html
Normal file
24
layouts/partials/footer_tags.html
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{{- if or .Params.categories .Params.tags -}}
|
||||||
|
<ul class="tags">
|
||||||
|
{{- if .Params.categories -}}
|
||||||
|
{{- $categories := .GetTerms "categories" -}}
|
||||||
|
{{- if gt (len $categories) 1 -}}
|
||||||
|
{{- errorf "More than one category for %q" .Path -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- with index (.GetTerms "categories") 0 -}}
|
||||||
|
<li class="category"><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if and .Params.categories .Params.tags -}}
|
||||||
|
<li class="chevron noselect">⏵</li>
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if .Params.tags -}}
|
||||||
|
{{- range .GetTerms "tags" -}}
|
||||||
|
<li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
</ul>
|
||||||
|
{{- end -}}
|
|
@ -1,4 +1,3 @@
|
||||||
<article class="post-single">
|
|
||||||
<header>
|
<header>
|
||||||
{{ partial "development/draft_tag.html" . }}
|
{{ partial "development/draft_tag.html" . }}
|
||||||
<div class="post-title">
|
<div class="post-title">
|
||||||
|
@ -13,31 +12,11 @@
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
{{- if or .Params.categories .Params.tags -}}
|
{{ partial "footer_tags.html" . }}
|
||||||
<ul class="tags">
|
|
||||||
{{- if .Params.categories -}}
|
|
||||||
{{- $categories := .GetTerms "categories" -}}
|
|
||||||
{{- if gt (len $categories) 1 -}}
|
|
||||||
{{- errorf "More than one category for %q" .Path -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- with index (.GetTerms "categories") 0 -}}
|
|
||||||
<li class="category"><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- if and .Params.categories .Params.tags -}}
|
|
||||||
<li class="chevron noselect">⏵</li>
|
|
||||||
{{- end -}}
|
|
||||||
{{- if .Params.tags -}}
|
|
||||||
{{- range .GetTerms "tags" -}}
|
|
||||||
<li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
</ul>
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
|
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
|
||||||
{{ if and (gt (len $pages) 1) (in $pages . ) }}
|
{{- if and (gt (len $pages) 1) (in $pages . ) -}}
|
||||||
<nav class="post-nav">
|
<nav class="post-nav">
|
||||||
{{ with $pages.Prev . }}
|
{{ with $pages.Prev . }}
|
||||||
<a class="prev" href="{{ .Permalink }}"><span>←</span><span>{{ .Name }}</span></a>
|
<a class="prev" href="{{ .Permalink }}"><span>←</span><span>{{ .Name }}</span></a>
|
||||||
|
@ -46,6 +25,5 @@
|
||||||
<a class="next" href="{{ .Permalink }}"><span>{{ .Name }}</span><span>→</span></a>
|
<a class="next" href="{{ .Permalink }}"><span>{{ .Name }}</span><span>→</span></a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</nav>
|
</nav>
|
||||||
{{ end }}
|
{{- end -}}
|
||||||
</footer>
|
</footer>
|
||||||
</article>
|
|
||||||
|
|
|
@ -40,6 +40,10 @@
|
||||||
</ul>
|
</ul>
|
||||||
</figure>
|
</figure>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
<footer>
|
||||||
|
{{ partial "footer_tags.html" . }}
|
||||||
|
</footer>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ define "footer" }}
|
{{ define "footer" }}
|
||||||
|
|
|
@ -50,6 +50,11 @@
|
||||||
|
|
||||||
--content-width: 80rem;
|
--content-width: 80rem;
|
||||||
|
|
||||||
|
--tag-foreground-color: rgb(var(--super-dk-gray));
|
||||||
|
--tag-background-color: rgb(var(--super-lt-gray));
|
||||||
|
--tag-spacer-foreground-color: rgb(var(--super-dk-gray));
|
||||||
|
--tag-hover-background-color: rgb(var(--sub-lt-gray));
|
||||||
|
|
||||||
--transition-duration: 0.7s;
|
--transition-duration: 0.7s;
|
||||||
|
|
||||||
--social-menu-padding: 1rem;
|
--social-menu-padding: 1rem;
|
||||||
|
@ -73,6 +78,12 @@
|
||||||
--platter-background-color: rgba(var(--black), var(--platter-background-opacity));
|
--platter-background-color: rgba(var(--black), var(--platter-background-opacity));
|
||||||
--platter-backdrop-filter: brightness(0.66) blur(10px);
|
--platter-backdrop-filter: brightness(0.66) blur(10px);
|
||||||
|
|
||||||
|
--tag-foreground-color: rgb(var(--sub-lt-gray));
|
||||||
|
--tag-background-color: rgb(var(--dk-gray));
|
||||||
|
--tag-spacer-foreground-color: rgb(var(--super-dk-gray));
|
||||||
|
--tag-hover-background-color: rgb(var(--super-dk-gray));
|
||||||
|
--tag-hover-foreground-color: rgb(var(--mid-gray));
|
||||||
|
|
||||||
--twitter-icon: url(/icons/twitter-dark.svg);
|
--twitter-icon: url(/icons/twitter-dark.svg);
|
||||||
--github-icon: url(/icons/github-dark.svg);
|
--github-icon: url(/icons/github-dark.svg);
|
||||||
--instagram-icon: url(/icons/instagram-dark.svg);
|
--instagram-icon: url(/icons/instagram-dark.svg);
|
||||||
|
@ -463,6 +474,58 @@ ol ol {
|
||||||
padding: 0 0.5rem;
|
padding: 0 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
footer > .tags {
|
||||||
|
display: flex;
|
||||||
|
padding-inline-start: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer > .tags > li {
|
||||||
|
background-color: var(--tag-background-color);
|
||||||
|
color: var(--tag-foreground-color);
|
||||||
|
border-radius: 4px;
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 75%;
|
||||||
|
letter-spacing: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer > .tags > li:hover {
|
||||||
|
background-color: var(--tag-hover-background-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
footer > .tags > li > a {
|
||||||
|
color: inherit;
|
||||||
|
display: block;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
padding: 0.6rem 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer > .tags > li > a:hover {
|
||||||
|
color: var(--tag-hover-foreground-color);
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer > .tags > li + li { margin-inline-start: 1rem; }
|
||||||
|
footer > .tags > li.chevron + li { margin-inline-start: 0 }
|
||||||
|
|
||||||
|
footer > .tags > .chevron {
|
||||||
|
align-items: center;
|
||||||
|
border: 0;
|
||||||
|
border-radius: 0;
|
||||||
|
color: var(--tag-spacer-foreground-color);
|
||||||
|
background-color: inherit;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin-inline-start: 0;
|
||||||
|
padding-inline-start: 1px;
|
||||||
|
width: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer > .tags > .chevron:hover {
|
||||||
|
color: var(--tag-spacer-foreground-color);
|
||||||
|
background-color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
.youtube iframe {
|
.youtube iframe {
|
||||||
aspect-ratio: 16 / 9;
|
aspect-ratio: 16 / 9;
|
||||||
margin-bottom: -3px;
|
margin-bottom: -3px;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue