New post in drafts and almost ready. Also on a new computer, so had to re-download all the theme and submodules. Thinking of just converting the box submodule to be native to my blog for easier maintenence. Need to proof this last post on google sheets and publish tomorrow morning.
This commit is contained in:
@ -0,0 +1,57 @@
|
||||
{{/* Source:https://gitlab.com/Roneo/hugo-shortcode-roneo-collection */}}
|
||||
|
||||
{{- $icon := "" -}}
|
||||
{{- $theme := "" -}}
|
||||
{{- $class := "" -}}
|
||||
{{- $href := "" -}}
|
||||
|
||||
|
||||
{{/* Count how many times we've called this shortcode and load the css if it's the first time */}}
|
||||
{{- if not ($.Page.Scratch.Get "ico_count") -}}
|
||||
<style>
|
||||
.ico {
|
||||
height: 1.15em;
|
||||
width: 1.15em;
|
||||
position: relative;
|
||||
top: 3px;
|
||||
}
|
||||
.ico-sm .ico {
|
||||
height: .8em;
|
||||
width: .8em;
|
||||
}
|
||||
.ico-md .ico {
|
||||
height: 1.5em;
|
||||
width: 1.5em;
|
||||
}
|
||||
.ico-xl .ico {
|
||||
height: 2em;
|
||||
width: 2em;
|
||||
}
|
||||
.ico-xxl .ico {
|
||||
height: 3em;
|
||||
width: 3em;
|
||||
}
|
||||
</style>
|
||||
{{- end -}}
|
||||
{{- $.Page.Scratch.Add "ico_count" 1 -}}
|
||||
|
||||
|
||||
{{- if .IsNamedParams }}
|
||||
{{- $icon = .Get "icon" -}}
|
||||
{{- $theme = (.Get "theme" | default "default") -}}
|
||||
{{- $class = .Get "class" -}}
|
||||
{{- $href = .Get "href" -}}
|
||||
{{- else }}
|
||||
{{- $icon = .Get 0 -}}
|
||||
{{- $theme = (.Get 1 | default "default") -}}
|
||||
{{- $class = .Get 2 -}}
|
||||
{{- $href = .Get 3 -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if not $icon -}}
|
||||
{ {- errorf "Missing required 'icon'. Shortcode: 'ico'." -}}
|
||||
{{- end -}}
|
||||
{{- with .Page.Resources.GetMatch $icon }}
|
||||
{{ $icon = . }}
|
||||
{{ end -}}
|
||||
{{ partial "ico" (dict "icon" $icon "theme" $theme "class" $class "href" $href) }}
|
||||
Reference in New Issue
Block a user