Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #570 from gethinode/develop
Support content view templates for single pages
- Loading branch information
Showing
11 changed files
with
133 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{- partial "single/thumbnail.html" . -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<div class="row row-cols-2 mt-5 mb-3"> | ||
<div class="col"> | ||
{{ with .NextInSection -}} | ||
{{ if .OutputFormats.Get "html" -}} | ||
<a class="next" href="{{ .RelPermalink }}"> | ||
{{- partial "assets/icon.html" (dict "icon" "fas arrow-left" "spacing" false) }} {{ .LinkTitle }} | ||
</a> | ||
{{- end -}} | ||
{{ end -}} | ||
</div> | ||
<div class="col text-end"> | ||
{{ with .PrevInSection -}} | ||
{{ if .OutputFormats.Get "html" -}} | ||
<a class="previous" href="{{ .RelPermalink }}"> | ||
{{ .LinkTitle }} {{- partial "assets/icon.html" (dict "icon" "fas arrow-right" "spacing" false) }} | ||
</a> | ||
{{- end -}} | ||
{{ end -}} | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{{ $lastmodstr := (partial "utilities/date.html" (dict "date" .Lastmod "format" "long")) -}} | ||
{{ $datestr := (partial "utilities/date.html" (dict "date" .Date "format" "long")) -}} | ||
{{ with .Title }}<p class="display-4 mt-5">{{ . }}</p>{{ end }} | ||
<small class="text-body-secondary text-uppercase"> | ||
{{ $datestr | i18n "postedOnDate" -}} | ||
{{ if ne $datestr $lastmodstr -}} ({{ $lastmodstr | i18n "lastModified" }}){{ end }} • | ||
{{ .ReadingTime | lang.FormatNumber 0 }} {{ i18n "minutesShort" }} {{ i18n "read" }} • | ||
{{ .WordCount | lang.FormatNumber 0 }} {{ i18n "words" }} | ||
</small> | ||
|
||
{{- if gt (len (.GetTerms "tags")) 0 -}} | ||
<div class="mt-3"> | ||
<div class="d-none-dark"> | ||
<div class="hstack gap-1"> | ||
{{ range (.GetTerms "tags") -}} | ||
{{- $url := (path.Join .Page.RelPermalink) | relLangURL -}} | ||
{{ partial "assets/button.html" (dict "href" $url "title" .LinkTitle "color" "light" "size" "sm") }} | ||
{{ end -}} | ||
</div> | ||
</div> | ||
|
||
<div class="d-none-light"> | ||
<div class="hstack gap-1"> | ||
{{ range (.GetTerms "tags") -}} | ||
{{- $url := (path.Join .Page.RelPermalink) | relLangURL -}} | ||
{{ partial "assets/button.html" (dict "href" $url "title" .LinkTitle "color" "primary" "size" "sm" "outline" "true") }} | ||
{{ end -}} | ||
</div> | ||
</div> | ||
</div> | ||
{{- end -}} | ||
{{ partial "assets/sharing.html" . }} | ||
<p class="lead mb-5 mt-3">{{ .Description }}</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{/* Intentionally left blank to suppress thumbnail */}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div class="mt-5 small"> | ||
{{ partial "utilities/git.html" . }} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{{ with .Title }}<p class="display-4 mt-5">{{ . }}</p>{{ end }} | ||
{{ partial "assets/sharing.html" . }} | ||
<p class="lead mb-5">{{ .Description }}</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{/* Intentionally left blank to suppress thumbnail */}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{/* Intentionally left blank to suppress page navigation */}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{{ with .Title }}<p class="display-4 mt-5">{{ . }}</p>{{ end }} | ||
{{ partial "assets/sharing.html" . }} | ||
<p class="lead mb-5">{{ .Description }}</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{{- $thumbnail := "" -}} | ||
{{- $credits := "" -}} | ||
|
||
{{- if reflect.IsMap .Params.Thumbnail -}} | ||
{{- $thumbnail = .Params.Thumbnail.url -}} | ||
{{- $author := "" -}} | ||
{{- if and .Params.Thumbnail.authorURL "text" .Params.Thumbnail.author }} | ||
{{- $author = partial "utilities/link" (dict "destination" .Params.Thumbnail.authorURL "text" .Params.Thumbnail.author) -}} | ||
{{- else if .Params.Thumbnail.author }} | ||
{{- $author = .Params.Thumbnail.author -}} | ||
{{- end -}} | ||
|
||
{{- $origin := "" -}} | ||
{{- if and .Params.Thumbnail.originURL "text" .Params.Thumbnail.origin }} | ||
{{- $origin = partial "utilities/link" (dict "destination" .Params.Thumbnail.originURL "text" .Params.Thumbnail.origin) -}} | ||
{{- else if .Params.Thumbnail.origin }} | ||
{{- $origin = .Params.Thumbnail.origin -}} | ||
{{- end }} | ||
|
||
{{- if and $author $origin }} | ||
{{ $credits = printf (T "photoFull") $author $origin }} | ||
{{ else if $author }} | ||
{{ $credits = T "photoShort" $author }} | ||
{{ end }} | ||
{{ else }} | ||
{{- $thumbnail = .Params.Thumbnail -}} | ||
{{ if or .Params.photoCredits .Params.photoSource }} | ||
{{ warnf "DEPRECATED: frontmatter variables `photoCredits` and `photoSource` have been deprecated in release v0.18: %s" .RelPermalink }} | ||
{{ end }} | ||
{{- if and .Params.photoCredits .Params.PhotoSource }}{{ $credits = printf (T "photoFull") .Params.photoCredits .Params.PhotoSource }}{{ end -}} | ||
{{- end -}} | ||
|
||
{{ if $thumbnail -}} | ||
{{- partial "assets/image.html" (dict "url" $thumbnail "ratio" "21x9" "outerClass" "img-wrap" "innerClass" "rounded" "title" .Params.title "caption" $credits) -}} | ||
{{ end -}} |