Skip to content

Commit

Permalink
restore _default
Browse files Browse the repository at this point in the history
  • Loading branch information
oskar2517 committed Nov 20, 2024
1 parent 2be20c0 commit 9a5da98
Show file tree
Hide file tree
Showing 5 changed files with 195 additions and 0 deletions.
67 changes: 67 additions & 0 deletions themes/slick/layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<!DOCTYPE html>
<html lang="{{ default "en" .Site.LanguageCode }}">
<head>
<meta charset="utf-8"/>
<title>{{ if and (.Title) (not (eq .Title .Site.Title)) }}{{ .Title }} | {{ end }}{{ .Site.Title }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ if .IsPage }}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}"/>
{{- with default .Site.Params.author .Page.Params.author }}
{{- $authorName := "" }}
{{- if reflect.IsMap . }}
{{- with .name }}{{- $authorName = . }}{{- end }}
{{- else }}
{{- $authorName = . }}
{{- end }}
{{- with $authorName }}
<meta name="author" content="{{ . }}"/>
{{- end }}
{{- end }}
{{ if .Site.Params.opengraph }}{{ template "_internal/opengraph.html" . }}{{ end -}}
{{ if .Site.Params.schema }}{{ template "_internal/schema.html" . }}{{ end -}}
{{ if .Site.Params.twitter_cards }}{{ template "_internal/twitter_cards.html" . }}{{ end -}}
{{ hugo.Generator }}
{{- with .Site.Home.OutputFormats.Get "RSS" }}
{{- $type := printf "type=%q" .MediaType | safeHTMLAttr }}
{{- $href := printf "href=%q" .RelPermalink | safeHTMLAttr }}
<link rel="{{ .Rel }}" {{ $type }} {{ $href }} title="{{ $.Site.Title }} Feed"/>
{{- $rssLink := .RelPermalink }}
{{- with $.Page.OutputFormats.Get "RSS" }}
{{- if ne $rssLink .RelPermalink }}
{{- $type := printf "type=%q" .MediaType | safeHTMLAttr }}
{{- $href := printf "href=%q" .RelPermalink | safeHTMLAttr }}
<link rel="{{ .Rel }}" {{ $type }} {{ $href }} title="{{ $.Site.Title }} {{ $.Title }} Feed"/>
{{- end }}
{{- end }}
{{- end }}
{{- with default "favicon.ico" .Site.Params.favicon }}
{{- if resources.Get . }}
{{- $favicon := resources.Get . | resources.Fingerprint }}
{{- $type := printf "type=%q" $favicon.MediaType | safeHTMLAttr }}
{{- $href := printf "href=%q" $favicon.RelPermalink | safeHTMLAttr }}
{{- $hash := printf "integrity=%q" $favicon.Data.Integrity | safeHTMLAttr }}
<link rel="shortcut icon" {{ $type }} {{ $href }} {{ $hash }}/>
{{- end }}
{{- end }}
{{- $style := resources.Get "style.css" | resources.Fingerprint }}
{{- $href := printf "href=%q" $style.RelPermalink | safeHTMLAttr }}
{{- $hash := printf "integrity=%q" $style.Data.Integrity | safeHTMLAttr }}
<link rel="stylesheet" {{ $href }} {{ $hash }} crossorigin="anonymous"/>
{{- $script := resources.Get "script.js" | resources.Fingerprint }}
{{- $href := printf "src=%q" $script.RelPermalink | safeHTMLAttr }}
{{- $hash := printf "integrity=%q" $script.Data.Integrity | safeHTMLAttr }}
<script defer {{ $href }} {{ $hash }} crossorigin="anonymous"></script>
{{- partial "head.html" . -}}
</head>
<body>
<div class="pure-g">
<div class="pure-u-1-24 pure-u-md-5-24"></div>
<div class="pure-u-22-24 pure-u-md-14-24">
{{ partial "navbar.html" . }}
{{ block "main" . }}{{ end }}
{{ partial "footer.html" . }}
</div>
<div class="pure-u-1-24 pure-u-md-5-24"></div>
</div>
</body>
</html>
27 changes: 27 additions & 0 deletions themes/slick/layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- define "main" }}
{{- $showfull := default false .Site.Params.showFullContent }}
{{- $orderkey := default "date" .Site.Params.orderPageParam }}
{{- $orderrev := default true .Site.Params.orderPageReverse }}
{{- $pagepool := .Pages.ByParam $orderkey }}
{{- $pagepool := cond $orderrev $pagepool.Reverse $pagepool }}
{{- range $idx, $_ := (.Paginate $pagepool).Pages }}
<div{{ if and $showfull $idx }} class="post-divider"{{ end }} class="list-post">
<img class="list-post-preview-image" src="{{ .RelPermalink }}/assets/feature.jpg">
{{- if default (default true .Site.Params.showMeta) .Params.showmeta }}
<div class="list-post-title-wrapper">
<h2 class="post-title">
{{ if .Draft }}DRAFT: {{ end }}
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</h2>
{{ partial "post_meta.html" . }}
</div>
{{- end }}
<div class="list-post-content-wrapper">
{{ cond $showfull .Content .Summary }}
</div>
</div>
<hr>
{{- end }}
{{ partial "pagination.html" . }}
{{- end }}

68 changes: 68 additions & 0 deletions themes/slick/layouts/_default/rss.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{{- $pctx := cond .IsHome .Site . -}}
{{- $limiting := default 0 .Site.Config.Services.RSS.Limit -}}
{{- $orderkey := default "date" .Site.Params.orderPageParam -}}
{{- $orderrev := default true .Site.Params.orderPageReverse -}}
{{- $pagepool := $pctx.RegularPages.ByParam $orderkey -}}
{{- $pagepool := cond $orderrev $pagepool.Reverse $pagepool -}}
{{- if gt $limiting 0 -}}
{{- $pagepool := first $limiting $pagepool -}}
{{- end -}}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }}</description>
<generator>Hugo {{ hugo.Version }}</generator>
{{- with .Site.LanguageCode }}
<language>{{ . }}</language>
{{- end }}
{{- with .Site.Params.author }}
{{- $authorName := "" }}
{{- $authorEmail := "" }}
{{- if reflect.IsMap . }}
{{- with .name }}{{- $authorName = . }}{{- end }}
{{- with .email }}{{- $authorEmail = . }}{{- end }}
{{- else }}
{{- $authorName = . }}
{{- end }}
{{- with $authorEmail }}
<managingEditor>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</managingEditor>
<webMaster>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</webMaster>
{{- end }}
{{- end }}
{{- with .Site.Copyright }}
<copyright>{{ . }}</copyright>
{{- end }}
{{- if not .Date.IsZero }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>
{{- end }}
{{- with .OutputFormats.Get "RSS" }}
{{- $href := printf "href=%q" .Permalink | safeHTMLAttr }}
{{- $type := printf "type=%q" .MediaType | safeHTMLAttr }}
<atom:link {{ $href }} rel="self" {{ $type }}/>
{{- end }}
{{- range $pagepool }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{- with default .Site.Params.author .Page.Params.author }}
{{- $authorName := "" }}
{{- $authorEmail := "" }}
{{- if reflect.IsMap . }}
{{- with .name }}{{- $authorName = . }}{{- end }}
{{- with .email }}{{- $authorEmail = . }}{{- end }}
{{- else }}
{{- $authorName = . }}
{{- end }}
{{- with $authorEmail }}
<author>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</author>
{{- end }}
{{- end }}
<guid isPermaLink="true">{{ .Permalink }}</guid>
<description>{{ .Content | html }}</description>
</item>
{{- end }}
</channel>
</rss>
17 changes: 17 additions & 0 deletions themes/slick/layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- define "main" }}
{{- $showmeta := default (default true $.Site.Params.showMeta) .Params.showmeta }}
<div>
{{- if $showmeta }}
<div>
<h2 class="post-title">
{{ if .Draft }}DRAFT: {{ end }}
{{ .Title }}
</h2>
{{ partial "post_meta.html" . }}
</div>
{{- end }}
<div>
{{ .Content }}
</div>
</div>
{{- end }}
16 changes: 16 additions & 0 deletions themes/slick/layouts/_default/terms.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- define "main" }}
<div>
<p>{{ .Title }}:</p>
<ul>
{{- range .Data.Terms.ByCount }}
{{ $count := .Count }}
{{- with $.GetPage (lower .Name) }}
<li>
<a href="{{ .RelPermalink }}"{{ if .Title }} title="{{ .Title }}"{{ end }}>{{ .Name }}</a>
<span>&#40;{{ $count }}&#41;</span>
</li>
{{- end }}
{{- end }}
</ul>
</div>
{{- end }}

0 comments on commit 9a5da98

Please sign in to comment.