diff options
author | Tazeg <jeffgazet@gmail.com> | 2018-08-30 20:30:26 +0300 |
---|---|---|
committer | Tazeg <jeffgazet@gmail.com> | 2018-08-30 20:30:26 +0300 |
commit | 0a88ef0a1f8453288f2497074308de1c9b56d524 (patch) | |
tree | 60760b4d0bcf6672098e0543b606ddc1941ab118 | |
parent | 4222e78581dc0dbb50abb650b5f9fd989c08e7a3 (diff) |
Added widget recent posts
-rw-r--r-- | layouts/_default/single.html | 1 | ||||
-rw-r--r-- | layouts/index.html | 1 | ||||
-rw-r--r-- | layouts/partials/widget-recent.html | 10 | ||||
-rw-r--r-- | layouts/taxonomy/archive.html | 1 | ||||
-rw-r--r-- | layouts/taxonomy/tag.html | 1 |
5 files changed, 14 insertions, 0 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 817ea81..f10ba5f 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -10,6 +10,7 @@ </div> <div class="column is-3"> {{ partial "widget-tags.html" . }}<br> + {{ partial "widget-recent.html" . }}<br> {{ partial "widget-archives.html" . }} </div> </div> diff --git a/layouts/index.html b/layouts/index.html index 31bcfe4..4927701 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -26,6 +26,7 @@ </div> <div class="column is-3"> {{ partial "widget-tags.html" . }}<br> + {{ partial "widget-recent.html" . }}<br> {{ partial "widget-archives.html" . }} </div> </div> diff --git a/layouts/partials/widget-recent.html b/layouts/partials/widget-recent.html new file mode 100644 index 0000000..92428dd --- /dev/null +++ b/layouts/partials/widget-recent.html @@ -0,0 +1,10 @@ +<div class="card"> + <div class="card-content"> + <h1 class="title is-5">Recent posts</h1> + {{ range first 5 (where .Site.RegularPages "Section" "post").ByPublishDate.Reverse }} + <h1><a href="{{ .Permalink | absURL }}">{{ .Title }}</a></h1> + <time class="has-text-grey-light is-size-7">{{ .Date.Day }} {{ .Date.Month }} {{ .Date.Year }}</time> + {{ end }} + </div> +</div> +
\ No newline at end of file diff --git a/layouts/taxonomy/archive.html b/layouts/taxonomy/archive.html index dc3c713..e300c60 100644 --- a/layouts/taxonomy/archive.html +++ b/layouts/taxonomy/archive.html @@ -25,6 +25,7 @@ </div> <div class="column is-3"> {{ partial "widget-tags.html" . }}<br> + {{ partial "widget-recent.html" . }}<br> {{ partial "widget-archives.html" . }} </div> </div> diff --git a/layouts/taxonomy/tag.html b/layouts/taxonomy/tag.html index 0cc2167..71d2957 100644 --- a/layouts/taxonomy/tag.html +++ b/layouts/taxonomy/tag.html @@ -26,6 +26,7 @@ </div> <div class="column is-3"> {{ partial "widget-tags.html" . }}<br> + {{ partial "widget-recent.html" . }}<br> {{ partial "widget-archives.html" . }} </div> </div> |