Tweak single layout

This commit is contained in:
Oskar Thoren 2021-03-29 10:16:37 +08:00
parent 00ae1c695d
commit 0649b9dc35
No known key found for this signature in database
GPG Key ID: B2ECCFD3BC2EF77E
3 changed files with 47 additions and 2 deletions

View File

@ -6,3 +6,5 @@ Specs for Vac. WIP replacement for specs.vac.dev
Ensure you have the Hugo extended edition
(https://gohugo.io/getting-started/installing/), then run `hugo server`.
Heavily inspired by https://rfc.zeromq.org/.

View File

@ -1,6 +1,6 @@
---
domain: rfc.vac.dev
shortname: 1/COSS
slug: 1
title: 1/COSS
name: Consensus-Oriented Specification System
status: draft
editor: Oskar Thoren <ot@oskarthoren.com>

43
layouts/docs/single.html Normal file
View File

@ -0,0 +1,43 @@
{{ define "main" }}
<article class="markdown">
{{ printf "# %s" .Params.title | markdownify }}
{{ if .Params.name }}
{{ printf "# %s" .Params.name | markdownify }}
{{ end }}
{{ if eq .Params.status "raw" }}
<img src="https://img.shields.io/badge/status-{{.Params.status}}-lightgrey?style=flat-square" />
{{ end }}
{{ if eq .Params.status "draft" }}
<img src="https://img.shields.io/badge/status-{{.Params.status}}-blue?style=flat-square" />
{{ end }}
{{ if eq .Params.status "stable" }}
<img src="https://img.shields.io/badge/status-{{.Params.status}}-brightgreen?style=flat-square" />
{{ end }}
{{ if eq .Params.status "deprecated" }}
<img src="https://img.shields.io/badge/status-{{.Params.status}}-yellowgreen?style=flat-square" />
{{ end }}
{{ if eq .Params.status "retired" }}
<img src="https://img.shields.io/badge/status-{{.Params.status}}-red?style=flat-square" />
{{ end }}
<ul>
<li>Status: {{ .Params.status | markdownify }}</li>
<li>Editor: {{ .Params.editor | markdownify }}</li>
{{ if .Params.contributors }}
<li>Contributors:
{{ range $index, $element := .Params.contributors }}
{{if $index}},{{end}}
{{ . | markdownify }}
{{ end }}
</li>
{{ end }}
</ul>
{{- .Content -}}
</article>
{{ end }}
{{ define "toc" }}
{{ partial "docs/toc" . }}
{{ end }}