diff options
| author | Reorx <novoreorx@gmail.com> | 2022-09-06 22:38:40 +0800 |
|---|---|---|
| committer | Reorx <novoreorx@gmail.com> | 2022-09-06 22:38:40 +0800 |
| commit | 8bbb2ac5b5281bd2707fb1ea799852f08c9be57b (patch) | |
| tree | 3fd56b2d20d2cde31af0bc3bf94c59268c52ea84 /layouts/blogroll/section.html | |
| parent | 8d679ad58d6930eb9dfe2be5c03086af0a0dd992 (diff) | |
add blogroll type of section page
Diffstat (limited to 'layouts/blogroll/section.html')
| -rw-r--r-- | layouts/blogroll/section.html | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/layouts/blogroll/section.html b/layouts/blogroll/section.html new file mode 100644 index 0000000..690910a --- /dev/null +++ b/layouts/blogroll/section.html @@ -0,0 +1,75 @@ +{{- define "head" }} +<style> +.links-container { + font-size: 16px; +} +.links-container blockquote { + margin: var(--gap) 0; + padding: 0 14px; + border-inline-start: 3px solid var(--primary); +} +.links .item { + padding: 12px; + background: var(--entry); + border-radius: var(--radius); + margin-bottom: var(--gap); + border: 1px solid var(--border); +} + +.links .favicon { + display: inline-block; + background-size: 16px 16px; + width: 16px; + height: 16px; + image-rendering: -webkit-optimize-contrast; +} +.links .item .title .favicon { + margin-right: calc(var(--gap) / 2); + vertical-align: middle; +} + +.links .item .title a:hover { + text-decoration: underline; +} + +.links .item .description { + margin-left: calc(16px + var(--gap) / 2); + color: var(--secondary); +} + +.links .item .description .delimiter::after { + content: "ยท"; + margin-inline-start: .5em; + margin-inline-end: .5em; +} +</style> +{{- end }} + +{{- define "main" }} +<header class="page-header"> + <h1>{{ .Title }}</h1> +</header> + +<article class="links-container"> + <blockquote> + <p>{{ .Description }}</p> + </blockquote> + + <div class="links"> + {{ range site.Params.Links }} + <div class="item"> + <div class="title"> + {{- $url := urls.Parse .url }} + <span class="favicon" style="background-image: url({{ .favicon | default (printf "%s/favicon.ico" .url ) }});"></span + ><a href="{{ .url }}" target="_blank">{{ .name }}</a> + </div> + <div class="description"> + {{- .domain | default $url.Host }} + {{- with .description }}<span class="delimiter"></span>{{ . }}{{- end }} + </div> + </div> + {{ end }} + </div> +</article> + +{{- end }} |
