From ea2cac77bbb0b01b42e4c50acf733056141fcd83 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Thu, 4 Nov 2021 19:32:06 +0300 Subject: pick up default site.settings values from site.github Also, use the default filter more, it's much more convenient. --- _includes/common/footer.html | 2 +- _includes/common/header.html | 24 ++++++++++++++++++------ _includes/common/navbar.html | 28 ++++++++++++---------------- _includes/common/sidebar.html | 17 +++++++++++++++-- 4 files changed, 46 insertions(+), 25 deletions(-) (limited to '_includes/common') diff --git a/_includes/common/footer.html b/_includes/common/footer.html index 0d7a2a0..7b16e98 100644 --- a/_includes/common/footer.html +++ b/_includes/common/footer.html @@ -6,7 +6,7 @@
-
This project is licensed under the terms of the {{ site.settings.project.license }}. See License for details.
+
This project is licensed under the terms of the {{ site.settings.project.license | default: 'MIT License' }}. See License for details.
diff --git a/_includes/common/header.html b/_includes/common/header.html index 81d7cbf..fc99302 100644 --- a/_includes/common/header.html +++ b/_includes/common/header.html @@ -5,10 +5,23 @@ - {% if site.settings.project.name %} - {% capture title %}{{ site.settings.project.name }} - {{ site.settings.author.name }}{% endcapture %} + {% assign project_name = site.settings.project.name %} + {% unless project_name %} + {% if site.github && site.github.is_project_page %} + {% assign project_name = site.github.repository_name %} + {% endif %} + {% endunless %} + {% assign author_name = site.settings.author.name %} + {% unless author_name %} + {% if site.github %} + {% assign author_name = site.github.owner_name %} + {% endif %} + {% endunless %} + {% assign author_name = author_name | default: 'John Doe' %} + {% if project_name %} + {% capture title %}{{ project_name }} - {{ author_name }}{% endcapture %} {% else %} - {% capture title %}{{ site.settings.author.name }}{% endcapture %} + {% capture title %}{{ author_name }}{% endcapture %} {% endif %} {% if page.url != '/' %} {% capture title %}{{ page.title }} - {{ title }}{% endcapture %} @@ -39,11 +52,10 @@