From 1c15fe67c72b4591feaceeffec0951e34a6c2e46 Mon Sep 17 00:00:00 2001 From: clsr Date: Fri, 18 Aug 2017 14:08:04 +0200 Subject: Initial commit --- templates/content.html | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 templates/content.html (limited to 'templates/content.html') diff --git a/templates/content.html b/templates/content.html new file mode 100644 index 0000000..73f18c7 --- /dev/null +++ b/templates/content.html @@ -0,0 +1,97 @@ +{{- if eq .Name "section" "content" -}} +{{- if .Title}} +
+ {{- inc .Title -}} + + {{- with .Title -}} + {{- if $l := lanchor -}} + {{.}}ΒΆ + {{- if $s := sanchor}}{{if ne $s $l}}{{end}}{{end -}} + + {{- end -}} + {{- end -}} + + {{- range .Children -}} + {{- template "content.html" . -}} + {{- end -}} + {{- dec -}} +
+{{else -}} +{{- range .Children -}} + {{- template "content.html" . -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{- if eq .Name "list" -}} +{{if .Ordered}} + {{- range .Children -}} + {{- if eq .Name "list" -}} + {{- template "content.html" . -}} + {{- else -}} +
  • {{- template "content.html" . -}}
  • + {{- end -}} + {{- end -}} +{{- if .Ordered}}{{else}}{{end -}} +{{- end -}} + +{{- if eq .Name "table" -}} + + {{- range .Rows -}} + {{- template "content.html" . -}} + {{- end -}} +
    +{{- end -}} + +{{- if eq .Name "header" -}} + + {{- range .Children -}} + {{template "content.html" .}} + {{- end -}} + +{{- end -}} + +{{- if eq .Name "row" -}} + + {{- range .Children -}} + {{template "content.html" .}} + {{- end -}} + +{{- end -}} + +{{- if eq .Name "embed" -}} +
    + {{- if eq .Type "image/png" "image/jpeg" "image/webp" "image/*" -}} + {{with .Description}}{{.}}{{else}}embedded {{.Type}}{{end}} + {{- end -}} + {{- if eq .Type "video/mp4" "video/webm" "video/*" -}} + + {{- end -}} + {{- if not (eq .Type "image/png" "image/jpeg" "image/webp" "image/*" "video/mp4" "video/webm" "video/*") -}} +

    + Embedded {{.Type}} content: {{.URL}} +

    + {{- end -}} + {{- with .Description}}
    {{.}}
    {{end -}} +
    +{{- end -}} + +{{- if eq .Name "text" -}} + {{- if eq .Format "" "plain"}}{{range .Contents.Paragraphs -}} +

    {{.}}

    + {{- end}}{{end -}} + {{- if eq .Format "fmt" -}} + {{- range .Contents.Paragraphs -}} + {{- cnmfmt . -}} + {{- end -}} + {{- end -}} + {{- if not (eq .Format "" "plain" "fmt") -}} +
    {{.Contents.Text}}
    + {{- end -}} +{{- end -}} + +{{- if eq .Name "raw" -}} +
    {{.Contents}}
    +{{- end -}} -- cgit