Add a 'draft link' shortcode

Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
Danila Fedorin 2024-07-06 17:25:02 -07:00
parent f931e6eceb
commit 8c3d93bc2d
2 changed files with 10 additions and 0 deletions

View File

@ -160,6 +160,10 @@ a {
}
}
.draft-link {
border-bottom: .2rem solid $border-color;
}
img {
max-width: 100%;
background-color: white;

View File

@ -0,0 +1,6 @@
{{- $page := site.GetPage (.Get 1) -}}
{{- if $page -}}
<a href="{{ $page.RelPermalink }}">{{ .Get 0 }}</a>
{{- else -}}
<span class="draft-link">{{ .Get 0 }} (coming soon)</span>
{{- end -}}