add simple stickey posts

This commit is contained in:
Robert Kaussow 2020-07-13 09:00:19 +02:00
parent 4f877c9f69
commit fd77cf1020
No known key found for this signature in database
GPG Key ID: 65362AE74AF98B61
5 changed files with 30 additions and 6 deletions

View File

@ -0,0 +1,12 @@
---
title: "Simple sticky posts"
weight: 1
date: 2020-07-13T00:06:00+02:00
authors:
- john-doe
tags:
- Open Source
- DevOps
---
Stickey (or pinned) posts implementation is currently really simple and handled by `weight: 1` in a post front matter.

View File

@ -22,13 +22,20 @@
<footer class="gblog-post__footer">
<span class="no-wrap">
<svg class="icon menu"><use xlink:href="#date"></use></svg>
<span class="gblog-post__tag">
<time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}">
{{ .Date.Day }} {{ .Date.Month }} {{ .Date.Year }}
</time>
<svg class="icon menu"><use xlink:href="#date"></use></svg>
<span class="gblog-post__tag">
<time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}">
{{ .Date.Day }} {{ .Date.Month }} {{ .Date.Year }}
</time>
</span>
</span>
{{ if .Params.weight }}
<span class="no-wrap">
<svg class="icon pin"><use xlink:href="#pin"></use></svg>
<span class="gblog-post__tag">Pinned</span>
</span>
{{ end }}
{{ $ac := 0 }}
{{ with .Params.authors }}

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

View File

Before

Width:  |  Height:  |  Size: 319 B

After

Width:  |  Height:  |  Size: 319 B

5
src/icons/pin.svg Normal file
View File

@ -0,0 +1,5 @@
<!-- Generated by IcoMoon.io -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
<title>pin</title>
<path d="M17.6 19.2h9.6v-1.6l-4.8-1.6v-12.8l4.8-1.6v-1.6h-22.4v1.6l4.8 1.6v12.8l-4.8 1.6v1.6h9.6v11.2l1.6 1.6 1.6-1.6v-11.2z"></path>
</svg>

After

Width:  |  Height:  |  Size: 291 B