mirror of
https://github.com/foo-dogsquared/hugo-theme-more-contentful.git
synced 2025-01-31 04:58:14 +00:00
Revise the styling of the table of contents
I've also put more comments on the individual components in the partial. Hopefully, that'll mitigate against me forgetting their purpose all over again.
This commit is contained in:
parent
e0277a50bb
commit
5b540f3c1b
@ -37,7 +37,6 @@ footer[aria-label="Site footer"] {
|
|||||||
--size: 2rem;
|
--size: 2rem;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-size: var(--size);
|
font-size: var(--size);
|
||||||
line-height: var(--size);
|
|
||||||
margin-bottom: unset;
|
margin-bottom: unset;
|
||||||
margin-right: 0.5rem;
|
margin-right: 0.5rem;
|
||||||
}
|
}
|
||||||
@ -209,4 +208,12 @@ footer[aria-label="Site footer"] {
|
|||||||
background: var(--base01);
|
background: var(--base01);
|
||||||
font-size: 0.9em;
|
font-size: 0.9em;
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
|
|
||||||
|
// The styling is solely for consistency sake throughout the site.
|
||||||
|
> ul { padding-left: 1rem; }
|
||||||
|
|
||||||
|
ul {
|
||||||
|
list-style: disc;
|
||||||
|
padding-left: 1em;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,19 @@ Here's where all of the inline partials are defined.
|
|||||||
If the partial is short enough, it should be put here.
|
If the partial is short enough, it should be put here.
|
||||||
*/ -}}
|
*/ -}}
|
||||||
|
|
||||||
{{- /* This is a partial that creates an icon from the icon templates. */ -}}
|
{{- /*
|
||||||
|
This is a partial that creates an icon from the icon templates and links them from the created file.
|
||||||
|
Why not embed the text into the resulting document, you ask?
|
||||||
|
I just want to save a few kilobytes of the total site weight. :)
|
||||||
|
|
||||||
|
It accepts a dictionary with the specified keys:
|
||||||
|
|
||||||
|
- id - The name of the resource in a specific set.
|
||||||
|
- output - The output location of the resource relative to the base URL.
|
||||||
|
It can accept a formatted string (e.g., "icons/brand/%s.svg") where 'id' will be used.
|
||||||
|
- template - The template file to be used.
|
||||||
|
It should relative to the asset directory.
|
||||||
|
*/ -}}
|
||||||
{{- define "partials/components/icon.html" }}
|
{{- define "partials/components/icon.html" }}
|
||||||
{{- $icon := . }}
|
{{- $icon := . }}
|
||||||
{{- $res := resources.ExecuteAsTemplate (printf $icon.output $icon.id) $icon.id (resources.Get $icon.template) }}
|
{{- $res := resources.ExecuteAsTemplate (printf $icon.output $icon.id) $icon.id (resources.Get $icon.template) }}
|
||||||
@ -13,12 +25,19 @@ If the partial is short enough, it should be put here.
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
|
||||||
{{- /* A partial that aliases the Heroicon template from the icon partial */ -}}
|
{{- /*
|
||||||
|
A partial that aliases the Heroicon template from the icon partial.
|
||||||
|
It only needs a string of the ID from one of the icons.
|
||||||
|
*/ -}}
|
||||||
{{- define "partials/components/heroicon.html" }}
|
{{- define "partials/components/heroicon.html" }}
|
||||||
{{- partial "components/icon.html" (dict "id" . "output" "icons/generic/%s.svg" "template" "templates/heroicon.svg") }}
|
{{- partial "components/icon.html" (dict "id" . "output" "icons/generic/%s.svg" "template" "templates/heroicon.svg") }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|
||||||
|
{{- /*
|
||||||
|
The theme button in its own bed.
|
||||||
|
Take note this component already has conditional rendering so a conditional is unnecessary.
|
||||||
|
*/ -}}
|
||||||
{{- define "partials/components/theme-button.html" }}
|
{{- define "partials/components/theme-button.html" }}
|
||||||
{{- if gt (len (index $.Site.Data "more-contentful").themes) 1 }}
|
{{- if gt (len (index $.Site.Data "more-contentful").themes) 1 }}
|
||||||
<div class="site__theme-btn" aria-label="Theme toggle">
|
<div class="site__theme-btn" aria-label="Theme toggle">
|
||||||
@ -51,6 +70,10 @@ If the partial is short enough, it should be put here.
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
|
||||||
|
{{- /*
|
||||||
|
The component where it will display the metadata of the post.
|
||||||
|
This is used on list templates but feel free to change that.
|
||||||
|
*/ -}}
|
||||||
{{- define "partials/components/post-meta.html" }}
|
{{- define "partials/components/post-meta.html" }}
|
||||||
<div class="list post__meta">
|
<div class="list post__meta">
|
||||||
{{- if ne (.PublishDate.Format "2006") "0001" -}}
|
{{- if ne (.PublishDate.Format "2006") "0001" -}}
|
||||||
|
Loading…
Reference in New Issue
Block a user