Rohan Sircar
5 years ago
5 changed files with 1 additions and 227 deletions
-
2config.toml
-
117layouts/_default/list.html
-
72layouts/_default/single.html
-
16layouts/_default/taxonomy.html
-
21layouts/_default/terms.html
@ -1,117 +0,0 @@ |
|||||
{{ define "main_content" }} |
|
||||
<main id="post-list" class="cell{{ if not (or .Site.Params.sidebar.disable .Params.sidebar.disable) }} medium-8{{ end }}"> |
|
||||
{{ if or (not .IsHome) (ne .Title .Site.Title) }} |
|
||||
<header id="page-header"> |
|
||||
<h1 id="page-title">{{ .Title }}</h1> |
|
||||
</header> |
|
||||
{{ end }} |
|
||||
{{ with .Params.alert }} |
|
||||
<div class="callout"> |
|
||||
{{ . | markdownify }} |
|
||||
</div> |
|
||||
{{ end }} |
|
||||
{{ partial "content.html" $ }} |
|
||||
{{ if and (not .Params.hide_list) (gt .WordCount 0) }} |
|
||||
<hr/> |
|
||||
{{ end }} |
|
||||
|
|
||||
{{ if not .Params.hide_list }} |
|
||||
{{/* If showing nested sections, show those first */}} |
|
||||
{{ if .Params.list_subsections }} |
|
||||
{{ $section := trim .URL "/" }} |
|
||||
{{ range (.Site.GetPage (add "/" $section)).Sections }} |
|
||||
{{ partial "list_item.html" (dict "Page" . "Root" $) }} |
|
||||
{{ end }} |
|
||||
{{ end }} |
|
||||
|
|
||||
{{/* Show normal pages */}} |
|
||||
{{ $index_only := default false .Params.index_only }} |
|
||||
{{ $pages := .Pages }} |
|
||||
|
|
||||
{{ if .IsHome }} |
|
||||
{{ if $.Site.Params.home_section }} |
|
||||
{{ $pages = strings.TrimPrefix "/" $.Site.Params.home_section | where $.Pages "Section" }} |
|
||||
{{ if eq (len $pages) 0 }} |
|
||||
{{ errorf "Section \"%s\" is empty or does not exist" .Site.Params.home_section }} |
|
||||
{{ end }} |
|
||||
{{ else if ($.Site.GetPage "/news") }} |
|
||||
{{ $pages = where .Pages "Section" "news" }} |
|
||||
{{ else if ($.Site.GetPage "/posts") }} |
|
||||
{{ $pages = where .Pages "Section" "posts" }} |
|
||||
{{ else if ($.Site.GetPage "/post") }} |
|
||||
{{ $pages = where .Pages "Section" "post" }} |
|
||||
{{ end }} |
|
||||
{{ end }} |
|
||||
|
|
||||
{{ if or .Params.sort_field .Params.sort_order }} |
|
||||
{{ if in .Params.sort_field "Params." }} |
|
||||
{{ $pages = $pages.ByParam (replace .Params.sort_field "Params." "") }} |
|
||||
{{ else }} |
|
||||
{{/* This long if-chain is necessary because Paginate wants type Pages, not []*Page */}} |
|
||||
{{ $order := lower (default "" .Params.sort_order) }} |
|
||||
{{ $field := lower (default "" .Params.sort_field) }} |
|
||||
{{ if ne $field "" }} |
|
||||
{{ if eq $field "weight" }} |
|
||||
{{ if eq $order "desc" }} |
|
||||
{{ $pages = $pages.ByWeight.Reverse }} |
|
||||
{{ else }} |
|
||||
{{ $pages = $pages.ByWeight }} |
|
||||
{{ end }} |
|
||||
{{ else if eq $field "date" }} |
|
||||
{{ if eq $order "asc" }} |
|
||||
{{ $pages = $pages.ByDate.Reverse }} |
|
||||
{{ else }} |
|
||||
{{ $pages = $pages.ByDate }} |
|
||||
{{ end }} |
|
||||
{{ else if eq $field "publishdate" }} |
|
||||
{{ if eq $order "asc" }} |
|
||||
{{ $pages = $pages.ByPublishDate.Reverse }} |
|
||||
{{ else }} |
|
||||
{{ $pages = $pages.ByPublishDate }} |
|
||||
{{ end }} |
|
||||
{{ else if eq $field "expirydate" }} |
|
||||
{{ if eq $order "asc" }} |
|
||||
{{ $pages = $pages.ByExpiryDate.Reverse }} |
|
||||
{{ else }} |
|
||||
{{ $pages = $pages.ByExpiryDate }} |
|
||||
{{ end }} |
|
||||
{{ else if eq $field "lastmod" }} |
|
||||
{{ if eq $order "asc" }} |
|
||||
{{ $pages = $pages.ByLastmod.Reverse }} |
|
||||
{{ else }} |
|
||||
{{ $pages = $pages.ByLastmod }} |
|
||||
{{ end }} |
|
||||
{{ else if eq $field "length" }} |
|
||||
{{ if eq $order "desc" }} |
|
||||
{{ $pages = $pages.ByLength.Reverse }} |
|
||||
{{ else }} |
|
||||
{{ $pages = $pages.ByLength }} |
|
||||
{{ end }} |
|
||||
{{ else if eq $field "title" }} |
|
||||
{{ if eq $order "desc" }} |
|
||||
{{ $pages = $pages.ByTitle.Reverse }} |
|
||||
{{ else }} |
|
||||
{{ $pages = $pages.ByTitle }} |
|
||||
{{ end }} |
|
||||
{{ else if eq $field "linktitle" }} |
|
||||
{{ if eq $order "desc" }} |
|
||||
{{ $pages = $pages.ByLinkTitle.Reverse }} |
|
||||
{{ else }} |
|
||||
{{ $pages = $pages.ByLinkTitle }} |
|
||||
{{ end }} |
|
||||
{{ end }} |
|
||||
{{ end }} |
|
||||
{{ end }} |
|
||||
{{ end }} |
|
||||
|
|
||||
{{ $paginator := .Paginate $pages }} |
|
||||
{{ range $paginator.Pages }} |
|
||||
{{ if or (not $index_only) (in .File.Path "index.md") }} |
|
||||
{{ partial "list_item.html" (dict "Page" . "Root" $) }} |
|
||||
{{ end }} |
|
||||
{{ end }} |
|
||||
|
|
||||
{{ partial "pagination.html" (dict "Paginator" $paginator "Root" $) }} |
|
||||
{{ end }} |
|
||||
</main> |
|
||||
{{ end }} |
|
@ -1,72 +0,0 @@ |
|||||
{{ define "main_content" }} |
|
||||
<main class="cell{{ if not (or .Site.Params.sidebar.disable .Params.sidebar.disable) }} medium-8{{ end }}" {{ if eq .Section "posts" }}itemscope itemtype="http://schema.org/Blog"{{ end }}> |
|
||||
<article id="post-article" {{ if eq .Section "posts" }}itemprop="blogPost" itemscope itemtype="http://schema.org/BlogPosting"{{ else }}itemscope itemtype="http://schema.org/Article"{{ end }}{{ if .Params.tags }} itemref="keywords desc"{{ else }} itemref="desc"{{ end }}> |
|
||||
<header id="page-header"> |
|
||||
<h1 itemprop="headline">{{ .Title }}</h1> |
|
||||
{{- if or (or (not .Lastmod.IsZero) (not .Date.IsZero)) .Params.categories -}} |
|
||||
<p id="post-metadata" class="grid-x grid-padding-x"> |
|
||||
{{- if not .Date.IsZero -}} |
|
||||
<span class="cell shrink"> |
|
||||
<span class="far fa-clock fa-sm fa-fw" aria-hidden></span> |
|
||||
<strong>{{ i18n "publishedLabel" | title }}:</strong> |
|
||||
<time datetime="{{ .Date.Format "2006-01-02" }}" content="{{ .Date.Format "2006-01-02" }}" itemprop="datePublished">{{ .Date.Format "January 02, 2006" }}</time> |
|
||||
</span> |
|
||||
{{- end -}} |
|
||||
{{- if and (not .Lastmod.IsZero) (ne .Lastmod .Date) -}} |
|
||||
<span class="cell shrink"> |
|
||||
<span class="far fa-clock fa-sm fa-fw" aria-hidden></span> |
|
||||
<strong>{{ (i18n "lastUpdatedLabel") | title }}:</strong> |
|
||||
<time datetime="{{ .Lastmod.Format "2006-01-02" }}" content="{{ .Lastmod.Format "2006-01-02" }}" itemprop="dateModified">{{ .Lastmod.Format "January 02, 2006" }}</time> |
|
||||
</span> |
|
||||
{{- end -}} |
|
||||
{{- if .Params.categories -}} |
|
||||
<span class="cell shrink"> |
|
||||
<span class="fas fa-folder fa-sm fa-fw" aria-hidden></span> |
|
||||
<span class="sr-text">{{ i18n "categoryLabel" (len .Params.categories) | title }}: </span> |
|
||||
{{ range $index, $category := .Params.categories }}{{ if gt $index 0 }}, {{ end -}} |
|
||||
{{ $url :=$category | urlize | lower | printf "categories/%s" }} |
|
||||
<a href="{{ partial "make_link" (dict "URL" $url "Root" $) }}" rel="category">{{ . | humanize | title }}</a>{{ end }} |
|
||||
</span> |
|
||||
{{- end -}} |
|
||||
{{- if not .Params.hide_readingtime -}} |
|
||||
<span class="cell shrink"> |
|
||||
<span class="fas fa-book fa-sm fa-fw" aria-hidden></span> |
|
||||
<strong>{{ i18n "estimatedTimeLabel" | title }}:</strong> |
|
||||
~<span itemprop="timeRequired">{{ i18n "estimatedTime" .ReadingTime }}</span> |
|
||||
</span> |
|
||||
{{- end -}} |
|
||||
{{- with .Params.tags -}} |
|
||||
<span class="cell shrink"> |
|
||||
<span class="fas fa-tag{{ if gt (len .) 1 }}s{{ end }} fa-sm fa-fw" aria-hidden></span> |
|
||||
{{- range . }} |
|
||||
{{ $link := printf "/tags/%s" (urlize .) }} |
|
||||
{{ $link := lower $link }} |
|
||||
<a itemprop="relatedUrl" itemscope itemtype="http://schema.org/URL" href="{{ partial "make_link" (dict "URL" $link "Root" $) }}" rel="tag" itemprop="url">{{ . | humanize | lower }}</a> |
|
||||
{{ end -}} |
|
||||
</span> |
|
||||
{{- end -}} |
|
||||
</p> |
|
||||
{{ end }} |
|
||||
</header> |
|
||||
{{ with .Params.alert -}} |
|
||||
<div class="callout"> |
|
||||
{{ . | markdownify }} |
|
||||
</div> |
|
||||
{{- end }} |
|
||||
<div id="post-content"> |
|
||||
{{- if .Params.thumbnail -}} |
|
||||
<figure class="thumbnail"> |
|
||||
<img src="{{ partial "make_link" (dict "URL" .Params.thumbnail "Root" $) }}" alt="{{ .Title }}"> |
|
||||
</figure> |
|
||||
{{- end -}} |
|
||||
{{- partial "toc.html" $ -}} |
|
||||
<span itemprop="articleBody">{{ partial "content.html" $ }}</span> |
|
||||
</div> |
|
||||
{{- partial "pages/authorbox.html" . -}} |
|
||||
</article> |
|
||||
|
|
||||
{{ partial "next_prev_post.html" . }} |
|
||||
|
|
||||
{{ partial "pages/comments.html" . }} |
|
||||
</main> |
|
||||
{{ end }} |
|
@ -1,16 +0,0 @@ |
|||||
{{ define "main_content" }} |
|
||||
<main id="post-list" class="cell{{ if not (or .Site.Params.sidebar.disable .Params.sidebar.disable) }} medium-8{{ end }}"> |
|
||||
{{- if not .IsHome -}} |
|
||||
<header id="page-header"> |
|
||||
<h1 id="page-title">{{ .Data.Singular | title }}: {{ .Title }}</h1> |
|
||||
</header> |
|
||||
{{- end -}} |
|
||||
{{ partial "content.html" $ }} |
|
||||
{{- if (or (not (isset .Params "hide_list")) (not .Params.hide_list)) -}} |
|
||||
{{- range .Paginator.Pages -}} |
|
||||
{{ partial "list_item.html" (dict "Page" . "Root" $) }} |
|
||||
{{- end -}} |
|
||||
{{ partial "pagination.html" (dict "Paginator" .Paginator "Root" $) }} |
|
||||
{{- end -}} |
|
||||
</main> |
|
||||
{{- end -}} |
|
@ -1,21 +0,0 @@ |
|||||
{{ define "main_content" }} |
|
||||
<main class="cell{{ if not (or .Site.Params.sidebar.disable .Params.sidebar.disable) }} medium-8{{ end }}"> |
|
||||
<header id="page-header"> |
|
||||
<h1 id="page-title">{{ .Title }}</h1> |
|
||||
</header> |
|
||||
|
|
||||
{{ partial "content.html" $ }} |
|
||||
|
|
||||
<ul id="taxonomy-list" class="grid-x"> |
|
||||
{{- $data := .Data -}} |
|
||||
{{ range $key, $val := .Data.Terms.Alphabetical }} |
|
||||
<div class="cell small-full medium-6 large-4"> |
|
||||
<li class="taxonomy-item"> |
|
||||
{{- $link := printf "/%s/%s" $data.Plural $val.Name -}} |
|
||||
<a href="{{ partial "make_link" (dict "URL" ($link | urlize) "Root" $) }}">{{ $val.Name }}</a> ({{ $val.Count }}) |
|
||||
</li> |
|
||||
</div> |
|
||||
{{ end }} |
|
||||
</ul> |
|
||||
</main> |
|
||||
{{- end -}} |
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue