diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 97b1f76..bfd7e42 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -7,9 +7,5 @@ {{ block "content" . -}}{{- end }} {{ block "footer" . -}}{{- end }} - {{ if and (not .Site.BuildDrafts) (.Site.GoogleAnalytics) -}} - {{ "" | safeHTML }} - {{ template "_internal/google_analytics_async.html" . }} - {{- end }} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index bee73c6..89ebb3a 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -3,8 +3,9 @@ {{- end -}} {{ define "content" -}} - {{ partial "content_list.html" . }} + {{ partial "page_list.html" . }} {{- end -}} {{ define "footer" -}} + {{ partial "footer.html" . }} {{- end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 2879afb..68a8bcf 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -3,12 +3,13 @@ {{- end -}} {{ define "content" -}} - {{ partial "content_single.html" . }} + {{ partial "page_single.html" . }} {{- end -}} {{ define "footer" -}} + {{ partial "footer.html" . }} {{- end -}} diff --git a/layouts/index.html b/layouts/index.html index ec8f7fb..55ff567 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -7,12 +7,14 @@ {{ range (where .Data.Pages "Type" "not in" (slice "about" "portfolio")).GroupBy "Section" -}} {{ range .Pages }}
-

{{ .Title }}{{ if .Draft }} {{ end }}

- - {{- .Date.Format (.Site.Params.dateformat | default "Jan 02, 2006") -}} + + {{ .Title }}{{ if .Draft }} {{ end }} - {{ .Summary }} - {{- if .Truncated }} + + {{ .Date.Format (.Site.Params.dateformat | default "Jan 02, 2006") }} + + {{ .Summary }} + {{ if .Truncated -}} diff --git a/layouts/partials/content_list.html b/layouts/partials/content_list.html deleted file mode 100644 index 0af76b2..0000000 --- a/layouts/partials/content_list.html +++ /dev/null @@ -1,15 +0,0 @@ -

{{ .Title }}

- diff --git a/layouts/partials/content_single.html b/layouts/partials/content_single.html deleted file mode 100644 index 53905f8..0000000 --- a/layouts/partials/content_single.html +++ /dev/null @@ -1,39 +0,0 @@ -
-

{{ .Title }}

- {{ if ne .Params.showpagemeta false }} -
- -
- {{ end }} - {{ .Content }} -
\ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..c462a3e --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,4 @@ +{{ if and (not .Site.BuildDrafts) (.Site.GoogleAnalytics) -}} +{{ "" | safeHTML }} +{{ template "_internal/google_analytics_async.html" . }} +{{- end }} \ No newline at end of file diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 4321fce..3dd1efb 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,35 +1,14 @@ - - - {{ "" | safeHTML }} - - {{ with .Site.Params.meta.description -}}{{- end }} - {{ with .Site.Params.meta.keywords -}}{{- end }} - {{ .Hugo.Generator }} - {{ if .IsHome -}} - {{ .Site.Title }} - {{- else }} - {{ .Title }} · {{ .Site.Title }} - {{- end }} - - - {{ "" | safeHTML }} - - - - + {{ partial "header/meta.html" . }} + {{ "" | safeHTML }} + {{ partial "header/fonts.html" . }} {{ "" | safeHTML }} - - {{ if .Site.Params.highlightjs -}} - {{ "" | safeHTML }} - - {{- end }} - {{ if .Site.Params.PygmentsUseClasses -}} - {{ "" | safeHTML }} - - {{- end }} - {{- "" | safeHTML }} + {{ partial "header/font-awesome.html" . }} + {{ "" | safeHTML }} + {{ partial "header/highlight-css.html" . }} + + {{ ` " | safeHTML }} - {{ if .RSSLink -}} - {{ "" | safeHTML }} - - - {{- end }} + {{- if .RSSLink -}} + {{ partial "header/feeds.html" . }} + {{- end -}} \ No newline at end of file diff --git a/layouts/partials/header/feeds.html b/layouts/partials/header/feeds.html new file mode 100644 index 0000000..c3145c3 --- /dev/null +++ b/layouts/partials/header/feeds.html @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/layouts/partials/header/font-awesome.html b/layouts/partials/header/font-awesome.html new file mode 100644 index 0000000..4832df1 --- /dev/null +++ b/layouts/partials/header/font-awesome.html @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/layouts/partials/header/fonts.html b/layouts/partials/header/fonts.html new file mode 100644 index 0000000..cc5f857 --- /dev/null +++ b/layouts/partials/header/fonts.html @@ -0,0 +1,2 @@ + + diff --git a/layouts/partials/header/highlight-css.html b/layouts/partials/header/highlight-css.html new file mode 100644 index 0000000..9c96568 --- /dev/null +++ b/layouts/partials/header/highlight-css.html @@ -0,0 +1,7 @@ +{{- if .Site.Params.highlightjs -}} + +{{- end -}} +{{ if .Site.Params.PygmentsUseClasses -}} + + +{{- end }} \ No newline at end of file diff --git a/layouts/partials/header/meta.html b/layouts/partials/header/meta.html new file mode 100644 index 0000000..0eb31fa --- /dev/null +++ b/layouts/partials/header/meta.html @@ -0,0 +1,8 @@ + + + +{{ "" | safeHTML }} + +{{ .Hugo.Generator }} +{{ partial "header/twitter_cards.html" . }} +{{ partial "header/opengraph.html" . }} \ No newline at end of file diff --git a/layouts/partials/header/meta.old.html b/layouts/partials/header/meta.old.html new file mode 100644 index 0000000..18020a0 --- /dev/null +++ b/layouts/partials/header/meta.old.html @@ -0,0 +1,32 @@ + + + + + +{{ .Hugo.Generator }} +{{- if .IsHome }} + {{ $.Scratch.Set "theTitle" .Site.Title -}} +{{else}} + {{ $.Scratch.Add "theTitle" .Title}} + {{ $.Scratch.Add "theTitle" "·"}} + {{ $.Scratch.Add "theTitle" .Site.Title}} +{{- end -}} +{{ $.Scratch.Get "theTitle" }} +{{ with .Site.Params.meta.description -}}{{- end }} +{{ with .Site.Params.meta.keywords -}}{{- end }} + + + + + + + + + + + + + + + +{{ $.Scratch.Delete "theTitle" -}} \ No newline at end of file diff --git a/layouts/partials/header/opengraph.html b/layouts/partials/header/opengraph.html new file mode 100644 index 0000000..e59b893 --- /dev/null +++ b/layouts/partials/header/opengraph.html @@ -0,0 +1,62 @@ + + + + +{{ with .Params.images -}} + {{- range first 6 . -}} + + {{- end -}} +{{- end -}} +{{- if .IsPage -}} + {{ if not .PublishDate.IsZero -}} + + {{- else if not .Date.IsZero -}} + + {{- end }} + {{- if not .Lastmod.IsZero -}} + + {{- end }} +{{- else -}} + {{ if not .Date.IsZero -}} + + {{- end }} +{{- end -}} +{{ with .Params.audio -}}{{- end }} +{{ with .Params.locale -}}{{- end }} +{{ with .Site.Params.title -}}{{- end }} +{{ with .Params.videos -}} + {{- range . -}} + + {{- end -}} +{{- end }} + +{{- $permalink := .Permalink -}} +{{- $siteSeries := .Site.Taxonomies.series -}} +{{- with .Params.series -}} + {{- range $name := . -}} + {{- $series := index $siteSeries $name -}} + {{- range $page := first 6 $series.Pages -}} + {{ if ne $page.Permalink $permalink -}} + + {{- end }} + {{- end -}} + {{- end -}} +{{- end -}} +{{- if .IsPage -}} + {{- range .Site.Authors -}} + {{ with .Social.facebook -}} + + {{- end }} + {{ with .Site.Social.facebook -}} + + {{- end }} + + {{ with .Params.tags -}} + {{- range first 6 . -}} + + {{- end -}} + {{- end }} + {{- end -}} +{{- end -}} + +{{ with .Site.Social.facebook_admin -}}{{- end }} \ No newline at end of file diff --git a/layouts/partials/header/twitter_cards.html b/layouts/partials/header/twitter_cards.html new file mode 100644 index 0000000..fc4895b --- /dev/null +++ b/layouts/partials/header/twitter_cards.html @@ -0,0 +1,29 @@ +{{- with $.Params.images -}} + + +{{ else -}} +{{- $images := $.Resources.ByType "image" -}} +{{- $featured := $images.GetMatch "*feature*" -}} +{{- $featured := cond (ne $featured nil) $featured ($images.GetMatch "{*cover*,*thumbnail*}") -}} +{{- with $featured -}} + + +{{- else -}} +{{- with $.Site.Params.images -}} + + +{{ else -}} + +{{- end -}} +{{- end -}} +{{- end }} + + +{{ with .Site.Social.twitter -}} + +{{ end -}} +{{ range .Site.Authors }} +{{ with .twitter -}} + +{{ end -}} +{{ end -}} \ No newline at end of file diff --git a/layouts/partials/highlight.html b/layouts/partials/highlight-js.html similarity index 100% rename from layouts/partials/highlight.html rename to layouts/partials/highlight-js.html diff --git a/layouts/partials/page_list.html b/layouts/partials/page_list.html new file mode 100644 index 0000000..4d7d105 --- /dev/null +++ b/layouts/partials/page_list.html @@ -0,0 +1,6 @@ +

{{ .Title }}

+ diff --git a/layouts/partials/page_single.html b/layouts/partials/page_single.html new file mode 100644 index 0000000..ba99f9f --- /dev/null +++ b/layouts/partials/page_single.html @@ -0,0 +1,16 @@ +
+
+

{{ .Title }}

+ {{ with .Params.subtitle }} + + {{.}} + + {{ end }} + {{ partial "post-meta-before.html" . }} +
+
+ {{ .Content }} +
+ {{ partial "post-meta-after.html" . }} + {{ partial "post-related.html" . }} +
diff --git a/layouts/partials/portfolio/content.html b/layouts/partials/portfolio/content.html new file mode 100644 index 0000000..76d1102 --- /dev/null +++ b/layouts/partials/portfolio/content.html @@ -0,0 +1,54 @@ +
+

{{ .Title }}

+ {{ range where .Data.Pages "Params.featured" "==" "true" }} +
+
+
+ +
+
+
+ {{ end }} +
+
+
+
+ {{ range (where .Data.Pages "Params.featured" "<>" "true").ByDate.Reverse }} + +
+ + {{ .Title }} + +
+

+ {{ .Title }} +

+

{{ .Params.description }}

+

{{ .Content }}

+
+
+ + {{ end }} +
+ +
+ +
+
diff --git a/layouts/partials/portfolio/header.html b/layouts/partials/portfolio/header.html new file mode 100644 index 0000000..764738c --- /dev/null +++ b/layouts/partials/portfolio/header.html @@ -0,0 +1,49 @@ + + + + + {{ "" | safeHTML }} + + {{ with .Site.Params.meta.description -}}{{- end }} + {{ with .Site.Params.meta.keywords -}}{{- end }} + {{ .Hugo.Generator }} + {{ if .IsHome -}} + {{ .Site.Title }} + {{- else }} + {{ .Title }} · {{ .Site.Title }} + {{- end }} + + + {{ "" | safeHTML }} + + + + + + {{ "" | safeHTML }} + + {{ if .Site.Params.highlightjs -}} + {{ "" | safeHTML }} + + {{- end }} + {{ if .Site.Params.PygmentsUseClasses -}} + {{ "" | safeHTML }} + + {{- end }} + {{- "" | safeHTML }} + + + {{ ` + ` | safeHTML }} + {{ "" | safeHTML }} + + + {{ if .RSSLink -}} + {{ "" | safeHTML }} + + + {{- end }} + \ No newline at end of file diff --git a/layouts/partials/post-meta-after.html b/layouts/partials/post-meta-after.html new file mode 100644 index 0000000..882b75a --- /dev/null +++ b/layouts/partials/post-meta-after.html @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/layouts/partials/post-meta-before.html b/layouts/partials/post-meta-before.html new file mode 100644 index 0000000..c3edd80 --- /dev/null +++ b/layouts/partials/post-meta-before.html @@ -0,0 +1,36 @@ +{{ if ne .Params.showpagemeta false }} +
+ + + {{ if not .Date.IsZero }} + {{ .Date.Format (.Site.Params.dateformat | default "Jan 02, 2006") -}} + {{ end }} + + {{ with .Params.categories }} + {{ $total := len . }} + {{ if gt $total 0 }} + in + {{ $total := sub $total 1 }} + {{ range $i, $cat := sort . }} + {{ $cat | upper }} + {{ if lt $i $total }},{{ end }} + {{ end }} + {{ end }} + {{ end }} + + {{ with .Params.tags }} + {{ $total := len . }} + {{ if gt $total 0 }} +
+ {{ $subtotal := sub $total 1 }} + {{ range $i, $tag := sort . }} + #{{ $tag | lower }} + {{ if lt $i $subtotal }} {{ end }} + {{ end }} + {{ end }} + {{ end }} +
+ {{ .ReadingTime }} min read +
+
+{{ end }} \ No newline at end of file diff --git a/layouts/partials/post-related.html b/layouts/partials/post-related.html new file mode 100644 index 0000000..2657757 --- /dev/null +++ b/layouts/partials/post-related.html @@ -0,0 +1,11 @@ +
+ + {{ $related := .Site.RegularPages.Related . | first 5 }} + {{ with $related }} +
+

Related Articles

+ + {{ end }} +
\ No newline at end of file diff --git a/layouts/partials/posts-list.html b/layouts/partials/posts-list.html new file mode 100644 index 0000000..f6b9004 --- /dev/null +++ b/layouts/partials/posts-list.html @@ -0,0 +1,10 @@ +{{ range . }} +
  • + + {{ .Title }} + {{if not .Date.IsZero}} + + {{end}} + +
  • +{{ end }} \ No newline at end of file diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index e7f4ba1..1106e96 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -1,9 +1,12 @@ -{{ "" | safeHTML }} +