diff options
Diffstat (limited to 'layouts/partials')
| -rw-r--r-- | layouts/partials/AddModule.html | 9 | ||||
| -rw-r--r-- | layouts/partials/GetIllustration.html | 22 | ||||
| -rw-r--r-- | layouts/partials/GetSections.html | 79 | ||||
| -rw-r--r-- | layouts/partials/InitModules.html | 62 | ||||
| -rw-r--r-- | layouts/partials/git.html | 3 |
5 files changed, 0 insertions, 175 deletions
diff --git a/layouts/partials/AddModule.html b/layouts/partials/AddModule.html deleted file mode 100644 index bd16780..0000000 --- a/layouts/partials/AddModule.html +++ /dev/null @@ -1,9 +0,0 @@ -{{ with .module }} - {{- $dependencies := page.Scratch.Get "dependencies" -}} - {{- if reflect.IsSlice $dependencies -}} - {{- $dependencies = complement $dependencies . -}} - {{ else }} - {{- $dependencies = slice . -}} - {{ end }} - {{- page.Scratch.Set "dependencies" $dependencies -}} -{{ end }}
\ No newline at end of file diff --git a/layouts/partials/GetIllustration.html b/layouts/partials/GetIllustration.html deleted file mode 100644 index 1b21f3b..0000000 --- a/layouts/partials/GetIllustration.html +++ /dev/null @@ -1,22 +0,0 @@ -{{- $item := .item -}} -{{- $illustration := "" -}} -{{- $style := "img-wrap mx-auto mx-md-0" -}} -{{- $size := .size | default "col-12 col-sm-4 col-lg-12" -}} - -{{ if $item.Params.icon }} - {{- $icon := (or (and (reflect.IsMap $item.Params.Icon) $item.Params.Icon.url) $item.Params.Icon) -}} - {{- $mode := and (reflect.IsMap $item.Params.Icon) $item.Params.Icon.mode -}} - {{ if eq (lower (path.Ext $icon)) ".json" }} - {{ $illustration = partial "assets/animation.html" (dict "data" $icon "mode" $mode "loop" false "hover" true "class" (printf "mx-auto text-center %s" $size)) }} - {{ else }} - {{ $illustration = partial "assets/icon.html" (dict "icon" "mode" $mode $icon "wrapper" "mx-auto text-center")}} - {{ end }} -{{ else }} - {{- $thumbnail := "" -}} - {{ if reflect.IsMap $item.Params.Thumbnail }}{{ $thumbnail = $item.Params.Thumbnail.url }}{{ else }}{{ $thumbnail = $item.Params.Thumbnail }}{{ end }} - {{- if $thumbnail }} - {{ $illustration = partial "assets/image.html" (dict "url" $thumbnail "ratio" "16x9" "wrapper" $style "inner" "rounded" "title" $item.Site.Title) }} - {{ end }} -{{ end }} - -{{ return $illustration }}
\ No newline at end of file diff --git a/layouts/partials/GetSections.html b/layouts/partials/GetSections.html deleted file mode 100644 index 393791d..0000000 --- a/layouts/partials/GetSections.html +++ /dev/null @@ -1,79 +0,0 @@ -{{- $page := .page -}} -{{- $loading := .loading -}} - -{{/* Add title for current page */}} -{{- $items := slice -}} -{{ $items = $items | append (dict "title" $page.Title "content" "" )}} - -{{/* Identify page sections */}} -{{- $sections := slice -}} -{{- $sections = $sections | append $page.Type -}} -{{ with $page.Params.sections }} - {{ $sections = $sections | append . }} -{{ end }} - -{{ if $page.IsHome }} - {{- if not $page.Params.sections -}} - {{- with site.Params.home.sections }} - {{ $sections = $sections | append . }} - {{ else }} - {{ range $section := site.Sections }} - {{ $sections = $sections | append $section.Type }} - {{ end }} - {{ end }} - {{- end -}} -{{ end }} - -{{/* Generate title and content for each section */}} -{{- range $index, $section := $sections -}} - {{- $sectionPage := site.GetPage "section" $section -}} - {{- $sectionURL := $sectionPage.RelPermalink -}} - {{ with $sectionPage.Params.redirect}} - {{ $target := partial "utilities/GetPage.html" (dict "url" . "page" $page) }} - {{- if not $target -}} - {{ if eq (printf "%T" $page.File) "*hugolib.fileInfo"}} - {{- errorf "Cannot find redirect target on page '%s': %s" $page.File . -}} - {{ else }} - {{- errorf "Cannot find redirect target: %s" . -}} - {{ end }} - {{ else }} - {{- $sectionURL = $target.RelPermalink -}} - {{ end }} - {{ end }} - {{- $title := or $sectionPage.Title $sectionPage.Type -}} - - {{- with (index site.Params.sections $section) -}} - {{- with index . "title" }}{{ $title = or . $title }}{{ end -}} - {{- end -}} - - {{- $thumbnail := "" -}} - {{ if reflect.IsMap $sectionPage.Params.Thumbnail }}{{ $thumbnail = $sectionPage.Params.Thumbnail.url }}{{ else }}{{ $thumbnail = $sectionPage.Params.Thumbnail }}{{ end }} - {{- $icon := $sectionPage.Params.Icon -}} - {{- $content := "" -}} - {{ if not $sectionPage.IsSection }}{{ $content = $sectionPage.Content }}{{ end -}} - {{- $sectionTitle := strings.FirstUpper $sectionPage.Type -}} - {{- $moreTitle := "" -}} - {{- with (index site.Params.sections $section) -}} - {{- with index . "reference" }}{{ $moreTitle = . }}{{ end -}} - {{- end -}} - {{- $moreTitle = or $moreTitle (printf (T "more" (pluralize $sectionTitle))) -}} - - {{- $sectionContent := trim (partial "assets/section-list.html" (dict - "page" $page - "section" $section - "home" $page.IsHome - "simple" (eq (len $sections) 1) - "thumbnail" $thumbnail - "icon" $icon - "content" $content - "moreTitle" $moreTitle - "sectionURL" $sectionURL - "loading" $loading)) " \r\n" - -}} - - {{ if $sectionContent }} - {{ $items = $items | append (dict "title" $title "content" $sectionContent)}} - {{ end }} -{{- end -}} - -{{ return $items }}
\ No newline at end of file diff --git a/layouts/partials/InitModules.html b/layouts/partials/InitModules.html deleted file mode 100644 index 0241774..0000000 --- a/layouts/partials/InitModules.html +++ /dev/null @@ -1,62 +0,0 @@ -{{ $core := slice }} -{{ $optional := slice }} -{{ $excludeSCSS := slice }} -{{ $disableTemplate := slice }} -{{ $localize := slice }} -{{ $modules := dict }} - -{{ range $key, $mod := .Site.Params.modules }} - {{ if eq $key "core" }} - {{ warnf "DEPRECATED: module parameter `core` has been deprecated in release v0.24.0" }} - {{ $core = $core | append $mod }} - {{ else if eq $key "optional" }} - {{ warnf "DEPRECATED: module parameter `optional` has been deprecated in release v0.24.0" }} - {{ $optional = $optional | append $mod }} - {{ else if eq $key "excludescss" }} - {{ warnf "DEPRECATED: module parameter `excludeSCSS` has been deprecated in release v0.24.0" }} - {{ $excludeSCSS = $excludeSCSS | append $mod }} - {{ else if eq $key "disabletemplate" }} - {{ warnf "DEPRECATED: module parameter `disableTemplate` has been deprecated in release v0.24.0" }} - {{ $disableTemplate = $disableTemplate | append $mod }} - {{ else if reflect.IsMap $mod }} - {{ $integration := index $mod "integration" }} - {{ if eq $integration "core" }} - {{ $core = $core | append $key }} - {{ else if eq $integration "optional" }} - {{ $optional = $optional | append $key }} - {{ else if $integration }} - {{ warnf "Unrecognized module integration setting: %s" $integration }} - {{ end }} - - {{ if eq (index $mod "excludeSCSS") true }} - {{ $excludeSCSS = $excludeSCSS | append $key }} - {{ end }} - - {{ if eq (index $mod "disableTemplate") true }} - {{ $disableTemplate = $disableTemplate | append $key }} - {{ end }} - - {{ if eq (index $mod "localize") true }} - {{ $localize = $localize | append $key }} - {{ end }} - - {{ $modules = merge $modules (dict $key $mod) }} - {{ else }} - {{ warnf "Unsupported module parameter: %s" $key }} - {{ end }} -{{ end }} - -{{ $modules := dict - "modules" $modules - "core" $core - "optional" $optional - "excludeSCSS" $excludeSCSS - "disableTemplate" $disableTemplate - "localize" $localize -}} - -{{- if and .IsPage (not (in $core "bootstrap")) -}} - {{- errorf "Bootstrap is a required module, please add it to 'modules.core' in your site parameters" -}} -{{- end -}} - -{{ return $modules }}
\ No newline at end of file diff --git a/layouts/partials/git.html b/layouts/partials/git.html deleted file mode 100644 index 58f9ff2..0000000 --- a/layouts/partials/git.html +++ /dev/null @@ -1,3 +0,0 @@ -{{ with .GitInfo }} -• <a href="{{ site.Params.docs.github | default site.Params.schema.github }}/commit/{{ .Hash }}">{{ .Subject }} ({{ .AbbreviatedHash }})</a> -{{ end -}}
\ No newline at end of file |
