mirror of
https://github.com/foo-dogsquared/hugo-theme-more-contentful.git
synced 2025-01-31 04:58:14 +00:00
Gabriel Arazas
092df10444
This is to make testing and deploying between different versions easier such as Netlify deployments.
33 lines
1.2 KiB
HTML
33 lines
1.2 KiB
HTML
{{- /*
|
|
Here's where all of the inline partials are defined.
|
|
If the partial is short enough, it should be put here.
|
|
*/ -}}
|
|
|
|
{{- /*
|
|
A partial that aliases the Heroicon template from the icon partial.
|
|
*/ -}}
|
|
{{- define "partials/components/heroicon.html" }}
|
|
{{- $name := default .id .name }}
|
|
{{- $res := resources.ExecuteAsTemplate (printf "icons/generic/%s.svg" .id)
|
|
(dict "id" .id
|
|
"name" $name)
|
|
(resources.Get "templates/heroicon.svg") }}
|
|
<svg class="site__icon">
|
|
<use href="{{ $res.RelPermalink }}#{{ $name }}"></use>
|
|
</svg>
|
|
{{ end }}
|
|
|
|
{{- /*
|
|
A partial for easily using icons from Simple Icons set.
|
|
*/ -}}
|
|
{{- define "partials/components/simple-icon.html" }}
|
|
{{- $name := default .id .name }}
|
|
{{- $res := resources.ExecuteAsTemplate (printf "icons/brand/%s.svg" .id)
|
|
(dict "id" .id
|
|
"name" $name)
|
|
(resources.Get "templates/simple-icon.svg") }}
|
|
<svg class="site__icon">
|
|
<use href="{{ $res.RelPermalink }}#{{ $name }}"></use>
|
|
</svg>
|
|
{{- end }}
|