mirror of
https://github.com/thegeeklab/hugo-geekblog.git
synced 2024-11-25 06:20:40 +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.
|
@ -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 |
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