diff options
Diffstat (limited to 'generators/hugo/themes/edwin/layouts')
22 files changed, 275 insertions, 0 deletions
diff --git a/generators/hugo/themes/edwin/layouts/_default/baseof.html b/generators/hugo/themes/edwin/layouts/_default/baseof.html new file mode 100644 index 0000000..a07a6b7 --- /dev/null +++ b/generators/hugo/themes/edwin/layouts/_default/baseof.html @@ -0,0 +1,26 @@ +{{ block "header" . }} +{{ partial "header" . }} +{{ end }} + + +<!-- +{{ block "navigator" . }} + {{ partial "navigator" . }} +{{ end }} +--> + + +{{ block "body" . }} + {{ block "main" . }} +{{ end }} + + +<!-- +{{ partial "sidebar.html" . }} +{{ end }} +--> + + +{{ block "footer" . }} + {{ partial "footer" . }} +{{ end }} diff --git a/generators/hugo/themes/edwin/layouts/_default/content.html b/generators/hugo/themes/edwin/layouts/_default/content.html new file mode 100644 index 0000000..049fa30 --- /dev/null +++ b/generators/hugo/themes/edwin/layouts/_default/content.html @@ -0,0 +1,11 @@ +<article class="blog-post"> + <header> + <h2 class="blog-post-title"> + <a class="text-dark" href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a> + </h2> + {{ partial "post-date" . }} + {{ partial "post-tags" . }} + {{ partial "post-categories" . }} + </header> + {{ .Content }} +</article>
\ No newline at end of file diff --git a/generators/hugo/themes/edwin/layouts/_default/list.html b/generators/hugo/themes/edwin/layouts/_default/list.html new file mode 100644 index 0000000..e7b9ef8 --- /dev/null +++ b/generators/hugo/themes/edwin/layouts/_default/list.html @@ -0,0 +1,16 @@ +{{ define "main" }} + +{{ $truncate := default true .Site.Params.truncate }} +{{ range .Paginator.Pages }} + + {{ if $truncate }} + {{ .Render "summary" }} + {{ else }} + {{ .Render "content" }} + {{ end }} + +{{ end }} + +{{ partial "paginator" . }} + +{{ end }} diff --git a/generators/hugo/themes/edwin/layouts/_default/single.html b/generators/hugo/themes/edwin/layouts/_default/single.html new file mode 100644 index 0000000..ae9fe12 --- /dev/null +++ b/generators/hugo/themes/edwin/layouts/_default/single.html @@ -0,0 +1,33 @@ +{{ define "main" }} + + +<h2 class="text-gray-700 text-2xl font-bold mb-2">{{ .Title | markdownify }}</h2> + +<p class="mb-1 text-gray-700">{{ partial "post-date" . }}</p> + +<p class=" text-gray-700 mb-4">{{ partial "post-tags" . }}</p> + + +<article class="journal-post"> + {{ .Content | replaceRE "<p>" "<p class=\"leading-normal text-gray-900 text-xl mb-4\">" | safeHTML }} + + {{ if .IsTranslated }} + <h4>{{ i18n "translations" }}</h4> + <ul> + {{ range .Translations }} + <li> + <a href="{{ .RelPermalink }}">{{ .Lang }}: {{ .Title }}</a> + </li> + {{ end }} + </ul> + {{ end }} + + {{ partial "related" . }} +</article> + + +<script>document.write('<h4 class="text-3xl mt-2 mb-4 text-red-500 font-bold">Comments</h4>');</script> +<script type="text/javascript" src="/comments"></script> + + +{{ end }} diff --git a/generators/hugo/themes/edwin/layouts/_default/summary.html b/generators/hugo/themes/edwin/layouts/_default/summary.html new file mode 100644 index 0000000..e00e027 --- /dev/null +++ b/generators/hugo/themes/edwin/layouts/_default/summary.html @@ -0,0 +1,19 @@ +<article class="max-w-md rounded overflow-hidden shadow-lg px-6 py-4 mb-4 bg-white"> + + <p class="mb-1"> + <a class="text-blue-600 no-underline font-bold text-xl" href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a> + </p> + + <p class="text-gray-700 font-bold"> + {{ partial "post-date" . }} + </p> + + <p class="text-blue-900 text-base leading-normal my-3"> + {{ if gt (len .Summary) 200 }} + {{slicestr .Summary 0 200 | markdownify }}... + {{ end }} + </p> + + <a class="text-blue-600 no-underline" href="{{ .RelPermalink }}">{{ i18n "readMore" }}</a> + +</article> diff --git a/generators/hugo/themes/edwin/layouts/index.xml b/generators/hugo/themes/edwin/layouts/index.xml new file mode 100644 index 0000000..bcf8941 --- /dev/null +++ b/generators/hugo/themes/edwin/layouts/index.xml @@ -0,0 +1,27 @@ + +<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 -- gohugo.io</generator>{{ with .Site.LanguageCode }} + <language>{{.}}</language>{{end}}{{ with .Site.Author.email }} + <managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }} + <webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{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" }} + {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} + {{ end }} + {{ range .Pages }} + <item> + <title>{{ .Title }}</title> + <link>{{ .Permalink }}</link> + <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> + {{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}} + <guid>{{ .Permalink }}</guid> + <description>{{ .Content | html }}</description> + </item> + {{ end }} + </channel> +</rss> diff --git a/generators/hugo/themes/edwin/layouts/partials/brand.html b/generators/hugo/themes/edwin/layouts/partials/brand.html new file mode 100644 index 0000000..d6eb5c6 --- /dev/null +++ b/generators/hugo/themes/edwin/layouts/partials/brand.html @@ -0,0 +1 @@ +{{ .Site.Title }}
\ No newline at end of file diff --git a/generators/hugo/themes/edwin/layouts/partials/footer.html b/generators/hugo/themes/edwin/layouts/partials/footer.html new file mode 100644 index 0000000..2126899 --- /dev/null +++ b/generators/hugo/themes/edwin/layouts/partials/footer.html @@ -0,0 +1 @@ +{{ safeHTML "<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/views/partials/footer.php'; ?>" }} diff --git a/generators/hugo/themes/edwin/layouts/partials/head-custom.html b/generators/hugo/themes/edwin/layouts/partials/head-custom.html new file mode 100644 index 0000000..c1ea866 --- /dev/null +++ b/generators/hugo/themes/edwin/layouts/partials/head-custom.html @@ -0,0 +1 @@ +<!-- Create <project-root>/layouts/partials/head-custom.html to overwrite this empty template and put custom code into the <head> section. -->
\ No newline at end of file diff --git a/generators/hugo/themes/edwin/layouts/partials/head-meta.html b/generators/hugo/themes/edwin/layouts/partials/head-meta.html new file mode 100644 index 0000000..0f4705e --- /dev/null +++ b/generators/hugo/themes/edwin/layouts/partials/head-meta.html @@ -0,0 +1,2 @@ +<meta charset="utf-8"> +<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> diff --git a/generators/hugo/themes/edwin/layouts/partials/header.html b/generators/hugo/themes/edwin/layouts/partials/header.html new file mode 100644 index 0000000..8e8a798 --- /dev/null +++ b/generators/hugo/themes/edwin/layouts/partials/header.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<html lang="en-us"> + + <head> + + <meta name="description" content="{{ partial "title.html" . -}}"> + <meta name="keywords" content="{{ partial "title.html" . -}}"> + + <title>{{- block "title" . }}{{ partial "title.html" . -}}{{- end }}</title> + + {{ safeHTML "<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/views/partials/header.php'; ?>" }} diff --git a/generators/hugo/themes/edwin/layouts/partials/navigator.html b/generators/hugo/themes/edwin/layouts/partials/navigator.html new file mode 100644 index 0000000..dfb8d4c --- /dev/null +++ b/generators/hugo/themes/edwin/layouts/partials/navigator.html @@ -0,0 +1 @@ +{{ safeHTML "<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/views/partials/navigator.php'; ?>" }} diff --git a/generators/hugo/themes/edwin/layouts/partials/paginator.html b/generators/hugo/themes/edwin/layouts/partials/paginator.html new file mode 100644 index 0000000..7f1ca0d --- /dev/null +++ b/generators/hugo/themes/edwin/layouts/partials/paginator.html @@ -0,0 +1,45 @@ +{{ $pag := $.Paginator }} +{{ if gt $pag.TotalPages 1 }} +<nav class="blog-pagination"> + <ul class="pagination justify-content-center"> + {{ with $pag.First }} + <li class="page-item"> + <a class="page-link" href="{{ .URL }}" aria-label="First"><span aria-hidden="true">««</span></a> + </li> + {{ end }} + <li class="page-item {{ if not $pag.HasPrev }}disabled{{ end }}"> + <a class="page-link" href="{{ if $pag.HasPrev }}{{ $pag.Prev.URL }}{{ end }}" aria-label="Previous"><span aria-hidden="true">«</span></a> + </li> + {{ $.Scratch.Set "__paginator.ellipsed" false }} + {{ range $pag.Pagers }} + {{ $right := sub .TotalPages .PageNumber }} + {{ $showNumber := or (le .PageNumber 3) (eq $right 0) }} + {{ $showNumber := or $showNumber (and (gt .PageNumber (sub $pag.PageNumber 2)) (lt .PageNumber (add $pag.PageNumber 2))) }} + {{ if $showNumber }} + {{ $.Scratch.Set "__paginator.ellipsed" false }} + {{ $.Scratch.Set "__paginator.shouldEllipse" false }} + {{ else }} + {{ $.Scratch.Set "__paginator.shouldEllipse" (not ($.Scratch.Get "__paginator.ellipsed") ) }} + {{ $.Scratch.Set "__paginator.ellipsed" true }} + {{ end }} + {{ if $showNumber }} + <li class="page-item {{ if eq . $pag }}active{{ end }}"> + <a class="page-link" href="{{ .URL }}">{{ .PageNumber }}</a> + </li> + {{ else if ($.Scratch.Get "__paginator.shouldEllipse") }} + <li class="page-item disabled"> + <span class="page-link" aria-hidden="true">…</span> + </li> + {{ end }} + {{ end }} + <li class="page-item {{ if not $pag.HasNext }}disabled{{ end }}"> + <a class="page-link" href="{{ if $pag.HasNext }}{{ $pag.Next.URL }}{{ end }}" aria-label="Next"><span aria-hidden="true">»</span></a> + </li> + {{ with $pag.Last }} + <li class="page-item"> + <a class="page-link" href="{{ .URL }}" aria-label="Last"><span aria-hidden="true">»»</span></a> + </li> + {{ end }} + </ul> +</nav> +{{ end }}
\ No newline at end of file diff --git a/generators/hugo/themes/edwin/layouts/partials/post-categories.html b/generators/hugo/themes/edwin/layouts/partials/post-categories.html new file mode 100644 index 0000000..f52c1f5 --- /dev/null +++ b/generators/hugo/themes/edwin/layouts/partials/post-categories.html @@ -0,0 +1,9 @@ +{{ if .Params.categories }} + + <strong>{{ i18n "categories" }}:</strong> + {{ range .Params.categories }} + + <a class="rounded-full bg-indigo px-2 py-1 text-xs font-bold text-white no-underline" + href="{{ "/categories/" | relLangURL }}{{ . | urlize }}/">{{ . }}</a> + {{ end }} +{{ end }} diff --git a/generators/hugo/themes/edwin/layouts/partials/post-date.html b/generators/hugo/themes/edwin/layouts/partials/post-date.html new file mode 100644 index 0000000..31a8198 --- /dev/null +++ b/generators/hugo/themes/edwin/layouts/partials/post-date.html @@ -0,0 +1,14 @@ +{{ $dateFormat := default "Jan 2, 2006" (index .Site.Params "date_format") }} +{{ $author := .Params.author | default .Site.Params.author }} + + +{{ if not .Date.IsZero }} + {{ .Date.Format $dateFormat }} +{{ end }} + +<!-- +{{ if $author }} + {{ i18n "by" }} <span class="font-bold" rel="author">{{ $author }}</span> +{{ end }} +--> + diff --git a/generators/hugo/themes/edwin/layouts/partials/post-tags.html b/generators/hugo/themes/edwin/layouts/partials/post-tags.html new file mode 100644 index 0000000..b1f445d --- /dev/null +++ b/generators/hugo/themes/edwin/layouts/partials/post-tags.html @@ -0,0 +1,9 @@ +{{ if .Params.tags }} + + {{ range .Params.tags }} + + <a class="rounded bg-red-500 px-2 py-1 text-xs font-bold text-white no-underline" + href="{{ "/tags/" | relLangURL }}{{ . | urlize }}/">{{ . }}</a> + + {{ end }} +{{ end }} diff --git a/generators/hugo/themes/edwin/layouts/partials/recent.html b/generators/hugo/themes/edwin/layouts/partials/recent.html new file mode 100644 index 0000000..a6240be --- /dev/null +++ b/generators/hugo/themes/edwin/layouts/partials/recent.html @@ -0,0 +1,14 @@ +{{ $num_recent_posts := default 5 .Site.Params.sidebar.num_recent_posts }} +{{ $posts := first $num_recent_posts (where .Site.Pages "Section" "in" .Site.Params.mainSections) }} +{{ if gt (len $posts) 0 }} +<section> + <h4>{{ i18n "recentPosts" }}</h4> + <ol class="list-unstyled blog__recents"> + {{ range first 2 $posts }} + <li> + <a href="{{.RelPermalink}}">{{.Title | markdownify }}</a> + </li> + {{ end }} + </ol> +</section> +{{ end }}
\ No newline at end of file diff --git a/generators/hugo/themes/edwin/layouts/partials/related.html b/generators/hugo/themes/edwin/layouts/partials/related.html new file mode 100644 index 0000000..33f4973 --- /dev/null +++ b/generators/hugo/themes/edwin/layouts/partials/related.html @@ -0,0 +1,9 @@ +{{ $related := .Site.RegularPages.Related . | first 5 }} +{{ with $related }} + <h3 class="text-gray-800 mt-6 mb-1 text-lg font-bold">{{ i18n "related" }}</h3> + <ul class="list-reset mb-6"> + {{ range . }} + <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li> + {{ end }} + </ul> +{{ end }} diff --git a/generators/hugo/themes/edwin/layouts/partials/sidebar.html b/generators/hugo/themes/edwin/layouts/partials/sidebar.html new file mode 100644 index 0000000..6d182f8 --- /dev/null +++ b/generators/hugo/themes/edwin/layouts/partials/sidebar.html @@ -0,0 +1,8 @@ +<aside class=""> + {{ if default true .Site.Params.sidebar.showRecent }} + {{ partial "recent" . }} + {{ end }} + {{ if default true .Site.Params.sidebar.showTaxonomy }} + {{ partial "taxonomies" . }} + {{ end }} +</aside> diff --git a/generators/hugo/themes/edwin/layouts/partials/taxonomies.html b/generators/hugo/themes/edwin/layouts/partials/taxonomies.html new file mode 100644 index 0000000..778611b --- /dev/null +++ b/generators/hugo/themes/edwin/layouts/partials/taxonomies.html @@ -0,0 +1,12 @@ +<section> + {{ range $taxonomyname, $taxonomy := .Site.Taxonomies }} + {{ if gt (len $taxonomy) 0 }} + <h4>{{ i18n $taxonomyname }}</h4> + <p> + {{ range $name, $value := $taxonomy }} + <a class="badge badge-primary" href="{{ printf "/%s/" $taxonomyname | relLangURL }}{{ $name | urlize }}/">{{ $name }}</a> + {{ end }} + </p> + {{ end }} + {{ end }} +</section> diff --git a/generators/hugo/themes/edwin/layouts/partials/title.html b/generators/hugo/themes/edwin/layouts/partials/title.html new file mode 100644 index 0000000..f7ad714 --- /dev/null +++ b/generators/hugo/themes/edwin/layouts/partials/title.html @@ -0,0 +1,2 @@ +{{ with .Title }}{{ . }}{{ end }} + diff --git a/generators/hugo/themes/edwin/layouts/shortcodes/quote.html b/generators/hugo/themes/edwin/layouts/shortcodes/quote.html new file mode 100644 index 0000000..30a2d53 --- /dev/null +++ b/generators/hugo/themes/edwin/layouts/shortcodes/quote.html @@ -0,0 +1,4 @@ + +<p class= "text-xl leading-normal px-6 mb-2 italic font-serif text-gray-700"> + {{ .Inner }} +</p> |