mirror of
https://github.com/theNewDynamic/gohugo-theme-ananke.git
synced 2025-06-08 17:22:46 +00:00
This change adds overrides for text scale, color, alignment, and padding in all layouts. This can be configured in site or page parameters, and can target the default for all layouts (mostly useful for scale and color), or for a specific layout (home, post, list, page, or terms). The parameters are named in the following way: <type>_<style>: - default_scale: Defines default scale for content (aka f5) - default_color: Defines default color for content (aka mid-gray) - default_padding: Defines default padding for content (aka ph*/pv*) - default_align: Defines default alignment for content (aka tc/tj) This can be overridden for "home", "post", "list", "page", or "terms" by using instead of "default". If a type-specific style is not specified, then it will fall back on "default", and if default is not specified, it will fall back on the Ananke theme default. Of course, theme users may put whatever classes they want in these settings, but it still is valuable to specify what will be overridden from the theme.
26 lines
1.3 KiB
HTML
26 lines
1.3 KiB
HTML
{{ define "main" }}
|
|
{{/*
|
|
This template is the same as the default and is here to demonstrate that if you have a content directory called "post" you can create a layouts directory, just for that section.
|
|
*/}}
|
|
<article class="pa3 pa4-ns nested-copy-line-height nested-img">
|
|
{{ $cpadding := $.Param "list_padding" | default ($.Param "default_padding") | default "ph3 ph5-l pv3 pv4-l" }}
|
|
{{ $cscale := $.Param "list_scale" | default ($.Param "default_scale") | default "f4" }}
|
|
{{ $calign := $.Param "list_align" | default ($.Param "default_align") | default "tc-l" }}
|
|
{{ $ccolor := $.Param "list_color" | default ($.Param "default_color") | default "mid-gray" }}
|
|
<section class="cf {{ $cpadding }} {{ $cscale }} {{ $calign }} center measure-wide lh-copy {{ $ccolor }}">
|
|
{{ .Content }}
|
|
</section>
|
|
<aside class="flex-ns flex-wrap justify-around mt5">
|
|
{{ range .Paginator.Pages }}
|
|
<div class="relative w-100 w-30-l mb4 bg-white">
|
|
{{/*
|
|
Note we can use `.Render` here for items just in this section, instead of a partial to pull in items for the list page. https://gohugo.io/functions/render/
|
|
*/}}
|
|
{{ .Render "summary" }}
|
|
</div>
|
|
{{ end }}
|
|
</aside>
|
|
{{ template "_internal/pagination.html" . }}
|
|
</article>
|
|
{{ end }}
|