From 01b300071c3f108030e4a27c51fa0949bee5ad2d Mon Sep 17 00:00:00 2001
From: Alexander Bilz <mail@alexbilz.com>
Date: Wed, 03 Nov 2021 18:25:18 +0000
Subject: [PATCH] Merge branch 'master' into portfolio

---
 layouts/_default/single.html                      |   20 +
 layouts/partials/sidebar.html                     |    2 
 layouts/partials/schema.html                      |  121 ++++++++++
 .github/workflows/format.yml                      |   22 +
 layouts/partials/pagination.html                  |   54 ++++
 layouts/partials/series.html                      |   10 
 exampleSite/content/english/post/series-part-2.md |   17 +
 assets/css/style.css                              |  150 ++++++++++++
 exampleSite/config/_default/params.toml           |    2 
 exampleSite/content/english/post/series-part-1.md |   41 +++
 README.md                                         |   75 ++++++
 exampleSite/config/_default/menus.ar.toml         |    8 
 layouts/partials/comments/gitalk.html             |   33 ++
 assets/css/style.rtl.css                          |   31 ++
 layouts/partials/navbar.html                      |   54 +++-
 layouts/index.html                                |    2 
 exampleSite/config/_default/config.toml           |    7 
 exampleSite/content/arabic/post/arabic_example.md |   10 
 assets/css/markupHighlight.css                    |    5 
 layouts/partials/head.html                        |   20 +
 exampleSite/config/_default/languages.toml        |    4 
 .github/stale.yml                                 |    5 
 layouts/partials/contact.html                     |    5 
 layouts/partials/footer.html                      |    2 
 24 files changed, 666 insertions(+), 34 deletions(-)

diff --git a/.github/stale.yml b/.github/stale.yml
index 82c0d00..06cff5e 100644
--- a/.github/stale.yml
+++ b/.github/stale.yml
@@ -4,9 +4,8 @@
 # Number of days of inactivity before a stale issue is closed
 daysUntilClose: 7
 # Issues with these labels will never be considered stale
-exemptLabels:
-  - pinned
-  - security
+onlyLabels:
+  - awaiting-reply
 # Label to use when marking an issue as stale
 staleLabel: wontfix
 # Comment to post when marking an issue as stale. Set to `false` to disable
diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml
new file mode 100644
index 0000000..5a6688e
--- /dev/null
+++ b/.github/workflows/format.yml
@@ -0,0 +1,22 @@
+name: format
+
+on:
+  push:
+    branches: master
+
+jobs:
+  format:
+    runs-on: ubuntu-latest
+    steps:
+      - name: checkout code
+        uses: actions/checkout@v2
+      - name: setup node
+        uses: actions/setup-node@v2
+      - name: install
+        run: npm ci
+      - name: format
+        run: npm run prettier
+      - name: commit changes
+        uses: stefanzweifel/git-auto-commit-action@v4
+        with:
+          commit_message: 'style: prettier format all files'
diff --git a/README.md b/README.md
index 55a3f87..76afae7 100644
--- a/README.md
+++ b/README.md
@@ -28,12 +28,14 @@
 - Open Graph support
 - MIT License
 - Fontawesome 5.15.1 icons
+- Google Fonts support
 - Custom CSS (optional)
 - Custom JavaScript (optional)
 - Medium like zoom for images
 - Compliant to strict CSP
 - Syntax highlighting
 - Uses Hugo pipes to process assets
+- Series
 
 ## Preview the exampleSite
 
@@ -166,6 +168,20 @@
 listDateFormat = "Jan 2"
 ```
 
+### Change the language names in the language dropdown
+
+The language names displayed on the main menu are controlled by the variables `LanguageName`. You can set these to shortcode, full name or a flag emoji by simply changing the parameter. In the following example English will be displayed as "EN" and Arabic will be displayed as "Arabic".
+
+```toml
+[languages]
+[en]
+LanguageName = "EN"
+
+
+[ar]
+LanguageName = "Arabic"
+```
+
 ### Changing the sidebar/content ratio
 
 By default, the content fills up 60% of the screen width on devices with a full HD resolution. If you want to change the ratio, adjust the `contentratio` variable. Let's, for example, set the content ratio to 70%:
@@ -314,6 +330,19 @@
 CommentoURL = "https://commento.example.com/js/commento.js"
 ```
 
+### Comments powered by Gitalk
+
+No comment section is shown on the `single.html` unless a `repo` is specified in the `config.toml` file. If uncertain how parameter to configure, check out the official [documentation](https://github.com/gitalk/gitalk).
+
+```toml
+[params.gitalk]
+clientID = "GitHub Application Client ID"
+clientSecret = "GitHub Application Client Secret"
+repo = "Repository name to store issues"
+owner = "GitHub repo owner"
+admin = "GitHub repo owner and collaborators, only these guys can initialize gitHub issues"
+```
+
 ### Disabling Comments Per Page
 
 Comments can be disabled per page by setting `disableComments: true` on the pages [Front Matter](https://gohugo.io/content-management/front-matter/)
@@ -354,6 +383,18 @@
 
 Replace the hash with the one Google provided you.
 
+### Google Fonts
+
+You can enable any [Google Font](https://fonts.google.com/) by selecting a font on the Google Font website and adding the `family` parameter of the font url to the `googleFonts` option in `[params]`, e.g.:
+
+```toml
+[params]
+googleFonts = [
+  "Indie+Flower",
+  "Roboto:ital,wght@0,100;0,400;0,700;1,400"
+]
+```
+
 ### Beautiful math functions
 
 ```toml
@@ -611,6 +652,40 @@
 
 Additionally, you can include the `{{% loading %}}` shortcode, which will display a spinner on the page that will be redirected. If it does not display, make sure that unsafe mode is enabled for `markup.goldmark.renderer`.
 
+### Enable Table of Contents
+
+You can enable a table of contents on a per post basis by adding the following parameter into the front matter of the posts you want the table of contents to appear on.
+
+```md
++++
+...
+toc = true
++++
+```
+
+Please note that only "## H2 Headings" and "### H3 Headings" will appear in the table of contents.
+
+### Enabling Series
+
+You can enable series, which allows splitting up a huge post into a set of multiple blog posts that are still linked. This would also provide a unique link to the full series of blog posts. Each individual post in the series will also contain links to the other parts under the heading `Posts in this Series`.
+
+First, we need to enable the `series` taxonomy in the config.
+
+```toml
+[taxonomies]
+    category = "categories"
+    series = "series"
+    tag = "tags"
+```
+
+With this enabled, we can now proceed to specify the series in the Front Matter of each post of that series.
+
+```md
+series: - series-name
+```
+
+If you want to share the full series, you can do so by sharing the link `<base-url>/series/<series-name>`
+
 ## License
 
 Anatole is licensed under the [MIT license](https://github.com/lxndrblz/anatole/blob/master/LICENSE).
diff --git a/assets/css/markupHighlight.css b/assets/css/markupHighlight.css
index 8d9c942..d7a9ca3 100644
--- a/assets/css/markupHighlight.css
+++ b/assets/css/markupHighlight.css
@@ -14,9 +14,7 @@
   --chr-kp-color: #00a8c8;
   --chr-kr-color: #00a8c8;
   --chr-kt-color: #00a8c8;
-  --chr-n-color: #111111;
   --chr-na-color: #75af00;
-  --chr-nb-color: #111111;
   --chr-bp-color: #111111;
   --chr-nc-color: #75af00;
   --chr-no-color: #00a8c8;
@@ -26,11 +24,9 @@
   --chr-nf-color: #75af00;
   --chr-fm-color: #111111;
   --chr-nl-color: #111111;
-  --chr-nn-color: #111111;
   --chr-nx-color: #75af00;
   --chr-py-color: #111111;
   --chr-nt-color: #f92672;
-  --chr-nv-color: #111111;
   --chr-vc-color: #111111;
   --chr-vg-color: #111111;
   --chr-vi-color: #111111;
@@ -134,6 +130,7 @@
 
 /* Background */
 .chroma {
+  direction: ltr;
   color: var(--chr-def-color);
   background-color: var(--chr-def-bg-color);
 }
diff --git a/assets/css/style.css b/assets/css/style.css
index 3b40bb8..3487da5 100644
--- a/assets/css/style.css
+++ b/assets/css/style.css
@@ -270,6 +270,93 @@
   width: var(--sidebar-width);
 }
 
+/*
+Language Switch
+*/
+
+.sl-nav {
+  margin: 0;
+  padding: 0;
+  list-style: none;
+  position: relative;
+  display: inline-block;
+  padding-right: 20px;
+}
+
+.sl-nav a:hover {
+  cursor: pointer;
+}
+
+.sl-nav li {
+  cursor: pointer;
+  padding-bottom: 10px;
+}
+
+.sl-nav li .dropdown {
+  display: none;
+  position: absolute;
+  top: 29px;
+  right: -15px;
+  background: var(--pre-bg-color);
+  border-color: var(--border-color);
+  padding-left: 0;
+  padding-top: 0px;
+  z-index: 1;
+  border-radius: 5px;
+  box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.2);
+}
+
+#languagepicker:checked ~ .dropdown {
+  display: block;
+}
+
+.sl-nav li .dropdown li {
+  position: relative;
+  text-align: left;
+  background: transparent;
+  padding: 15px 15px;
+  padding-bottom: 0;
+  z-index: 2;
+  color: #3c3c3c;
+  display: block;
+}
+.sl-nav li .dropdown li:last-of-type {
+  padding-bottom: 15px;
+}
+.sl-nav li .dropdown li span {
+  padding-left: 5px;
+  font-size: 1.3rem;
+}
+.sl-nav li .dropdown li span.active {
+  color: var(--tag-color);
+}
+
+#languagepicker:checked ~ .triangle {
+  position: absolute;
+  top: 15px;
+  right: -10px;
+  z-index: 10;
+  height: 14px;
+  overflow: hidden;
+  width: 30px;
+  background: transparent;
+}
+
+#languagepicker:checked ~ .triangle:after {
+  content: '';
+  display: block;
+  z-index: 20;
+  width: 15px;
+  transform: rotate(45deg) translateY(0px) translatex(10px);
+  height: 15px;
+  background: var(--pre-bg-color);
+  border-radius: 2px 0px 0px 0px;
+  border-color: var(--border-color);
+  box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.2);
+  float: left;
+  display: block;
+}
+
 .sidebar {
   -webkit-background-size: cover;
   background-size: cover;
@@ -541,6 +628,7 @@
   margin: 30px;
   padding: 0px 0 56px 0;
   text-align: center;
+  font-size: 1.4rem;
 }
 
 .pagination ul {
@@ -963,7 +1051,31 @@
   display: none;
 }
 
-@media screen and (min-width: 960px), print {
+#TableOfContents {
+  display: block;
+  background: transparent;
+}
+
+#TableOfContents ul {
+  list-style: none;
+  line-height: 1.9em;
+  margin: 0;
+}
+
+#TableOfContents > ul {
+  padding-left: 0;
+}
+
+#TableOfContents li a {
+  display: inherit;
+  color: var(--link-color);
+}
+
+#TableOfContents li a:hover {
+  display: inherit;
+}
+
+@media screen and (min-width: 961px), print {
   header {
     border-bottom: 1px solid var(--border-color);
   }
@@ -1156,6 +1268,10 @@
     font-size: 1.3em;
   }
 
+  header .nav__list ul {
+    padding: inherit;
+  }
+
   header .nav__list a.current {
     border-bottom: none;
   }
@@ -1218,6 +1334,37 @@
     padding-bottom: 0px;
     padding-top: 0px;
   }
+
+  .triangle {
+    display: none;
+  }
+
+  .sl-nav {
+    padding-right: inherit;
+  }
+
+  .sl-nav li .dropdown {
+    right: inherit;
+    position: relative;
+    top: inherit;
+    padding-right: 0px;
+    background: none;
+    border-color: inherit;
+    box-shadow: none;
+  }
+
+  .sl-nav li .dropdown li {
+    text-align: center;
+    padding: initial;
+  }
+
+  .sl-nav li .dropdown li span {
+    padding-left: initial;
+  }
+
+  .sl-nav li label {
+    font-size: 0.75em;
+  }
 }
 
 /* Medium zoom */
@@ -1312,6 +1459,7 @@
   background-color: var(--bg-color);
   border: 1px solid var(--form-border-color);
   color: var(--body-color);
+  font-family: inherit;
 }
 .form-style ul li .field-style:focus {
   box-shadow: 0 0 5px;
diff --git a/assets/css/style.rtl.css b/assets/css/style.rtl.css
index 20f89c2..9ab54b2 100644
--- a/assets/css/style.rtl.css
+++ b/assets/css/style.rtl.css
@@ -1,5 +1,10 @@
 @charset "UTF-8";
 
+body {
+  font-family: 'Tajawal', sans-serif;
+  font-size: 1.5rem;
+}
+
 blockquote {
   border-right: 0.25em solid var(--blockquote-border-color);
   border-left: inherit;
@@ -26,6 +31,19 @@
   margin-right: inherit;
 }
 
+.sidebar .logo-title .title h3 {
+  text-transform: capitalize;
+  letter-spacing: 1.5px;
+}
+
+.post .post-title h1 {
+  text-transform: capitalize;
+}
+
+.post .post-title h3 {
+  text-transform: capitalize;
+}
+
 .post .post-footer .info .separator a {
   margin-left: 0.2em;
   margin-right: inherit;
@@ -73,7 +91,15 @@
   text-align: left;
 }
 
-@media screen and (min-width: 960px), print {
+.sl-nav li .dropdown {
+  padding-right: 0px;
+}
+
+.triangle {
+  display: none;
+}
+
+@media screen and (min-width: 961px), print {
   header {
     position: fixed;
     left: 0;
@@ -85,6 +111,9 @@
   header .nav__list li:not(:last-of-type) {
     padding-right: inherit;
   }
+  .triangle {
+    display: inline-block;
+  }
 }
 
 @media (min-width: 1921px) {
diff --git a/exampleSite/config/_default/config.toml b/exampleSite/config/_default/config.toml
index e6ee52e..c404a21 100644
--- a/exampleSite/config/_default/config.toml
+++ b/exampleSite/config/_default/config.toml
@@ -21,4 +21,9 @@
 [markup]
     [markup.goldmark]
         [markup.goldmark.renderer]
-        unsafe=true
\ No newline at end of file
+        unsafe=true
+
+[taxonomies]
+    category = "categories"
+    series = "series"
+    tag = "tags"
diff --git a/exampleSite/config/_default/languages.toml b/exampleSite/config/_default/languages.toml
index 94fd999..f8823c1 100644
--- a/exampleSite/config/_default/languages.toml
+++ b/exampleSite/config/_default/languages.toml
@@ -5,8 +5,8 @@
 contentDir = "content/english"
 
 [ar]
-title = "عربي"
-description = "أنا أحمد"
+title = "فلانة الفلانية"
+description = "أنا أعمل كمطورة ويب في شركة س"
 contentDir = "content/arabic" 
 weight = 2
 LanguageDirection = "rtl" 
diff --git a/exampleSite/config/_default/menus.ar.toml b/exampleSite/config/_default/menus.ar.toml
index c78242d..6562bdd 100644
--- a/exampleSite/config/_default/menus.ar.toml
+++ b/exampleSite/config/_default/menus.ar.toml
@@ -2,22 +2,22 @@
   name = "الرئيسية"
   identifier = "main"
   weight = 100
-  url = "/ar"
+  url = "/ar/"
 
   [[main]]
   name = "المنشورات"
   weight = 200
   identifier = "posts"
-  url = "/ar/post"
+  url = "/ar/post/"
 
   [[main]]
   name = "حول"
   weight = 300
   identifier = "about"
-  url = "/ar/about"
+  url = "/ar/about/"
 
   [[main]]
   name = "للتواصل"
   weight = 400
   identifier = "contact"
-  url = "/ar/contact"
\ No newline at end of file
+  url = "/ar/contact/"
\ No newline at end of file
diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml
index e6faf08..b45c45f 100644
--- a/exampleSite/config/_default/params.toml
+++ b/exampleSite/config/_default/params.toml
@@ -15,6 +15,8 @@
 doNotLoadAnimations = false
 # Form Spree Contact Form
 #contactFormAction = "https://formspree.io/f/your-form-hash-here"
+# Google Fonts
+#googleFonts = ["Indie+Flower", "Roboto:ital,wght@0,100;0,400;0,700;1,400"]
 # Google Site Verify
 #googleSiteVerify = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
 singleDateFormat = "2/1/2006"
diff --git a/exampleSite/content/arabic/post/arabic_example.md b/exampleSite/content/arabic/post/arabic_example.md
index 36a2176..ad7362a 100644
--- a/exampleSite/content/arabic/post/arabic_example.md
+++ b/exampleSite/content/arabic/post/arabic_example.md
@@ -17,3 +17,13 @@
 إذا كنت تحتاج إلى عدد أكبر من الفقرات يتيح لك مولد النص العربى زيادة عدد الفقرات كما تريد، النص لن يبدو مقسما ولا يحوي أخطاء لغوية، مولد النص العربى مفيد لمصممي المواقع على وجه الخصوص، حيث يحتاج العميل فى كثير من الأحيان أن يطلع على صورة حقيقية لتصميم الموقع.
 ومن هنا وجب على المصمم أن يضع نصوصا مؤقتة على التصميم ليظهر للعميل الشكل كاملاً،دور مولد النص العربى أن يوفر على المصمم عناء البحث عن نص بديل لا علاقة له بالموضوع الذى يتحدث عنه التصميم فيظهر بشكل لا يليق.
 هذا النص يمكن أن يتم تركيبه على أي تصميم دون مشكلة فلن يبدو وكأنه نص منسوخ، غير منظم، غير منسق، أو حتى غير مفهوم. لأنه مازال نصاً بديلاً ومؤقتاً.
+
+```html
+<!DOCTYPE html>
+<html>
+  <body>
+    <h1>My First Heading</h1>
+    <p>My first paragraph.</p>
+  </body>
+</html>
+```
diff --git a/exampleSite/content/english/post/series-part-1.md b/exampleSite/content/english/post/series-part-1.md
new file mode 100644
index 0000000..6d9e2de
--- /dev/null
+++ b/exampleSite/content/english/post/series-part-1.md
@@ -0,0 +1,41 @@
+---
+author: Hugo Authors
+title: Series Part 1
+date: 2021-08-14
+description: A brief guide to how to setup series part 1
+series:
+  - series-setup
+---
+
+In this first part of the series we'll show you how to create a series
+
+<!--more-->
+
+As a first step we need to add series as a taxonomy. We can do this by editing the `config.toml`.  
+Note: We always need to define the existing taxonomies as well.
+
+```toml
+[taxonomies]
+    category = "categories"
+    series = "series"
+    tag = "tags"
+```
+
+Now we have the series enabled, the next thing we need to do is add the series name in the FrontMatter.
+For our example we'll use this post and the next part.
+
+As you can see we've set the series to `series-setup`. We also do the same in the next parts of the series.  
+This end results should be a Front Matter that looks similar to this:
+
+```md
+---
+author: Hugo Authors
+title: Series Part 1
+date: 2021-08-14
+description: A brief guide to how to setup series part 1
+series:
+  - series-setup
+---
+```
+
+Each individual post will now also show the other posts in the series under the `Posts in this Series` heading.
diff --git a/exampleSite/content/english/post/series-part-2.md b/exampleSite/content/english/post/series-part-2.md
new file mode 100644
index 0000000..8a65463
--- /dev/null
+++ b/exampleSite/content/english/post/series-part-2.md
@@ -0,0 +1,17 @@
+---
+author: Hugo Authors
+title: Series Part 2
+date: 2021-08-15
+description: A brief guide to how to setup series part 2
+series:
+  - series-setup
+---
+
+In this second part of the series we'll show you where to find the full series
+
+<!--more-->
+
+When you created a series, you'll probably want to link to the full set of blogposts.  
+In this example we used `series-setup` as our series name.
+
+This means we can now go to `http://localhost:1313/series/series-setup/` to see all the blog posts of this serie.
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 67fb10a..751c31b 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -36,8 +36,21 @@
         {{ end }}
       </div>
 
+      {{- if (eq .Params.toc true) -}}
+        <h3>Table of Contents</h3>
+        {{ .TableOfContents }}
+
+
+      {{- end -}}
+
       {{ .Content }}
 
+      {{- if isset .Params "series" -}}
+        {{- partial "series.html" . -}}
+
+
+      {{- end -}}
+
       {{- if (eq .Params.contact true) -}}
         {{- partial "contact.html" . -}}
 
@@ -82,6 +95,13 @@
         </div>
 
       {{- end -}}
+      {{- if .Site.Params.gitalk.repo -}}
+        <div id="fb_comments_container">
+          <h2>{{ i18n "comments" }}</h2>
+          {{ partial "comments/gitalk.html" . }}
+        </div>
+
+      {{- end -}}
 
 
     {{ end }}
diff --git a/layouts/index.html b/layouts/index.html
index 61cabf7..aa74958 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -114,7 +114,7 @@
 
   {{ end }}
   <div class="pagination">
-    {{ template "_internal/pagination.html" . }}
+    {{ template "partials/pagination.html" . }}
   </div>
 
 {{ end }}
diff --git a/layouts/partials/comments/gitalk.html b/layouts/partials/comments/gitalk.html
new file mode 100644
index 0000000..2c61f83
--- /dev/null
+++ b/layouts/partials/comments/gitalk.html
@@ -0,0 +1,33 @@
+<div id="gitalk-container"></div>
+<link
+  rel="stylesheet"
+  href="https://cdnjs.cloudflare.com/ajax/libs/gitalk/1.7.2/gitalk.min.css"
+  integrity="sha512-0hsIlRjJbiUWaKMhXXNDmjWI2qPvUlhNBLHMhqeF5jIma+bedec27N5FoT2JEeHz5TUmOGCsm1Y89EsX/P0wOg=="
+  crossorigin="anonymous"
+  referrerpolicy="no-referrer"
+/>
+<script
+  src="https://cdnjs.cloudflare.com/ajax/libs/gitalk/1.7.2/gitalk.min.js"
+  integrity="sha512-EcTCcXV46teiNwe0VcnM5A038tcY+BaQYO4nW6Gh2i7v4/HjBVg7xx3+JBLl9WofDds//INJAiEGAtdgr8PWyA=="
+  crossorigin="anonymous"
+  referrerpolicy="no-referrer"
+></script>
+<script>
+  const gitalk = new Gitalk({
+    clientID: '{{ .Site.Params.Gitalk.clientID }}',
+    clientSecret: '{{ .Site.Params.Gitalk.clientSecret }}',
+    repo: '{{ .Site.Params.Gitalk.repo }}',
+    owner: '{{ .Site.Params.Gitalk.owner }}',
+    admin: ['{{ .Site.Params.Gitalk.admin }}'],
+    id: location.pathname, // Ensure uniqueness and length less than 50
+    distractionFreeMode: false, // Facebook-like distraction free mode
+  });
+  (function () {
+    if (['localhost', '127.0.0.1'].indexOf(window.location.hostname) != -1) {
+      document.getElementById('gitalk-container').innerHTML =
+        'Gitalk comments not available by default when the website is previewed locally.';
+      return;
+    }
+    gitalk.render('gitalk-container');
+  })();
+</script>
diff --git a/layouts/partials/contact.html b/layouts/partials/contact.html
index e7a0b68..6589869 100644
--- a/layouts/partials/contact.html
+++ b/layouts/partials/contact.html
@@ -15,7 +15,10 @@
         <textarea class="field-style" name="message" id="message" rows="6" placeholder="{{ i18n "message" }}"></textarea>
       </li>
       <li>
-        <input class="field-style" type="submit" value="{{ i18n "send" }}"></input>
+        <input class="field-style" type="submit" value="{{ i18n "send" }}" />
+      </li>
+      <li>
+        <input type="text" name="_gotcha" style="display:none" />
       </li>
     </ul>
   </form>
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index 5a148b9..87e46ba 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -34,7 +34,7 @@
 {{- partial "medium-zoom.html" .context -}}
 {{- partial "math.html" .context -}}
 {{- template "_internal/google_analytics_async.html" .context -}}
-{{- if and (hugo.IsProduction) (.Site.Params.gtagId) -}}
+{{- if and (hugo.IsProduction) (.context.Site.Params.gtagId) -}}
   {{ partial "google-analytics-gtag-async.html" .context }}
 
 
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 768d0a3..11a6794 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -46,6 +46,11 @@
     type="text/css"
   />
   {{ if eq .Site.Language.LanguageDirection "rtl" }}
+    <!-- Arabic font -->
+    <link
+      rel="stylesheet"
+      href="https://fonts.googleapis.com/css?family=Tajawal:300,500,700&display=swap&subset=arabic"
+    />
     {{ $templateStyle := resources.Get "css/style.rtl.css" }}
     {{ $style := $templateStyle  | resources.ExecuteAsTemplate "css/main.rtl.css" . | resources.Minify | resources.Fingerprint }}
     <link
@@ -94,6 +99,17 @@
     />
 
   {{- end -}}
+  {{ if .Site.Params.googleFonts }}
+    {{ $baseUrl := "https://fonts.googleapis.com/css2?family=" }}
+    {{ $fontParam := delimit .Site.Params.googleFonts "&family=" }}
+    {{ $url := printf "%s" "&display=swap" | printf "%s%s" $fontParam | printf "%s%s" $baseUrl | printf "%s" }}
+    <link rel="preconnect" href="https://fonts.googleapis.com" />
+    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
+    <link href="{{ $url }}" rel="stylesheet" />
+
+  {{- end -}}
+
+
   <!-- Favicons -->
   <link rel="shortcut icon" href="{{ .Site.Params.favicon | relURL }}favicon.ico" type="image/x-icon" />
   <link rel="apple-touch-icon" sizes="180x180" href="{{ .Site.Params.favicon | relURL }}apple-touch-icon.png" />
@@ -185,4 +201,8 @@
 
 
   {{- end }}
+
+
+  <!-- Schema.org-->
+  {{ partial "schema.html" . }}
 </head>
diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html
index 92f87f6..0c465d3 100644
--- a/layouts/partials/navbar.html
+++ b/layouts/partials/navbar.html
@@ -35,23 +35,49 @@
           </li>
 
         {{ end }}
-        {{ if .Site.IsMultiLingual }}
-          {{ range $.Site.Home.AllTranslations }}
-            <li><a href="{{ .RelPermalink }}" title="{{ .Language.LanguageName }}">{{ .Language.LanguageName }}</a></li>
-
-          {{ end }}
-
-
-        {{ end }}
       </div>
-      <li>
-        {{ if not .Site.Params.disableThemeSwitcher }}
-          <a class="theme-switch" title="Switch Theme">
-            <i class="fas fa-adjust fa-fw" aria-hidden="true"></i>
-          </a>
+      <ul>
+        {{ if and .IsTranslated .Site.IsMultiLingual }}
+          <li>
+            <ul class="sl-nav" aria-label="Language switcher">
+              <li>
+                <input type="checkbox" id="languagepicker" aria-label="switch language" hidden />
+                <label for="languagepicker"><a>{{ .Site.Language.LanguageName }}</a></label>
+                <label for="languagepicker"><i class="fa fa-angle-down" aria-hidden="true"></i></label>
+                <div class="triangle"></div>
+
+                <ul class="dropdown">
+                  {{ range $.Translations }}
+
+                    <li>
+                      <a href="{{ .RelPermalink }}" title="{{ .Language.LanguageName }}"
+                        ><span
+                          {{ if eq . $.Site.Language }}
+                            class="active"
+
+                          {{ end }}
+                          aria-label="{{ i18n "ariaLanguage" }}{{ .Language.LanguageName }}"
+                          >{{ .Language.LanguageName }}</span
+                        ></a
+                      >
+                    </li>
+
+                  {{ end }}
+                </ul>
+              </li>
+            </ul>
+          </li>
 
         {{ end }}
-      </li>
+        {{ if not .Site.Params.disableThemeSwitcher }}
+          <li>
+            <a class="theme-switch" title="Switch Theme">
+              <i class="fas fa-adjust fa-fw" aria-hidden="true"></i>
+            </a>
+          </li>
+
+        {{ end }}
+      </ul>
     </ul>
   </nav>
 </div>
diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html
new file mode 100644
index 0000000..a5b315c
--- /dev/null
+++ b/layouts/partials/pagination.html
@@ -0,0 +1,54 @@
+{{ if gt .Paginator.TotalPages 1 }}
+  <ul class="pagination">
+    {{ $.Scratch.Set "hasPrevDots" false }}
+    {{ $.Scratch.Set "hasNextDots" false }}
+    {{ if .Paginator.HasPrev }}
+      <li class="page-item">
+        <a class="page-link" href="{{ .Paginator.Prev.URL }}">
+          <i class="fa fa-angle-left" aria-label="上一页"></i>
+        </a>
+      </li>
+
+    {{ end }}
+    {{ range .Paginator.Pagers }}
+      {{ if eq . $.Paginator }}
+        <li class="page-item">
+          <span class="page-link current">
+            {{- .PageNumber -}}
+          </span>
+        </li>
+
+      {{ else if or (or (eq . $.Paginator.First) (eq . $.Paginator.Prev)) (or  (eq . $.Paginator.Next) (eq . $.Paginator.Last )) }}
+        <li class="page-item">
+          <a class="page-link" href="{{ .URL }}">
+            {{- .PageNumber -}}
+          </a>
+        </li>
+
+      {{ else }}
+        {{ if and (not ($.Scratch.Get "hasPrevDots")) (lt .PageNumber $.Paginator.PageNumber) }}
+          {{ $.Scratch.Set "hasPrevDots" true }}
+          <span class="page-link dots">&hellip;</span>
+
+        {{ else if and (not ($.Scratch.Get "hasNextDots")) (gt .PageNumber $.Paginator.PageNumber) }}
+          {{ $.Scratch.Set "hasNextDots" true }}
+          <span class="page-link dots">&hellip;</span>
+
+        {{ end }}
+
+
+      {{ end }}
+
+
+    {{ end }}
+    {{ if .Paginator.HasNext }}
+      <li class="page-item">
+        <a class="page-link" href="{{ .Paginator.Next.URL }}">
+          <i class="fa fa-angle-right" aria-label="下一页"></i>
+        </a>
+      </li>
+
+    {{ end }}
+  </ul>
+
+{{ end }}
diff --git a/layouts/partials/schema.html b/layouts/partials/schema.html
new file mode 100644
index 0000000..6696200
--- /dev/null
+++ b/layouts/partials/schema.html
@@ -0,0 +1,121 @@
+{{ if .IsHome -}}
+  <script type="application/ld+json">
+    {
+      "@context": "http://schema.org",
+      "@type": "WebSite",
+      "name": "{{ .Site.Title }}",
+      "url": "{{ .Site.BaseURL }}",
+      "description": "{{ .Site.Params.description }}",
+      "thumbnailUrl": "{{ .Site.Params.Logo | absURL }}",
+      "license": "{{ .Site.Params.Copyright }}"
+    }
+  </script>
+
+{{ else if .IsPage }}
+  {{ $author :=  or (.Params.author) (.Site.Params.author) }}
+  {{ $favicon := .Site.Params.favicon | absURL }}
+  <script type="application/ld+json">
+    {
+        "@context": "http://schema.org",
+        "@type": "BlogPosting",
+        "articleSection": "{{ .Section }}",
+        "name": "{{ .Title | safeJS }}",
+        "headline": "{{ .Title | safeJS }}",
+        "alternativeHeadline": "{{ .Params.lead }}",
+        "description": "{{ if .Description }}
+      {{ .Description | safeJS }}
+
+
+    {{ else }}
+      {{ if .IsPage }}
+        {{ .Summary }}
+
+
+      {{ end }}
+
+
+    {{ end }}",
+        "inLanguage": {{ .Site.LanguageCode | default "en-us" }},
+        "isFamilyFriendly": "true",
+        "mainEntityOfPage": {
+            "@type": "WebPage",
+            "@id": "{{ .Permalink }}"
+        },
+        "author" : {
+            "@type": "Person",
+            "name": "{{ $author }}"
+        },
+        "creator" : {
+            "@type": "Person",
+            "name": "{{ $author }}"
+        },
+        "accountablePerson" : {
+            "@type": "Person",
+            "name": "{{ $author }}"
+        },
+        "copyrightHolder" : {
+            "@type": "Person",
+            "name": "{{ $author }}"
+        },
+        "copyrightYear" : "{{ .Date.Format "2006" }}",
+        "dateCreated": "{{ .Date.Format "2006-01-02T15:04:05.00Z" | safeHTML }}",
+        "datePublished": "{{ .PublishDate.Format "2006-01-02T15:04:05.00Z" | safeHTML }}",
+        "dateModified": "{{ .Lastmod.Format "2006-01-02T15:04:05.00Z" | safeHTML }}",
+        "publisher":{
+            "@type":"Organization",
+            "name": {{ $author }},
+            "url": {{ .Site.BaseURL }},
+            "logo": {
+                "@type": "ImageObject",
+                "url": "{{ (printf "%s%s" $favicon "favicon-32x32.png") }}",
+                "width":"32",
+                "height":"32"
+            }
+        },
+        "image": {{ if .Params.images }}
+      [{{ range $i, $e := .Params.images }}
+        {{ if $i }}
+          ,
+
+        {{ end }}
+        {{ $e | absURL }}
+
+
+      {{ end }}
+      ]
+
+    {{ else }}
+      [{{ range $i, $e := .Site.Params.images }}
+        {{ if $i }}
+          ,
+
+        {{ end }}
+        {{ $e | absURL }}
+
+
+      {{ end }}
+      ]
+
+    {{ end }},
+        "url" : "{{ .Permalink }}",
+        "wordCount" : "{{ .WordCount }}",
+        "genre" : [ {{ range $index, $tag := .Params.categories }}
+      {{ if $index }}
+        ,
+
+      {{ end }}
+      "{{ $tag }}"
+
+    {{ end }}],
+        "keywords" : [ {{ range $index, $keyword := .Params.tags }}
+      {{ if $index }}
+        ,
+
+      {{ end }}
+      "{{ $keyword }}"
+
+    {{ end }}]
+    }
+  </script>
+
+{{ end }}
diff --git a/layouts/partials/series.html b/layouts/partials/series.html
new file mode 100644
index 0000000..380be46
--- /dev/null
+++ b/layouts/partials/series.html
@@ -0,0 +1,10 @@
+{{ $related := where .Site.RegularPages ".Params.series" "intersect" .Params.series }}
+
+
+<h3>Posts in this Series</h3>
+<ul>
+  {{ range $related }}
+    <li><a href="{{ .Page.RelPermalink }}">{{ .Page.Title }}</a></li>
+
+  {{ end }}
+</ul>
diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html
index 3115678..5afdd6f 100644
--- a/layouts/partials/sidebar.html
+++ b/layouts/partials/sidebar.html
@@ -11,7 +11,7 @@
     <div class="logo-title">
       <div class="title">
         <img src="{{ .Site.Params.profilePicture | relURL }}" alt="profile picture" />
-        <h3 title=""><a href="/">{{ .Site.Params.Title }}</a></h3>
+        <h3 title=""><a href="{{ .Site.BaseURL | relURL }}">{{ .Site.Params.Title }}</a></h3>
         <div class="description">
           <p>{{ replace .Site.Params.description "\n" "<br />" | safeHTML }}</p>
         </div>

--
Gitblit v1.10.0