Add a feature to auto-detect newer iterations of a post.
This commit is contained in:
parent
0277890db3
commit
919a0cf7ed
|
@ -1,6 +1,7 @@
|
|||
---
|
||||
title: "Choosing a Starter Ship in Star Citizen"
|
||||
date: 2023-11-27
|
||||
versioned: star-citizen-starter-guide
|
||||
tags:
|
||||
- video games
|
||||
- game guide
|
||||
|
|
|
@ -1,8 +1,18 @@
|
|||
{{ partial "menu.html" . }}
|
||||
{{ with ($.Param "deprecated") }}
|
||||
{{ if ($.Param "deprecated") }}
|
||||
<p class="l-deprecation_warning">
|
||||
This post was saved / ported from a previous site migration. You may
|
||||
encounter missing images, dead links, and strange formatting. Sorry
|
||||
about that!
|
||||
</p>
|
||||
{{ end }}
|
||||
|
||||
{{ if .Param "versioned" }}
|
||||
{{ range (where (where .Site.RegularPages "Type" "posts") "Params.versioned" (.Param "versioned")).Limit 1 }}
|
||||
{{ if not (eq .Slug $.Slug) }}
|
||||
<p class="l-new_version_message">
|
||||
There is a newer version of this post available, published on {{.Date | time.Format .Site.Params.dateFormat}}. <a href="{{.RelPermalink}}">Click here</a> to read the latest version.
|
||||
</p>
|
||||
{{ end }}
|
||||
{{end }}
|
||||
{{ end }}
|
||||
|
|
|
@ -29,7 +29,15 @@ figcaption {
|
|||
}
|
||||
|
||||
.l-deprecation_warning {
|
||||
background-color: #dd4444;
|
||||
background-color: #ff6666;
|
||||
text-align: center;
|
||||
width: 96%;
|
||||
max-width: 720px;
|
||||
margin: 20px auto 10px;
|
||||
}
|
||||
|
||||
.l-new_version_message {
|
||||
background-color: #dddd66;
|
||||
text-align: center;
|
||||
width: 96%;
|
||||
max-width: 720px;
|
||||
|
|
Loading…
Reference in New Issue
Block a user