Add breadcrumbs, let writeup urls make more sense and add section pages

alternate-navbar
Maik de Kruif 3 years ago
parent e92b7e02fe
commit d6544b95cf
Signed by: maik
GPG Key ID: 44A55AD1F0673FA6
  1. 7
      config.toml
  2. 5
      content/writeups/adventofctf/2020/_index.md
  3. 3
      content/writeups/adventofctf/2020/challenge_0.md
  4. 3
      content/writeups/adventofctf/2020/challenge_1.md
  5. 3
      content/writeups/adventofctf/2020/challenge_10.md
  6. 3
      content/writeups/adventofctf/2020/challenge_11.md
  7. 3
      content/writeups/adventofctf/2020/challenge_12.md
  8. 3
      content/writeups/adventofctf/2020/challenge_13.md
  9. 3
      content/writeups/adventofctf/2020/challenge_14.md
  10. 3
      content/writeups/adventofctf/2020/challenge_15.md
  11. 3
      content/writeups/adventofctf/2020/challenge_16.md
  12. 3
      content/writeups/adventofctf/2020/challenge_17.md
  13. 3
      content/writeups/adventofctf/2020/challenge_18.md
  14. 3
      content/writeups/adventofctf/2020/challenge_19.md
  15. 3
      content/writeups/adventofctf/2020/challenge_2.md
  16. 3
      content/writeups/adventofctf/2020/challenge_20.md
  17. 3
      content/writeups/adventofctf/2020/challenge_21.md
  18. 3
      content/writeups/adventofctf/2020/challenge_22.md
  19. 3
      content/writeups/adventofctf/2020/challenge_23.md
  20. 3
      content/writeups/adventofctf/2020/challenge_24.md
  21. 3
      content/writeups/adventofctf/2020/challenge_3.md
  22. 3
      content/writeups/adventofctf/2020/challenge_4.md
  23. 3
      content/writeups/adventofctf/2020/challenge_5.md
  24. 3
      content/writeups/adventofctf/2020/challenge_6.md
  25. 3
      content/writeups/adventofctf/2020/challenge_7.md
  26. 3
      content/writeups/adventofctf/2020/challenge_8.md
  27. 3
      content/writeups/adventofctf/2020/challenge_9.md
  28. 3
      content/writeups/adventofctf/2020/intro.md
  29. 5
      content/writeups/adventofctf/_index.md
  30. 5
      content/writeups/google-ctf/2021/_index.md
  31. 3
      content/writeups/google-ctf/2021/beginners-quest/1.md
  32. 3
      content/writeups/google-ctf/2021/beginners-quest/10.md
  33. 3
      content/writeups/google-ctf/2021/beginners-quest/2.md
  34. 3
      content/writeups/google-ctf/2021/beginners-quest/3.md
  35. 3
      content/writeups/google-ctf/2021/beginners-quest/4.md
  36. 3
      content/writeups/google-ctf/2021/beginners-quest/5.md
  37. 3
      content/writeups/google-ctf/2021/beginners-quest/6.md
  38. 3
      content/writeups/google-ctf/2021/beginners-quest/7.md
  39. 3
      content/writeups/google-ctf/2021/beginners-quest/8.md
  40. 3
      content/writeups/google-ctf/2021/beginners-quest/9.md
  41. 5
      content/writeups/google-ctf/2021/beginners-quest/_index.md
  42. 5
      content/writeups/google-ctf/_index.md
  43. 2
      themes/maik-blog/layouts/_default/list.html
  44. 449
      themes/maik-blog/layouts/partials/seo.html
  45. 2
      themes/maik-blog/layouts/portfolio/list.html
  46. 12
      themes/maik-blog/layouts/writeups/list.html

@ -36,7 +36,8 @@ disableHugoGeneratorInject = false
googleAnalytics = "UA-136337666-1" googleAnalytics = "UA-136337666-1"
[permalinks] [permalinks]
posts = "/posts/:year/:month/:title/" posts = "/posts/:title/"
writeups = "/:sections/:title/"
[author] [author]
name = "Maik de Kruif" name = "Maik de Kruif"
@ -48,8 +49,8 @@ googleAnalytics = "UA-136337666-1"
twitter = "@maik_dev" twitter = "@maik_dev"
[outputs] [outputs]
home = ["HTML", "AMP", "RSS"] home = ["HTML", "RSS"]
page = ["HTML", "AMP", "RSS"] page = ["HTML", "RSS"]
[params] [params]
dateform = "Jan 2, 2006" dateform = "Jan 2, 2006"

@ -0,0 +1,5 @@
+++
author = "Maik de Kruif"
title = "2020"
description = "My Advent of CTF - 2020 writeups."
+++

@ -18,6 +18,9 @@ categories = [
"writeups", "writeups",
"hacking", "hacking",
] ]
aliases = [
"challenge_0"
]
+++ +++
- Points: 1 - Points: 1

@ -18,6 +18,9 @@ categories = [
"writeups", "writeups",
"hacking", "hacking",
] ]
aliases = [
"challenge_1"
]
+++ +++
- Points: 100 - Points: 100

@ -18,6 +18,9 @@ categories = [
"writeups", "writeups",
"hacking", "hacking",
] ]
aliases = [
"challenge_10"
]
+++ +++
- Points: 1000 - Points: 1000

@ -19,6 +19,9 @@ categories = [
"writeups", "writeups",
"hacking", "hacking",
] ]
aliases = [
"challenge_11"
]
+++ +++
- Points: 1100 - Points: 1100

@ -19,6 +19,9 @@ categories = [
"writeups", "writeups",
"hacking", "hacking",
] ]
aliases = [
"challenge_12"
]
+++ +++
- Points: 1200 - Points: 1200

@ -19,6 +19,9 @@ categories = [
"writeups", "writeups",
"hacking", "hacking",
] ]
aliases = [
"challenge_13"
]
+++ +++
- Points: 1300 - Points: 1300

@ -19,6 +19,9 @@ categories = [
"writeups", "writeups",
"hacking", "hacking",
] ]
aliases = [
"challenge_14"
]
+++ +++
- Points: 1400 - Points: 1400

@ -19,6 +19,9 @@ categories = [
"writeups", "writeups",
"hacking", "hacking",
] ]
aliases = [
"challenge_15"
]
+++ +++
- Points: 1500 - Points: 1500

@ -20,6 +20,9 @@ categories = [
"writeups", "writeups",
"hacking", "hacking",
] ]
aliases = [
"challenge_16"
]
+++ +++
- Points: 1600 - Points: 1600

@ -20,6 +20,9 @@ categories = [
"writeups", "writeups",
"hacking", "hacking",
] ]
aliases = [
"challenge_17"
]
+++ +++
- Points: 1700 - Points: 1700

@ -20,6 +20,9 @@ categories = [
"writeups", "writeups",
"hacking", "hacking",
] ]
aliases = [
"challenge_18"
]
+++ +++
- Points: 1800 - Points: 1800

@ -20,6 +20,9 @@ categories = [
"writeups", "writeups",
"hacking", "hacking",
] ]
aliases = [
"challenge_19"
]
+++ +++
- Points: 1900 - Points: 1900

@ -19,6 +19,9 @@ categories = [
"writeups", "writeups",
"hacking", "hacking",
] ]
aliases = [
"challenge_2"
]
+++ +++
- Points: 200 - Points: 200

@ -20,6 +20,9 @@ categories = [
"writeups", "writeups",
"hacking", "hacking",
] ]
aliases = [
"challenge_20"
]
+++ +++
- Points: 2000 - Points: 2000

@ -19,6 +19,9 @@ categories = [
"writeups", "writeups",
"hacking", "hacking",
] ]
aliases = [
"challenge_21"
]
+++ +++
- Points: 2100 - Points: 2100

@ -20,6 +20,9 @@ categories = [
"writeups", "writeups",
"hacking", "hacking",
] ]
aliases = [
"challenge_22"
]
+++ +++
- Points: 2200 - Points: 2200

@ -19,6 +19,9 @@ categories = [
"writeups", "writeups",
"hacking", "hacking",
] ]
aliases = [
"challenge_23"
]
+++ +++
- Points: 2300 - Points: 2300

@ -21,6 +21,9 @@ categories = [
"writeups", "writeups",
"hacking", "hacking",
] ]
aliases = [
"challenge_24"
]
+++ +++
- Points: 2400 - Points: 2400

@ -19,6 +19,9 @@ categories = [
"writeups", "writeups",
"hacking", "hacking",
] ]
aliases = [
"challenge_3"
]
+++ +++
- Points: 300 - Points: 300

@ -19,6 +19,9 @@ categories = [
"writeups", "writeups",
"hacking", "hacking",
] ]
aliases = [
"challenge_4"
]
+++ +++
- Points: 400 - Points: 400

@ -19,6 +19,9 @@ categories = [
"writeups", "writeups",
"hacking", "hacking",
] ]
aliases = [
"challenge_5"
]
+++ +++
- Points: 500 - Points: 500

@ -19,6 +19,9 @@ categories = [
"writeups", "writeups",
"hacking", "hacking",
] ]
aliases = [
"challenge_6"
]
+++ +++
- Points: 600 - Points: 600

@ -19,6 +19,9 @@ categories = [
"writeups", "writeups",
"hacking", "hacking",
] ]
aliases = [
"challenge_7"
]
+++ +++
- Points: 700 - Points: 700

@ -18,6 +18,9 @@ categories = [
"writeups", "writeups",
"hacking", "hacking",
] ]
aliases = [
"challenge_8"
]
+++ +++
- Points: 800 - Points: 800

@ -18,6 +18,9 @@ categories = [
"writeups", "writeups",
"hacking", "hacking",
] ]
aliases = [
"challenge_9"
]
+++ +++
- Points: 900 - Points: 900

@ -15,6 +15,9 @@ categories = [
"ctf", "ctf",
"hacking", "hacking",
] ]
aliases = [
"intro"
]
+++ +++
So, I'm in this Discord server and somebody by the name [@credmp](https://twitter.com/credmp) thought it'd be a great idea to do an advent calendar of CTF challenges. Every day of december, up until christmas, a new challenge will open up. It starts out easy, accessible to anyone and will grow in complexity as time progresses. So, I'm in this Discord server and somebody by the name [@credmp](https://twitter.com/credmp) thought it'd be a great idea to do an advent calendar of CTF challenges. Every day of december, up until christmas, a new challenge will open up. It starts out easy, accessible to anyone and will grow in complexity as time progresses.

@ -0,0 +1,5 @@
+++
author = "Maik de Kruif"
title = "Advent of CTF"
description = "My Advent of CTF writeups."
+++

@ -0,0 +1,5 @@
+++
author = "Maik de Kruif"
title = "2021"
description = "My Google CTF - 2021 writeups."
+++

@ -20,6 +20,9 @@ categories = [
"hacking", "hacking",
"rev", "rev",
] ]
aliases = [
"1"
]
+++ +++
## Story line ## Story line

@ -19,6 +19,9 @@ categories = [
"hacking", "hacking",
"hardware", "hardware",
] ]
aliases = [
"10"
]
+++ +++
## Story line ## Story line

@ -20,6 +20,9 @@ categories = [
"hacking", "hacking",
"misc", "misc",
] ]
aliases = [
"2"
]
+++ +++
## Story line ## Story line

@ -21,6 +21,9 @@ categories = [
"hacking", "hacking",
"misc", "misc",
] ]
aliases = [
"3"
]
+++ +++
## Story line ## Story line

@ -20,6 +20,9 @@ categories = [
"writeups", "writeups",
"hw", "hw",
] ]
aliases = [
"4"
]
+++ +++
## Story line ## Story line

@ -19,6 +19,9 @@ categories = [
"hacking", "hacking",
"misc", "misc",
] ]
aliases = [
"5"
]
+++ +++
## Story line ## Story line

@ -19,6 +19,9 @@ categories = [
"hacking", "hacking",
"misc", "misc",
] ]
aliases = [
"6"
]
+++ +++
## Story line ## Story line

@ -19,6 +19,9 @@ categories = [
"hacking", "hacking",
"crypto", "crypto",
] ]
aliases = [
"7"
]
+++ +++
## Story line ## Story line

@ -19,6 +19,9 @@ categories = [
"hacking", "hacking",
"misc", "misc",
] ]
aliases = [
"8"
]
+++ +++
## Story line ## Story line

@ -19,6 +19,9 @@ categories = [
"hacking", "hacking",
"reversing", "reversing",
] ]
aliases = [
"9"
]
+++ +++
## Story line ## Story line

@ -0,0 +1,5 @@
+++
author = "Maik de Kruif"
title = "Beginners Quest"
description = "My Google CTF - 2021 - Beginners Quest writeups."
+++

@ -0,0 +1,5 @@
+++
author = "Maik de Kruif"
title = "Google CTF"
description = "My Google CTF writeups."
+++

@ -5,7 +5,7 @@
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>
{{- if and .Content (not .Paginator.HasPrev) }} {{- if and .Content (not .Paginator.HasPrev) }}
<div class="content">{{ .Content }}</div> <div class="content content-list">{{ .Content }}</div>
{{- end }} {{- end }}
{{- if .Paginator.HasPrev }} {{- if .Paginator.HasPrev }}

@ -1,195 +1,292 @@
{{- /* <!-- Breadcrumbs --> */}}
{{- $breadcrumbs := slice }}
{{- $path := "" }}
{{- if or (eq .Kind "taxonomy") (or (eq .Kind "term") (eq .Kind "404")) }}
{{- $path = .RelPermalink }}
{{- else if .File }}
{{- $path = string .File }}
{{- else if .IsHome }}
{{- $path = "" }}
{{- else }}
{{- errorf "Could not find page at url: \"%s\"!" .RelPermalink }}
{{- end }}
{{- $path = trim $path "/" }}
{{- $currentPath := "" }}
{{- $breadcrumbs = $breadcrumbs | append (dict "name" "Home" "url" $.Site.BaseURL) }}
{{- range split $path "/" }}
{{- $currentPath = printf "%s/%s" $currentPath . }}
{{- $page := $.GetPage $currentPath }}
{{- if not $.IsHome }}
{{- if ne . "_index.md" }}
{{- if eq $.Kind "404" }}
{{- $breadcrumbs = $breadcrumbs | append (dict "name" "Not Found" "url" (printf "%s%s" $.Site.BaseURL (strings.TrimLeft "/" $currentPath))) }}
{{- else }}
{{- $title := $page.Title }}
{{- if eq $page $ }}
{{- $breadcrumbs = $breadcrumbs | append (dict "name" $title "url" $page.Permalink) }}
{{- else }}
{{- $breadcrumbs = $breadcrumbs | append (dict "name" $title "url" $page.Permalink)}}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- if .IsHome }}
<script type="application/ld+json"> <script type="application/ld+json">
{ {
"@context": "http://schema.org", "@context": "https://schema.org",
"@type": "WebSite", "@graph": [
"inLanguage": "{{ .Site.LanguageCode }}",
{{- $img := resources.Get .Site.Params.portrait.path }}
{{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }}
"thumbnailUrl": "{{ $img.Permalink }}",
"image": [
{ {
"@type": "ImageObject", "@type": "Person",
"url": "{{ $img.Permalink }}", "@id": "{{ $.Site.BaseURL }}#website_founder",
"width": {{ $img.Width }}, "name": {{ $.Site.Author.name | safeHTML }},
"height": {{ $img.Height }} {{- with $.Site.Author.email }}
} "email": {{ . | safeHTML }},
], {{- end }}
"genre": "{{ .Site.Params.genre }}", {{- with $.Site.Author.image }}
"keywords": "{{ .Site.Params.keywords }}{{ if .Params.tags }}{{ range .Params.tags }}, {{ . }}{{ end }}{{ end }}{{ with .Title }}, {{ delimit (split . " ") ", " }}{{ end }}{{ with .Params.Subtitle }}, {{ delimit (split . " ") ", " }}{{ end }}", {{- $img := resources.Get . }}
"url": "{{ .Permalink }}", {{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }}
{{- with .Site.Copyright }} "image": {
"license": {{ . | safeHTML }}, "@type": "ImageObject",
{{- end }} "url": "{{ $img.Permalink }}",
{{- if .Site.Author.name }} "width": {{ $img.Width }},
{{- range slice "publisher" "author" }} "height": {{ $img.Height }}
{{ . }}: { },
"@type": "Person", {{- end }}
"name": {{ $.Site.Author.name | safeHTML }}, "url": "{{ $.Site.BaseURL }}"
{{- with $.Site.Author.email }}
"email": {{ . | safeHTML }},
{{- end }}
{{- with $.Site.Author.image }}
{{- $img := resources.Get . }}
{{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }}
"image": {
"@type": "ImageObject",
"url": "{{ $img.Permalink }}",
"width": {{ $img.Width }},
"height": {{ $img.Height }}
}, },
{{- end }}
"url": "{{ $.Site.BaseURL }}"
},
{{- end }}
{{- end }}
"headline": {{ .Site.Title }},
"alternativeHeadline": {{ .Site.Params.homeSubtitle }},
"description": {{ .Site.Params.description }}
}
</script>
{{- else if .IsPage }}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BlogPosting",
"articleSection": "{{ .Type }}",
"headline": "{{ .Title | safeHTML }}",
{{- with .Params.Subtitle }}
"alternativeHeadline": "{{ . }}",
{{- end }}
"inLanguage": "{{ .Site.LanguageCode }}",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "{{ .Permalink }}"
},
{{- with .Params.cover}}
{{- $img := resources.Get (printf "%s" .) }}
{{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }}
"thumbnailUrl": "{{ $img.Permalink }}",
"image": [
{ {
"@type": "ImageObject", "@type": "Organization",
"url": "{{ $img.Permalink }}", "name": {{ $.Site.Author.name | safeHTML }},
"width": {{ $img.Width }}, "slogan": {{$.Site.Params.HomeSubtitle | safeHTML }},
"height": {{ $img.Height }} {{- with $socials := .Site.Params.social }}
} "sameAs": [
], {{- range $index, $social := $socials }}
{{- end }} "{{ $social.url }}"{{ if ne $index (sub (len $socials) 1) }},{{ end }}
"genre": "{{ .Type }}", {{- end }}
"keywords": "{{ .Site.Params.keywords }}{{ if .Params.tags }}{{ range .Params.tags }}, {{ . }}{{ end }}{{ end }}{{ with .Title }}, {{ delimit (split . " ") ", " }}{{ end }}{{ with .Params.Subtitle }}, {{ delimit (split . " ") ", " }}{{ end }}", ],
"wordcount": {{ .WordCount }}, {{- end }}
"url": "{{ .Permalink }}", {{- with $.Site.Author.email }}
"datePublished": {{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}, "email": {{ . | safeHTML }},
{{- if .GitInfo }} {{- end }}
"dateModified": {{ dateFormat "2006-01-02T15:04:05-07:00" .GitInfo.AuthorDate.Local | safeHTML }}, {{- with $.Site.Author.image }}
{{- end }} {{- $img := resources.Get . }}
{{- with .Site.Copyright }} {{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }}
"license": {{ . | safeHTML }}, "logo": {
{{- end }} "@type": "ImageObject",
{{- if .Site.Author.name }} "url": "{{ $img.Permalink }}",
{{- range slice "publisher" "author" }} "width": {{ $img.Width }},
{{ . }}: { "height": {{ $img.Height }}
"@type": "Person", },
"name": {{ $.Site.Author.name | safeHTML }}, "image": {
{{- with $.Site.Author.email }} "@type": "ImageObject",
"email": {{ . | safeHTML }}, "url": "{{ $img.Permalink }}",
{{- end }} "width": {{ $img.Width }},
{{- with $.Site.Author.image }} "height": {{ $img.Height }}
{{- $img := resources.Get . }} },
{{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }} {{- end }}
"image": { "url": "{{ $.Site.BaseURL }}",
"@type": "ImageObject", "founder": { "@id": "{{ $.Site.BaseURL }}#website_founder" }
"url": "{{ $img.Permalink }}",
"width": {{ $img.Width }},
"height": {{ $img.Height }}
}, },
{{- end }}
"url": "{{ $.Site.BaseURL }}"
},
{{- end }}
{{- end }}
"description": {{ .Params.description | plainify }}
}
</script>
{{- else if .IsSection }}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "ItemList",
"itemListOrder": "https://schema.org/ItemListOrderDescending",
"name": "{{ .Title }}",
"numberOfItems": {{ len .Data.Pages }},
"itemListElement": [
{{- $pages := first 10 .Data.Pages }}
{{- range $index, $page := $pages }}
{ {
"@type": "ListItem", "@type": "WebSite",
"position": {{ add $index 1 }}, "inLanguage": "{{ .Site.LanguageCode }}",
"item": { {{- $img := resources.Get .Site.Params.portrait.path }}
"@type": "BlogPosting", {{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }}
"articleSection": "{{ .Type }}", "thumbnailUrl": "{{ $img.Permalink }}",
"headline": "{{ .Title | safeHTML }}", "image": [
{{- with .Params.Subtitle }} {
"alternativeHeadline": "{{ . }}", "@type": "ImageObject",
"url": "{{ $img.Permalink }}",
"width": {{ $img.Width }},
"height": {{ $img.Height }}
}
],
"genre": "{{ .Site.Params.genre }}",
"keywords": "{{ .Site.Params.keywords }}{{ if .Params.tags }}{{ range .Params.tags }}, {{ . }}{{ end }}{{ end }}{{ with .Title }}, {{ delimit (split . " ") ", " }}{{ end }}{{ with .Params.Subtitle }}, {{ delimit (split . " ") ", " }}{{ end }}",
"url": "{{ .Site.BaseURL }}",
{{- with .Site.Copyright }}
"license": {{ . | safeHTML }},
{{- end }}
{{- if .Site.Author.name }}
{{- range slice "publisher" "author" }}
{{ . }}: {
"@type": "Person",
"name": {{ $.Site.Author.name | safeHTML }},
{{- with $.Site.Author.email }}
"email": {{ . | safeHTML }},
{{- end }} {{- end }}
"inLanguage": "{{ .Site.LanguageCode }}", {{- with $.Site.Author.image }}
"mainEntityOfPage": { {{- $img := resources.Get . }}
"@type": "WebPage",
"@id": "{{ .Permalink }}"
},
{{- with .Params.cover}}
{{- $img := resources.Get (printf "%s" .) }}
{{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }} {{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }}
"thumbnailUrl": "{{ $img.Permalink }}", "image": {
"image": [ "@type": "ImageObject",
{ "url": "{{ $img.Permalink }}",
"@type": "ImageObject", "width": {{ $img.Width }},
"url": "{{ $img.Permalink }}", "height": {{ $img.Height }}
"width": {{ $img.Width }}, },
"height": {{ $img.Height }}
}
],
{{- end }} {{- end }}
"genre": "{{ .Type }}", "url": "{{ $.Site.BaseURL }}"
"keywords": "{{ .Site.Params.keywords }}{{ if .Params.tags }}{{ range .Params.tags }}, {{ . }}{{ end }}{{ end }}{{ with .Title }}, {{ delimit (split . " ") ", " }}{{ end }}{{ with .Params.Subtitle }}, {{ delimit (split . " ") ", " }}{{ end }}", },
"wordcount": {{ .WordCount }}, {{- end }}
"url": "{{ .Permalink }}", {{- end }}
"datePublished": {{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}, "headline": {{ .Site.Title }},
{{- if .GitInfo }} "alternativeHeadline": {{ .Site.Params.homeSubtitle }},
"dateModified": {{ dateFormat "2006-01-02T15:04:05-07:00" .GitInfo.AuthorDate.Local | safeHTML }}, "description": {{ .Site.Params.description }}
},
{
"@type": "BreadcrumbList",
"itemListElement": [
{{- range $index, $breadcrumb := $breadcrumbs }}
{
"@type": "ListItem",
"position": {{ add $index 1 }},
"item": {
"@id": "{{ $breadcrumb.url }}",
"url": "{{ $breadcrumb.url }}",
"name": "{{ $breadcrumb.name }}"
}
}{{ if ne $index (sub (len $breadcrumbs) 1) }},{{ end }}
{{- end }} {{- end }}
{{- with .Site.Copyright }} ]
"license": {{ . | safeHTML }}, }{{ if .IsPage }},
{
"@context": "http://schema.org",
"@type": "BlogPosting",
"articleSection": "{{ .Type }}",
"headline": "{{ .Title | safeHTML }}",
{{- with .Params.Subtitle }}
"alternativeHeadline": "{{ . }}",
{{- end }}
"inLanguage": "{{ .Site.LanguageCode }}",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "{{ .Permalink }}"
},
{{- with .Params.cover}}
{{- $img := resources.Get (printf "%s" .) }}
{{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }}
"thumbnailUrl": "{{ $img.Permalink }}",
"image": [
{
"@type": "ImageObject",
"url": "{{ $img.Permalink }}",
"width": {{ $img.Width }},
"height": {{ $img.Height }}
}
],
{{- end }}
"genre": "{{ .Type }}",
"keywords": "{{ .Site.Params.keywords }}{{ if .Params.tags }}{{ range .Params.tags }}, {{ . }}{{ end }}{{ end }}{{ with .Title }}, {{ delimit (split . " ") ", " }}{{ end }}{{ with .Params.Subtitle }}, {{ delimit (split . " ") ", " }}{{ end }}",
"wordcount": {{ .WordCount }},
"url": "{{ .Permalink }}",
"datePublished": {{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }},
{{- if .GitInfo }}
"dateModified": {{ dateFormat "2006-01-02T15:04:05-07:00" .GitInfo.AuthorDate.Local | safeHTML }},
{{- end }}
{{- with .Site.Copyright }}
"license": {{ . | safeHTML }},
{{- end }}
{{- if .Site.Author.name }}
{{- range slice "publisher" "author" }}
{{ . }}: {
"@type": "Person",
"name": {{ $.Site.Author.name | safeHTML }},
{{- with $.Site.Author.email }}
"email": {{ . | safeHTML }},
{{- end }} {{- end }}
{{- if .Site.Author.name }} {{- with $.Site.Author.image }}
{{- range slice "publisher" "author" }} {{- $img := resources.Get . }}
{{ . }}: { {{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }}
"@type": "Person", "image": {
"name": {{ $.Site.Author.name | safeHTML }}, "@type": "ImageObject",
{{- with $.Site.Author.email }} "url": "{{ $img.Permalink }}",
"email": {{ . | safeHTML }}, "width": {{ $img.Width }},
{{- end }} "height": {{ $img.Height }}
{{- with $.Site.Author.image }}
{{- $img := resources.Get . }}
{{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }}
"image": {
"@type": "ImageObject",
"url": "{{ $img.Permalink }}",
"width": {{ $img.Width }},
"height": {{ $img.Height }}
},
{{- end }}
"url": "{{ $.Site.BaseURL }}"
}, },
{{- end }} {{- end }}
"url": "{{ $.Site.BaseURL }}"
},
{{- end }}
{{- end }}
"description": {{ .Params.description | plainify }}
}{{ end }}{{ if .IsSection }},
{
"@context": "http://schema.org",
"@type": "ItemList",
"itemListOrder": "https://schema.org/ItemListOrderDescending",
"name": "{{ .Title }}",
"numberOfItems": {{ len .Data.Pages }},
"itemListElement": [
{{- $pages := first 10 .Data.Pages }}
{{- range $index, $page := $pages }}
{
"@type": "ListItem",
"position": {{ add $index 1 }},
"item": {
"@type": "BlogPosting",
"articleSection": "{{ .Type }}",
"headline": "{{ .Title | safeHTML }}",
{{- with .Params.Subtitle }}
"alternativeHeadline": "{{ . }}",
{{- end }}
"inLanguage": "{{ .Site.LanguageCode }}",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "{{ .Permalink }}"
},
{{- with .Params.cover}}
{{- $img := resources.Get (printf "%s" .) }}
{{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }}
"thumbnailUrl": "{{ $img.Permalink }}",
"image": [
{
"@type": "ImageObject",
"url": "{{ $img.Permalink }}",
"width": {{ $img.Width }},
"height": {{ $img.Height }}
}
],
{{- end }}
"genre": "{{ .Type }}",
"keywords": "{{ .Site.Params.keywords }}{{ if .Params.tags }}{{ range .Params.tags }}, {{ . }}{{ end }}{{ end }}{{ with .Title }}, {{ delimit (split . " ") ", " }}{{ end }}{{ with .Params.Subtitle }}, {{ delimit (split . " ") ", " }}{{ end }}",
"wordcount": {{ .WordCount }},
"url": "{{ .Permalink }}",
"datePublished": {{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }},
{{- if .GitInfo }}
"dateModified": {{ dateFormat "2006-01-02T15:04:05-07:00" .GitInfo.AuthorDate.Local | safeHTML }},
{{- end }}
{{- with .Site.Copyright }}
"license": {{ . | safeHTML }},
{{- end }}
{{- if .Site.Author.name }}
{{- range slice "publisher" "author" }}
{{ . }}: {
"@type": "Person",
"name": {{ $.Site.Author.name | safeHTML }},
{{- with $.Site.Author.email }}
"email": {{ . | safeHTML }},
{{- end }}
{{- with $.Site.Author.image }}
{{- $img := resources.Get . }}
{{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }}
"image": {
"@type": "ImageObject",
"url": "{{ $img.Permalink }}",
"width": {{ $img.Width }},
"height": {{ $img.Height }}
},
{{- end }}
"url": "{{ $.Site.BaseURL }}"
},
{{- end }}
{{- end }}
"description": {{ .Params.description | plainify }}
}
}{{ if ne (sub (len $pages) 1) $index }},{{ end }}
{{- end }} {{- end }}
"description": {{ .Params.description | plainify }} ]
} }{{ end }}
}{{ if ne (sub (len $pages) 1) $index }},{{ end }}
{{- end }}
] ]
} }
</script> </script>
{{- end }}

@ -4,7 +4,7 @@
<h1>Portfolio</h1> <h1>Portfolio</h1>
{{- if and .Content (not .Paginator.HasPrev) }} {{- if and .Content (not .Paginator.HasPrev) }}
<div class="content">{{ .Content }}</div> <div class="content content-list">{{ .Content }}</div>
{{- end }} {{- end }}
<div class="portfolios-list"> <div class="portfolios-list">

@ -1,11 +1,19 @@
{{ define "main" }} {{ define "main" }}
{{ $paginator := .Paginate .Data.Pages }}
{{- $allWriteups := slice }}
{{- range where (where .Site.Pages "Section" .Section) "IsPage" true }}
{{- if $.IsAncestor . }}
{{- $allWriteups = $allWriteups | append . }}
{{- end }}
{{- end }}
{{- $allWriteups = sort $allWriteups "Date" "desc" }}
{{ $paginator := .Paginate $allWriteups }}
<main class="posts"> <main class="posts">
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>
{{- if and .Content (not .Paginator.HasPrev) }} {{- if and .Content (not .Paginator.HasPrev) }}
<div class="content">{{ .Content }}</div> <div class="content content-list">{{ .Content }}</div>
{{- end }} {{- end }}
{{- if .Paginator.HasPrev }} {{- if .Paginator.HasPrev }}

Loading…
Cancel
Save