Skip to content

Commit 0b75a24

Browse files
committed
new layout for full pages
1 parent 7110f86 commit 0b75a24

1 file changed

Lines changed: 71 additions & 0 deletions

File tree

layouts/fullpage.html

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{{ define "main" -}}
2+
{{- $breakpoint := $.Scratch.Get "breakpoint" -}}
3+
4+
<div class="container-xxl flex-fill p-4 px-xxl-0">
5+
<div class="row row-cols-1 row-cols-{{ $breakpoint.current }}-2">
6+
<div class="col col-{{ $breakpoint.prev }}-12 col-{{ $breakpoint.current }}-12">
7+
{{- $metadata := "full" -}}
8+
{{ if isset .Params "metadata" }}
9+
{{ $metadata = .Params.metadata }}
10+
{{ else }}
11+
{{- with (index site.Params.pages .Type ) -}}
12+
{{ if isset . "metadata" }}{{ $metadata = (index . "metadata") }}{{ end }}
13+
{{- end -}}
14+
{{ end }}
15+
16+
{{- $supportedStates := slice "full" "original" "none" -}}
17+
{{- if not (in $supportedStates $metadata) -}}
18+
{{- errorf "layout [_default/single/header.html] - Invalid value for param 'metadata': %s" $metadata -}}
19+
{{- end -}}
20+
21+
{{ with .Title }}<p class="display-4 mt-5">{{ . }}</p>{{ end }}
22+
{{ if ne $metadata "none" }}
23+
<small class="text-body-secondary text-uppercase">
24+
{{ if .Date }}
25+
{{ $lastmodstr := (partial "utilities/date.html" (dict "date" .Lastmod "format" "long")) -}}
26+
{{ $datestr := (partial "utilities/date.html" (dict "date" .Date "format" "long")) -}}
27+
{{ $datestr | i18n "postedOnDate" -}}
28+
{{ if eq $metadata "full" }}
29+
{{ if ne $datestr $lastmodstr -}}&nbsp;({{ $lastmodstr | i18n "lastModified" }}){{ end }}
30+
{{ end }}
31+
&bull;
32+
{{ end }}
33+
</small>
34+
{{ end }}
35+
36+
{{- if gt (len (.GetTerms "tags")) 0 -}}
37+
<div class="mt-3">
38+
<div class="d-none-dark">
39+
<div class="hstack gap-1">
40+
{{ range (.GetTerms "tags") -}}
41+
{{- $url := .Page.RelPermalink -}}
42+
{{ partial "assets/button.html" (dict "href" $url "title" .LinkTitle "color" "light" "size"
43+
"sm") }}
44+
{{ end -}}
45+
</div>
46+
</div>
47+
48+
<div class="d-none-light">
49+
<div class="hstack gap-1">
50+
{{ range (.GetTerms "tags") -}}
51+
{{- $url := .Page.RelPermalink -}}
52+
{{ partial "assets/button.html" (dict "href" $url "title" .LinkTitle "color" "primary" "size"
53+
"sm" "outline" "true") }}
54+
{{ end -}}
55+
</div>
56+
</div>
57+
</div>
58+
{{- end -}}
59+
{{ partial "assets/sharing.html" (dict "page" .) }}
60+
61+
62+
{{ partial "utilities/ProcessContent" (dict "page" .Page "raw" .RawContent) }}
63+
64+
<div class="mt-5 small">
65+
{{ partial "utilities/git.html" . }}
66+
</div>
67+
{{ .Render "single/footer" }}
68+
</div>
69+
</div>
70+
</div>
71+
{{ end -}}

0 commit comments

Comments
 (0)