New card template. Add settings to transpile sass with libsass or dartsass. Add setting to use internal pagination template. Wrap summary in p tags.

This commit is contained in:
Fredrik Jonsson 2023-01-25 10:03:12 +01:00
commit f58575e232
6 changed files with 19 additions and 8 deletions

View file

@ -0,0 +1,8 @@
<article class="card{{ with .Section }} card--{{ . | urlize }}{{ end }}">
<header>
<h2 class="title"><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
</header>
<div class="content">
<p>{{ .Summary }}</p>
</div>
</article>

View file

@ -4,6 +4,6 @@
{{ if $.Param "submitted" | default false }}{{ partial "submitted.html" . -}}{{ end }}
</header>
<div class="content">
{{ .Summary }}
<p>{{ .Summary }}</p>
</div>
</article>

View file

@ -2,11 +2,9 @@
{{ define "main" -}}
<main class="main layout__main">
<article class="single-view{{ with .Section }} single-view--{{ . | urlize }}{{ end }}">
<div class="content">
{{ .Content }}
</div>
</article>
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
{{ $paginator := .Paginate $pages -}}

View file

@ -1,4 +1,4 @@
<nav class="main-menu layout__navigation" aria-label="{{ i18n "menu_title" }}">
<nav class="main-menu{{ if not ($.Param "menuinheader") }} layout__navigation{{ end }}" aria-label="{{ i18n "menu_title" }}">
<ul class="navbar">
{{ if site.Menus.main -}}

View file

@ -1,11 +1,14 @@
{{ if $.Param "internalpagination" -}}
{{ template "_internal/pagination.html" . }}
{{ else -}}
{{ if or (.Paginator.HasPrev) (.Paginator.HasNext) -}}
<nav class="pager">
{{ if .Paginator.HasPrev -}}
<a href="{{ .Paginator.Prev.URL }}" rel="prev" class="pager-item pager-prev">{{ i18n "pager_prev" }}</a>
<a href="{{ .Paginator.Prev.URL }}" rel="prev" class="pager__item pager__item--prev"><span aria-hidden="true">« </span>{{ i18n "pager_prev" }}</a>
{{ end -}}
{{ if .Paginator.HasNext -}}
<a href="{{ .Paginator.Next.URL }}" rel="next" class="pager-item pager-next">{{ i18n "pager_next" }}</a>
<a href="{{ .Paginator.Next.URL }}" rel="next" class="pager__item pager__item--next">{{ i18n "pager_next" }}<span aria-hidden="true"> »</span></a>
{{ end -}}
</nav>
{{ end -}}
{{ end -}}

View file

@ -1,4 +1,4 @@
{{ $main_options := (dict "targetPath" "css/styles.css" "outputStyle" "compressed" "enableSourceMap" false "includePaths" (slice "assets/sass/lib/typey/stylesheets")) -}}
{{ $main_options := (dict "targetPath" "css/styles.css" "outputStyle" "compressed" "enableSourceMap" false "transpiler" (site.Params.sassTranspiler | default "libsass")) -}}
{{ if eq hugo.Environment "development" -}}
{{ $main_options = merge $main_options (dict "outputStyle" "nested" "enableSourceMap" true) -}}
{{ end -}}