Tags, rss, sitemap and robots.txt

This commit is contained in:
Hazem Krimi
2023-11-17 18:49:54 +01:00
parent 5ea292e909
commit 4598a12887
11 changed files with 92 additions and 15 deletions
+18
View File
@@ -7,6 +7,24 @@ main h2 {
margin-bottom: 1rem; margin-bottom: 1rem;
} }
main #tags {
display: flex;
align-items: center;
column-gap: 1rem;
}
main #tags a {
border-radius: 0.5625rem;
background-color: #5A5A5A;
color: var(--white);
padding: 0.5rem 1rem;
text-decoration: none;
}
main #tags .selected {
background-color: var(--crimson);
}
@media only screen and (max-width: 1024px) { @media only screen and (max-width: 1024px) {
main h2 { main h2 {
font-size: 1.75rem; font-size: 1.75rem;
+4
View File
@@ -18,3 +18,7 @@
.breadcrumb a { .breadcrumb a {
text-transform: capitalize; text-transform: capitalize;
} }
.breadcrumb .tag {
text-transform: lowercase;
}
+1
View File
@@ -2,6 +2,7 @@
title: "Another blog post" title: "Another blog post"
description: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book." description: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book."
date: 2023-10-18 date: 2023-10-18
tags: ['testing']
--- ---
## Hi ## Hi
+1
View File
@@ -2,6 +2,7 @@
title: "Test blog" title: "Test blog"
description: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book." description: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book."
date: 2023-10-18 date: 2023-10-18
tags: ['test']
--- ---
## Hi ## Hi
+14 -1
View File
@@ -1,11 +1,24 @@
languageCode = 'en-us' languageCode = 'en-us'
title = 'Hazem Krimi' title = 'Hazem Krimi'
paginate = 1 paginate = 5
enableRobotsTXT = true
[outputs]
home = ['html', 'rss']
section = ['html', 'rss']
taxonomy = ['html']
term = ['html']
[sitemap]
changeFreq = ''
filename = 'sitemap.xml'
priority = -1
[taxonomies] [taxonomies]
tag = 'tags' tag = 'tags'
[params] [params]
formSpreeURL = 'https://formspree.io/f/xoqpgyge' formSpreeURL = 'https://formspree.io/f/xoqpgyge'
dateFormat = '02 January 2006' dateFormat = '02 January 2006'
[params.author]
email = 'me@hazemkrimi.tech'
name = 'Hazem Krimi'
[module] [module]
[menu] [menu]
[[menu.main]] [[menu.main]]
+6 -1
View File
@@ -7,12 +7,17 @@
{{ $favIcon16 := resources.Get "favicon-16x16.png" }} {{ $favIcon16 := resources.Get "favicon-16x16.png" }}
{{ $favIcon := resources.Get "favicon.ico" }} {{ $favIcon := resources.Get "favicon.ico" }}
<html> <!DOCTYPE html>
<html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#FBFBFB" /> <meta name="theme-color" content="#FBFBFB" />
{{ with .OutputFormats.Get "rss" -}}
{{ printf `<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .Permalink site.Title | safeHTML }}
{{ end }}
<link rel="icon" sizes="192x192" href="{{ $androidChromeIcon.Permalink }}"> <link rel="icon" sizes="192x192" href="{{ $androidChromeIcon.Permalink }}">
<link rel="apple-touch-icon" sizes="180x180" href="{{ $appleTouchIcon.Permalink }}"> <link rel="apple-touch-icon" sizes="180x180" href="{{ $appleTouchIcon.Permalink }}">
<link rel="icon" type="image/png" sizes="32x32" href="{{ $favIcon32.Permalink }}"> <link rel="icon" type="image/png" sizes="32x32" href="{{ $favIcon32.Permalink }}">
+27 -4
View File
@@ -9,11 +9,34 @@
{{ .Content }} {{ .Content }}
<section> {{ if or (.InSection ($.Site.GetPage "blog")) (findRESubmatch "tags" .RelPermalink) }}
{{ range .Paginator.Pages }} {{ $currentTitle := .Page.Title }}
{{ partial "card.html" . }}
{{ if (findRESubmatch "tags" .RelPermalink) }}
<h2>Blog</h2>
<p>These are articles about things I learned about software engineering.</p>
{{ end }} {{ end }}
</section>
<section id="tags">
{{ range .Site.Taxonomies.tags }}
<a class="{{ if (eq $currentTitle .Page.Title) }}selected{{ end }}"
href="{{ .Page.Permalink }}"
>
{{ .Page.Title }}
</a>
{{ end }}
</section>
{{ end }}
{{ if gt .Paginator.TotalPages 0 }}
<section>
{{ range .Paginator.Pages }}
{{ partial "card.html" . }}
{{ end }}
</section>
{{ else }}
<h2>Nothing for now</h2>
{{ end }}
{{ partial "pagination.html" . }} {{ partial "pagination.html" . }}
{{ end }} {{ end }}
+2 -2
View File
@@ -33,7 +33,7 @@
</div> </div>
<p>These are all the projects I worked on personally and professionally.</p> <p>These are all the projects I worked on personally and professionally.</p>
{{ range (where .Site.Pages "Section" "projects") }} {{ range (where .Site.Pages "Section" "projects") }}
{{ range .Pages }} {{ range first 2 .Pages }}
{{ partial "card.html" . }} {{ partial "card.html" . }}
{{ end }} {{ end }}
{{ end }} {{ end }}
@@ -48,7 +48,7 @@
</div> </div>
<p>These are articles about things I learned about software engineering.</p> <p>These are articles about things I learned about software engineering.</p>
{{ range (where .Site.Pages "Section" "blog") }} {{ range (where .Site.Pages "Section" "blog") }}
{{ range .Pages }} {{ range first 2 .Pages }}
{{ partial "card.html" . }} {{ partial "card.html" . }}
{{ end }} {{ end }}
{{ end }} {{ end }}
+16 -4
View File
@@ -5,12 +5,24 @@
<nav aria-label="breadcrumb" class="breadcrumb"> <nav aria-label="breadcrumb" class="breadcrumb">
<ol> <ol>
{{ range .Ancestors.Reverse }} {{ range .Ancestors.Reverse }}
<li> {{ if (eq .Title "Tags") }}
<a href="{{ .Permalink }}">{{ .Title }}</a> <li>
</li> <a href="{{ urls.JoinPath .Site.BaseURL "blog" }}">Blog</a>
</li>
{{ else }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
</li>
{{ end }}
{{ end }} {{ end }}
<li class="active"> <li class="active">
<a aria-current="page" href="{{ .Permalink }}">{{ .Title }}</a> <a
aria-current="page"
class="{{ if (eq .Parent.Title "Tags") }}tag{{ end }}"
href="{{ .Permalink }}"
>
{{ if (eq .Parent.Title "Tags") }}#{{ end }}{{ .Title }}
</a>
</li> </li>
</ol> </ol>
</nav> </nav>
+1 -1
View File
@@ -20,7 +20,7 @@
<a href="https://github.com/hazemKrimi" target="_blank"> <a href="https://github.com/hazemKrimi" target="_blank">
{{ readFile "assets/icons/github.svg" | safeHTML }} {{ readFile "assets/icons/github.svg" | safeHTML }}
</a> </a>
<a href="/" target="_blank"> <a href="{{ urls.JoinPath .Site.BaseURL "index.xml" }}" target="_blank">
{{ readFile "assets/icons/rss.svg" | safeHTML }} {{ readFile "assets/icons/rss.svg" | safeHTML }}
</a> </a>
<a href="mailto:me@hazemkrimi.tech" target="_blank"> <a href="mailto:me@hazemkrimi.tech" target="_blank">
+2 -2
View File
@@ -21,7 +21,7 @@
<a href="https://www.linkedin.com/in/hazemkrimi" target="_blank"> {{ readFile "assets/icons/linkedin.svg" | safeHTML }} </a> <a href="https://www.linkedin.com/in/hazemkrimi" target="_blank"> {{ readFile "assets/icons/linkedin.svg" | safeHTML }} </a>
<a href="https://twitter.com/HazemKrimi" target="_blank"> {{ readFile "assets/icons/twitter.svg" | safeHTML }} </a> <a href="https://twitter.com/HazemKrimi" target="_blank"> {{ readFile "assets/icons/twitter.svg" | safeHTML }} </a>
<a href="https://github.com/hazemKrimi" target="_blank"> {{ readFile "assets/icons/github.svg" | safeHTML }} </a> <a href="https://github.com/hazemKrimi" target="_blank"> {{ readFile "assets/icons/github.svg" | safeHTML }} </a>
<a href="/" target="_blank"> {{ readFile "assets/icons/rss.svg" | safeHTML }} </a> <a href="{{ urls.JoinPath .Site.BaseURL "index.xml" }}" target="_blank"> {{ readFile "assets/icons/rss.svg" | safeHTML }} </a>
<a href="mailto:me@hazemkrimi.tech" target="_blank"> {{ readFile "assets/icons/mail.svg" | safeHTML }} </a> <a href="mailto:me@hazemkrimi.tech" target="_blank"> {{ readFile "assets/icons/mail.svg" | safeHTML }} </a>
<a href="{{ $cv.Permalink }}" target="_blank"> {{ readFile "assets/icons/cv.svg" | safeHTML }} </a> <a href="{{ $cv.Permalink }}" target="_blank"> {{ readFile "assets/icons/cv.svg" | safeHTML }} </a>
<div class="vertical-separator"></div> <div class="vertical-separator"></div>
@@ -56,7 +56,7 @@
</span> </span>
<a href="{{ $cv.Permalink }}" target="_blank"> {{ readFile "assets/icons/cv.svg" | safeHTML }} </a> <a href="{{ $cv.Permalink }}" target="_blank"> {{ readFile "assets/icons/cv.svg" | safeHTML }} </a>
<a href="mailto:me@hazemkrimi.tech" target="_blank"> {{ readFile "assets/icons/mail.svg" | safeHTML }} </a> <a href="mailto:me@hazemkrimi.tech" target="_blank"> {{ readFile "assets/icons/mail.svg" | safeHTML }} </a>
<a href="/" target="_blank"> {{ readFile "assets/icons/rss.svg" | safeHTML }} </a> <a href="{{ urls.JoinPath .Site.BaseURL "index.xml" }}" target="_blank"> {{ readFile "assets/icons/rss.svg" | safeHTML }} </a>
<a href="https://github.com/hazemKrimi" target="_blank"> {{ readFile "assets/icons/github.svg" | safeHTML }} </a> <a href="https://github.com/hazemKrimi" target="_blank"> {{ readFile "assets/icons/github.svg" | safeHTML }} </a>
<a href="https://twitter.com/HazemKrimi" target="_blank"> {{ readFile "assets/icons/twitter.svg" | safeHTML }} </a> <a href="https://twitter.com/HazemKrimi" target="_blank"> {{ readFile "assets/icons/twitter.svg" | safeHTML }} </a>
<a href="https://www.linkedin.com/in/hazemkrimi" target="_blank"> {{ readFile "assets/icons/linkedin.svg" | safeHTML }} </a> <a href="https://www.linkedin.com/in/hazemkrimi" target="_blank"> {{ readFile "assets/icons/linkedin.svg" | safeHTML }} </a>