aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/_includes/common/header.html
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2022-03-22 12:32:10 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2022-03-22 12:32:10 +0300
commit7b8f2865857b528b1f2b1e8e30fec2e6eafd8469 (patch)
tree3c695e1c31eafe04d740d31d96638b0e5761cccf /_includes/common/header.html
parentREADME: update (diff)
downloadjekyll-theme-7b8f2865857b528b1f2b1e8e30fec2e6eafd8469.tar.gz
jekyll-theme-7b8f2865857b528b1f2b1e8e30fec2e6eafd8469.zip
get rid of custom_{css,js} in favour of a generic mechanism
Diffstat (limited to '_includes/common/header.html')
-rw-r--r--_includes/common/header.html31
1 files changed, 19 insertions, 12 deletions
diff --git a/_includes/common/header.html b/_includes/common/header.html
index 6798ec1..82c3801 100644
--- a/_includes/common/header.html
+++ b/_includes/common/header.html
@@ -47,20 +47,27 @@
<link rel="stylesheet" href="{{ '/assets/css/main.css' | relative_url }}">
- {% if page.custom_css %}
- {% for css in page.custom_css %}
- {% assign abs_check = css | downcase | split: '//' %}
- {% if abs_check[0] == 'http:' or abs_check[0] == 'https:' or abs_check[0] == blank %}
- {% assign url = css %}
- {% else %}
- {% assign url = '/assets/css/' | relative_url | append: css %}
- {% endif %}
- <link rel="stylesheet" href="{{ url }}">
- {% endfor %}
+ {% assign links = '' | split: '' %}
+ {% if site.settings.links %}
+ {% assign links = links | concat: site.settings.links %}
+ {% endif %}
+ {% if page.links %}
+ {% assign links = links | concat: page.links %}
{% endif %}
- {% for link in site.settings.links %}
- <link{% for attr in link %} {{ attr[0] }}="{{ attr[1] }}"{% endfor %}>
+ {% for link in links %}
+ {% assign abs_check = link.href | downcase | split: '//' %}
+ {% if abs_check[0] == 'http:' or abs_check[0] == 'https:' or abs_check[0] == '' %}
+ {% assign url = link.href %}
+ {% else %}
+ {% assign abs_check = link.href | slice: 0 %}
+ {% if abs_check == '/' %}
+ {% assign url = link.href %}
+ {% else %}
+ {% assign url = link.href | relative_url %}
+ {% endif %}
+ {% endif %}
+ <link href="{{ url }}"{% for attr in link %}{% if attr[0] == 'href' %}{% continue %}{% endif %} {{ attr[0] }}="{{ attr[1] }}"{% endfor %}>
{% endfor %}
{% if site.settings.ga_tag %}