Add support for the last_update front-matter field. (#2690)

This commit is contained in:
Martin Taillefer 2018-09-25 15:24:14 -07:00 committed by GitHub
parent 3acfe3fe40
commit 7d150577ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 18 additions and 1 deletions

View File

@ -109,7 +109,8 @@ There are a few more front matter fields available specifically for blog posts:
|Field | Description
|---------------|------------
|`publishdate` | Date of the post's publication
|`publishdate` | Date of the post's original publication
|`last_update` | Date when the post last received a major revision
|`attribution` | Optional name of the post's author
|`twitter` | Optional Twitter of the post's author

View File

@ -2,6 +2,7 @@
title: Canary Deployments using Istio
description: Using Istio to create autoscaled canary deployments.
publishdate: 2017-06-14
last_update: 2018-05-16
attribution: Frank Budinsky
weight: 98
keywords: [traffic-management,canary]

View File

@ -2,6 +2,7 @@
title: Consuming External Web Services
description: Describes a simple scenario based on Istio's Bookinfo example.
publishdate: 2018-01-31
last_update: 2018-08-09
subtitle: Mesh-external service entries for egress HTTPS traffic
attribution: Vadim Eisenberg
weight: 93

View File

@ -2,6 +2,7 @@
title: Consuming External TCP Services
description: Describes a simple scenario based on Istio's Bookinfo example.
publishdate: 2018-02-06
last_update: 2018-07-23
subtitle: Mesh-external Service Entries for TCP traffic
attribution: Vadim Eisenberg
weight: 92

View File

@ -85,6 +85,9 @@ other = "Privacy Policy"
[page_publish_date_format]
other = "January 2, 2006"
[page_last_update_format]
other = "(updated on %s)"
[page_word_count]
other = "%d words"

View File

@ -85,6 +85,9 @@ other = "Privacy Policy"
[page_publish_date_format]
other = "January 2, 2006"
[page_last_update_format]
other = "(updated on %s)"
[page_word_count]
other = "%d words"

View File

@ -65,6 +65,13 @@
{{- partial "icon.html" "calendar" -}}
<span>&nbsp;</span>
{{- .PublishDate.Format (i18n "page_publish_date_format") -}}
{{- if .Params.last_update -}}
<span>&nbsp;</span>
{{- $date := time .Params.last_update -}}
{{- $date := $date.Format (i18n "page_publish_date_format") -}}
{{- printf (i18n "page_last_update_format") $date -}}
{{- end -}}
</span>
{{- end -}}