mirror of
https://github.com/thegeeklab/hugo-geekblog.git
synced 2024-11-29 00:00:36 +00:00
add simple stickey posts
This commit is contained in:
parent
4f877c9f69
commit
fd77cf1020
12
exampleSite/content/posts/sticky.md
Normal file
12
exampleSite/content/posts/sticky.md
Normal 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.
|
@ -30,6 +30,13 @@
|
|||||||
</span>
|
</span>
|
||||||
</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 }}
|
{{ $ac := 0 }}
|
||||||
{{ with .Params.authors }}
|
{{ with .Params.authors }}
|
||||||
{{ range sort . }}
|
{{ range sort . }}
|
||||||
|
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 |
Before Width: | Height: | Size: 319 B After Width: | Height: | Size: 319 B |
5
src/icons/pin.svg
Normal file
5
src/icons/pin.svg
Normal 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 |
Loading…
Reference in New Issue
Block a user