0625ced466
* Add Docsy, required packages and config * Apply Docsy integration work to k8s website This encompasses significant changes to the style system, layout files, as well as changes to some of the static assets. To examine this work and the iterations that were performed, the original repository can be found at https://github.com/gearbox-built/kubernetes-hugo.git * Address issues found in review The styling and positioning of the header, footer, some shortcodes and main container elements are improved. A new partial is added for favicons. The sidebars, as well as inner table of contents, have been altered for better positioning and rendering of content. Localization has also been addressed. * Enable announcements The recent Black Lives Matter announcement surfaced issues which have been addressed.
41 lines
1.5 KiB
HTML
41 lines
1.5 KiB
HTML
{{ define "main" }}
|
|
{{ if .Parent.IsHome }}
|
|
{{ $.Scratch.Set "blog-pages" (where .Site.RegularPages "Section" .Section) }}
|
|
{{ else }}
|
|
{{$.Scratch.Set "blog-pages" .Pages }}
|
|
{{ end }}
|
|
<!-- This file is identical to the Docsy template, except for a check to length before
|
|
calling Paginate. Kubernetes includes blog/index.html pages for languages which do not
|
|
have blog posts -->
|
|
{{ if gt (len ($.Scratch.Get "blog-pages")) 0 }}
|
|
{{ $pag := .Paginate (( $.Scratch.Get "blog-pages").GroupByDate "2006")}}
|
|
{{ $pageGroups := $pag.PageGroups}}
|
|
{{ if eq $pag.PageNumber 1 }}
|
|
{{ end }}
|
|
<div class="row">
|
|
<div class="col-12">
|
|
{{ range $pageGroups }}
|
|
<h2>{{ T "post_posts_in" }} {{ .Key }}</h2>
|
|
<ul class="list-unstyled mt-4">
|
|
{{ range .Pages }}
|
|
<li class="media mb-4">
|
|
<div class="media-body">
|
|
<h5 class="mt-0 mb-1"><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h5>
|
|
<p class="mb-2 mb-md-3"><small class="text-muted">{{ .Date.Format ($.Param "time_format_blog") }} {{ T "ui_in"}} {{ .CurrentSection.LinkTitle }}</small></p>
|
|
{{ partial "featured-image.html" (dict "p" . "w" 250 "h" 125 "class" "float-left mr-3 pt-1 d-none d-md-block") }}
|
|
<p class="pt-0 mt-0">{{ .Plain | safeHTML | truncate 250 }}</p>
|
|
<p class="pt-0"><a href="{{ .RelPermalink }}">{{ T "ui_read_more"}}</a></p>
|
|
</div>
|
|
</li>
|
|
{{ end }}
|
|
</ul>
|
|
{{ end }}
|
|
</div>
|
|
</div>
|
|
<div class="row pl-2 pt-2">
|
|
<div class="col">
|
|
{{ template "_internal/pagination.html" . }}
|
|
</div>
|
|
</div>
|
|
{{ end }}
|
|
{{ end }} |