diff options
author | Urja Acharya <urja.acharya@huskers.unl.edu> | 2020-05-23 23:44:46 +0300 |
---|---|---|
committer | Urja Acharya <urja.acharya@huskers.unl.edu> | 2020-05-23 23:44:46 +0300 |
commit | e85caeeda5220ab7a7595e9734419f8c1de56e86 (patch) | |
tree | c5088e58b76113dea19542054300cdfd42599184 /layouts |
Initial Commit
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/404.html | 3 | ||||
-rw-r--r-- | layouts/_default/baseof.html | 12 | ||||
-rw-r--r-- | layouts/_default/list.html | 6 | ||||
-rw-r--r-- | layouts/_default/single.html | 7 | ||||
-rw-r--r-- | layouts/_default/taxonomy.html | 6 | ||||
-rw-r--r-- | layouts/index.html | 41 | ||||
-rw-r--r-- | layouts/partials/footer.html | 53 | ||||
-rw-r--r-- | layouts/partials/head.html | 25 | ||||
-rw-r--r-- | layouts/partials/header.html | 37 | ||||
-rw-r--r-- | layouts/partials/homeIcon.html | 15 | ||||
-rw-r--r-- | layouts/partials/listPage.html | 12 | ||||
-rw-r--r-- | layouts/partials/taxa.html | 19 | ||||
-rw-r--r-- | layouts/section/archive.html | 10 | ||||
-rw-r--r-- | layouts/section/pinnedPosts.html | 9 | ||||
-rw-r--r-- | layouts/section/recent.html | 37 |
15 files changed, 292 insertions, 0 deletions
diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..ae3ad77 --- /dev/null +++ b/layouts/404.html @@ -0,0 +1,3 @@ +{{ define "main" }} +Not Found +{{ end }}
\ No newline at end of file diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..68fff46 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html lang="{{ .Site.LanguageCode }}"> + {{- partial "head.html" . -}} + <body> + {{- partial "header.html" . -}} + <main> + {{- block "main" . }} + {{- end }} + </main> + {{- partial "footer.html" . -}} + </body> +</html> diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..eb7c0cd --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,6 @@ +{{ define "main" }} +<h1>{{ .Title }}</h1> +{{ range (.Paginator 10).Pages }} +{{ partial "listPage" . }} +{{ end }} +{{ end }}
\ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..917c4f9 --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,7 @@ +{{ define "main" }} +<div class="front-matter"> + <h1>{{ .Title }}</h1> + <p>{{ dateFormat .Site.Params.theme.dateFormat .Date }} · {{ .Site.Params.author }}</p> +</div> +{{ .Content }} +{{ end }} diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html new file mode 100644 index 0000000..ea0c32f --- /dev/null +++ b/layouts/_default/taxonomy.html @@ -0,0 +1,6 @@ +{{ define "main" }} +<h1>#{{ .Title }}</h1> +{{ range (.Paginator 10).Pages.ByDate.Reverse }} +{{ partial "listPage" . }} +{{ end }} +{{ end }} diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..696613d --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,41 @@ +{{ define "main" }} +{{ range ((where .Site.Pages "Params.pinned" true).ByDate.Reverse) | first 1 }} +<h3> + <a href="{{ .Permalink }}" aria-label="site title">{{ .Title }}</a> +</h3> +<div class="pinned-post home-page-card"> + <p>{{ .Summary | plainify | truncate 250 }}</p> + <div class="home-page-card-links"> + <a href="{{ .Permalink }}" aria-label="click to read the pinned post"> + Read More + </a> + </div> + <div class="home-page-card-links"> + <a href="{{ `pinnedposts` | relURL }}">All Pinned</a> + </div> +</div> +{{ end }} + +<h3>Recent Posts</h3> +<div class="recent-posts home-page-card"> + {{ range ((where .Site.Pages "Kind" "page").ByDate.Reverse) | first 6 }} + {{ partial "listPage" . }} + {{ end }} + <div class="home-page-card-links"> + <a href="{{ `archive` | relURL }}" aria-label="link to all posts" + >All Posts</a + > + </div> +</div> + +<h3>Sections</h3> +<div class="site-sections home-page-card"> + {{ range .Site.Sections }} + {{ if not .Params.hideFromHome }} + <p> + <a href="{{ .Permalink }}" aria-label="site sections">{{ .Title }}</a> - {{ len .Pages}} Articles + </p> + {{ end }} {{ end }} +</div> +{{ partial "taxa" (dict "taxo" .Site.Taxonomies "mysite" .) }} +{{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..2b45773 --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,53 @@ +<footer> + {{ if eq .Kind "section" }} + <div> + {{ template "_internal/pagination.html" . }} + </div> + {{ end }} {{ if eq .Kind "page" }} + <div class="prev-next"> + {{- if .PrevInSection }} + <a + class="active" + href="{{ .PrevInSection.Permalink | relURL }}" + aria-label="Previous Article" + >Previous</a + > + {{- else }} + <div class="disabled">N/A</div> + {{- end }} + <a href="#" aria-label="to top">Top</a> + {{- if .NextInSection }} + <a + class="active" + href="{{ .NextInSection.Permalink | relURL }}" + aria-label="Next Article" + >Next</a + > + {{- else }} + <div class="disabled">N/A</div> + {{- end }} + </div> + {{ end }} + + <div class="footer"> + <p> + {{ if .Site.Params.theme.copyrightInFooter }} + © + {{end}} + {{ dateFormat "2006" now }} {{ .Site.Params.author }}. + {{ .Site.Params.theme.footerText | markdownify }}. + </p> + <p> + <a href="#"> + {{- print "redgood" -}} + </a> + by + <a + href="https://www.urjaacharya.com/" + aria-label="link to urja acharya site" + > + {{- print "urja" -}} + </a> + </p> + </div> +</footer> diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..de1d306 --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,25 @@ +<head> + <title> + {{ .Site.Title }} + {{ if and (not .IsHome) (.Title) }} + - {{ .Title }} + {{ end }} + </title> + <meta name="theme-color" content="" /> + <meta charset="utf-8" /> + <meta content="width=device-width, initial-scale=1.0" name="viewport" /> + <meta name="description" content="{{ .Site.Params.description }}" /> + <meta name="author" content="{{ .Site.Params.author }}" /> + + <link rel="stylesheet" href="{{ `/css/main.css` | relURL }}" /> + <link rel="stylesheet" href="{{ `/css/pagination.css` | relURL }}" /> + <link rel="stylesheet" href="{{ `/css/prevnext.css` | relURL }}" /> + <link + href="https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;600&display=swap" + rel="stylesheet" + /> + <link + href="https://fonts.googleapis.com/css2?family=Inconsolata&display=swap" + rel="stylesheet" + /> +</head> diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..7fa7621 --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,37 @@ +<header> + <div class="header-image-container"> + <div class="header-image"> + <img src="{{ .Site.Params.about.profileImage | relURL }}" alt="profile image of {{ .Site.Params.author }}"/> + </div> + </div> + <div class="header-info"> + {{ if not .IsHome }} + <a class="home-icon" href="{{ `/` | relURL }}" aria-label="home page"> + {{ partial "homeIcon" . }} + </a> + {{ else }} + <h1 class="site-title">{{- .Site.Title -}}</h1> + {{ end }} + + <p> + <span class="site-title home-{{ .IsHome }}"> + {{ if not .IsHome }} {{ .Site.Title }} {{ end }} + </span> + {{ .Site.Params.about.narrative | markdownify }} + </p> + + <div class="social-info"> + {{ range $key, $val := .Site.Params.social }} + <small> + <a + class="social-link" + href="{{ $val }}" + aria-label="social media links" + > + {{- $key -}} + </a> + </small> + {{ end }} + </div> + </div> +</header> diff --git a/layouts/partials/homeIcon.html b/layouts/partials/homeIcon.html new file mode 100644 index 0000000..e13affe --- /dev/null +++ b/layouts/partials/homeIcon.html @@ -0,0 +1,15 @@ +<svg + aria-hidden="true" + focusable="false" + data-prefix="fas" + data-icon="home" + class="svg-inline--fa fa-home fa-w-18" + role="img" + xmlns="http://www.w3.org/2000/svg" + viewBox="0 0 576 512" +> + <path + fill="currentColor" + d="M280.37 148.26L96 300.11V464a16 16 0 0 0 16 16l112.06-.29a16 16 0 0 0 15.92-16V368a16 16 0 0 1 16-16h64a16 16 0 0 1 16 16v95.64a16 16 0 0 0 16 16.05L464 480a16 16 0 0 0 16-16V300L295.67 148.26a12.19 12.19 0 0 0-15.3 0zM571.6 251.47L488 182.56V44.05a12 12 0 0 0-12-12h-56a12 12 0 0 0-12 12v72.61L318.47 43a48 48 0 0 0-61 0L4.34 251.47a12 12 0 0 0-1.6 16.9l25.5 31A12 12 0 0 0 45.15 301l235.22-193.74a12.19 12.19 0 0 1 15.3 0L530.9 301a12 12 0 0 0 16.9-1.6l25.5-31a12 12 0 0 0-1.7-16.93z" + ></path></svg +> diff --git a/layouts/partials/listPage.html b/layouts/partials/listPage.html new file mode 100644 index 0000000..5751345 --- /dev/null +++ b/layouts/partials/listPage.html @@ -0,0 +1,12 @@ +<div class="list-page-data"> + <time class="list-page-date"> + {{- dateFormat .Site.Params.theme.dateFormat .Date }} + </time> + <a + class="archive-table-link" + href="{{ .Permalink }}" + aria-label="{{ .Title }}" + > + {{ .Title }} + </a> +</div> diff --git a/layouts/partials/taxa.html b/layouts/partials/taxa.html new file mode 100644 index 0000000..719d362 --- /dev/null +++ b/layouts/partials/taxa.html @@ -0,0 +1,19 @@ +{{ $scratch := newScratch }} +{{ $scratch.Delete "custom" }} +{{ range $name, $value := .taxo }} +{{ $scratch.Add "custom" (slice (dict "Name" $name "Value" $value "Num" (len $value))) }} +{{ end }} + +{{ range sort ($scratch.Get "custom") ".Num" "desc" }} +{{ $taxaTypeName := .Name }} +<h3> + {{ $taxaTypeName | humanize }} +</h3> +{{ $this_taxa := index $.taxo .Name }} +<div class="taxa-container home-page-card"> + {{ range $this_taxa.ByCount }} + {{ $taxaValueName := .Page.Title }} + <a class="taxa" href="{{ .Page.Permalink }}" aria-label="site taxonomies">{{ .Page.Title }}</a> + {{ end }} +</div> +{{ end }} diff --git a/layouts/section/archive.html b/layouts/section/archive.html new file mode 100644 index 0000000..686e8bb --- /dev/null +++ b/layouts/section/archive.html @@ -0,0 +1,10 @@ +{{ define "main" }} +<h1>{{ .Title }}</h1> +{{$paginator := .Paginate (where .Site.Pages "Kind" "page").ByDate.Reverse 50 }} +<div class="archive-table"> + {{ range $paginator.Pages }} + {{ partial "listPage" . }} + {{ end }} +</div> + +{{ end }} diff --git a/layouts/section/pinnedPosts.html b/layouts/section/pinnedPosts.html new file mode 100644 index 0000000..df67ed7 --- /dev/null +++ b/layouts/section/pinnedPosts.html @@ -0,0 +1,9 @@ +{{ define "main" }} +<h1>{{ .Title }}</h1> +{{$paginator := .Paginate (where .Site.Pages "Params.pinned" true).ByDate.Reverse 5 }} +{{ range $paginator.Pages }} +<h3><a href="{{ .Permalink }}" aria-label="{{ .Title }}">{{ .Title }}</a></h3> +<time>{{ dateFormat .Site.Params.theme.dateFormat .Date }}</time> +<p>{{ .Summary | truncate 200 }}</p> +{{ end }} +{{ end }}
\ No newline at end of file diff --git a/layouts/section/recent.html b/layouts/section/recent.html new file mode 100644 index 0000000..3cd624e --- /dev/null +++ b/layouts/section/recent.html @@ -0,0 +1,37 @@ + + +<!DOCTYPE html> +<html lang="{{ .Site.LanguageCode }}"> + <head> + <title> + Recent Posts + </title> + <meta content="width=device-width, initial-scale=1.0" name="viewport" /> + <meta name="description" content="Recent Posts" /> + <meta name="author" content="{{ .Site.Params.author }}" /> + + <link rel="stylesheet" href="{{ `/css/main.css` | relURL }}" /> + <link rel="stylesheet" href="{{ `/css/pagination.css` | relURL }}" /> + <link + href="https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;600&display=swap" + rel="stylesheet" + /> + <link + href="https://fonts.googleapis.com/css2?family=Inconsolata&display=swap" + rel="stylesheet" + /> + </head> + <body> + {{$paginator := .Paginate (where .Site.Pages "Kind" "page").ByDate.Reverse 3 }} + <main> + {{ range $paginator.Pages }} + {{ partial "listPage" . }} + {{ end }} + <div> + {{ template "_internal/pagination.html" . }} + </div> + + </main> + + </body> +</html> |