aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/_includes/common/header.html
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2021-11-04 19:32:06 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2021-11-05 13:01:33 +0300
commitea2cac77bbb0b01b42e4c50acf733056141fcd83 (patch)
tree22af069250b139c541dfbd3b3d62c73ca6a94843 /_includes/common/header.html
parentREADME: fix a typo (diff)
downloadjekyll-theme-ea2cac77bbb0b01b42e4c50acf733056141fcd83.tar.gz
jekyll-theme-ea2cac77bbb0b01b42e4c50acf733056141fcd83.zip
pick up default site.settings values from site.github
Also, use the default filter more, it's much more convenient.
Diffstat (limited to '_includes/common/header.html')
-rw-r--r--_includes/common/header.html24
1 files changed, 18 insertions, 6 deletions
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 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
- {% 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 @@
</head>
<body>
<div class="top-level-footer-wrapper">
- {% if site.settings.navbar.hide or page.navbar.hide %}
- {% else %}
+ {% unless site.settings.navbar.hide or page.navbar.hide %}
<div class="footer-wrapper-collapse">
{% include common/navbar.html %}
</div>
- {% endif %}
+ {% endunless %}
<div class="footer-wrapper-expand">
<div class="container">