aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/_includes/common
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2022-03-23 16:52:53 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2022-03-23 16:56:55 +0300
commitc8bbc25228a7d199ca6868db7375f1661c3ef6e4 (patch)
treeb6b3c84795e441c05cc2d2a7fbbbfc34a492b377 /_includes/common
parentindex.html: reuse page.title (diff)
downloadjekyll-theme-c8bbc25228a7d199ca6868db7375f1661c3ef6e4.tar.gz
jekyll-theme-c8bbc25228a7d199ca6868db7375f1661c3ef6e4.zip
_includes: move everything to jekyll-theme/
Diffstat (limited to '_includes/common')
-rw-r--r--_includes/common/footer.html72
-rw-r--r--_includes/common/ga.html9
-rw-r--r--_includes/common/header.html80
-rw-r--r--_includes/common/navbar.html66
-rw-r--r--_includes/common/sidebar.html47
-rw-r--r--_includes/common/sidebar_entry.html4
6 files changed, 0 insertions, 278 deletions
diff --git a/_includes/common/footer.html b/_includes/common/footer.html
deleted file mode 100644
index 9331784..0000000
--- a/_includes/common/footer.html
+++ /dev/null
@@ -1,72 +0,0 @@
- </div>
- <footer class="navbar-default">
- <div class="container">
- <div class="row">
- <div class="col-xs-12 text-center">
-
-{% if site.settings.project.license_file %}
- {% capture license_file %}{{ '/' | relative_url }}{{ site.settings.project.license_file }}{% endcapture %}
-{% else %}
- {% for file in site.static_files %}
- {% assign path = file.path | downcase %}
- {% if path == 'license' or path == 'license.txt' %}
- {% assign license_file = file.path | relative_url %}
- {% endif %}
- {% endfor %}
-{% endif %}
-{% if site.settings.project.license %}
- {% assign license = site.settings.project.license %}
- {% unless license_file %}
- {% capture license_file %}https://spdx.org/licenses/{{ license }}.html{% endcapture %}
- {% capture license %}{{ license }} License{% endcapture %}
- {% endunless %}
-{% elsif site.github.license %}
- {% assign license = site.github.license.name %}
- {% unless license_file %}
- {% capture license_file %}https://spdx.org/licenses/{{ site.github.license.spdx_id }}.html{% endcapture %}
- {% endunless %}
-{% endif %}
-{% if license %}
- {% capture license_text %}License: <a href="{{ license_file }}">{{ license }}</a>{% endcapture %}
-{% elsif license_file %}
- {% capture license_text %}License: <a href="{{ license_file }}">click here</a>{% endcapture %}
-{% endif %}
-
-{% capture sep %}<span style="padding: 0 1em;">|</span>{% endcapture %}
-{% capture timestamp_text %}Last update: {{ site.time | date: '%-d %B %Y' }}{% endcapture %}
-<div class="small text-muted">
- {% if license_text %}{{ license_text }}{{ sep }}{% endif %}{{ timestamp_text }}
-</div>
-
- </div>
- </div>
- </div>
- </footer>
- </div>
- <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
- <script src="{{ '/assets/bootstrap/js/bootstrap.min.js' | relative_url }}"></script>
-
- {% assign scripts = '' | split: '' %}
- {% if site.settings.scripts %}
- {% assign scripts = scripts | concat: site.settings.scripts %}
- {% endif %}
- {% if page.scripts %}
- {% assign scripts = scripts | concat: page.scripts %}
- {% endif %}
-
- {% for script in scripts %}
- {% assign abs_check = script.src | downcase | split: '//' %}
- {% if abs_check[0] == 'http:' or abs_check[0] == 'https:' or abs_check[0] == '' %}
- {% assign url = script.src %}
- {% else %}
- {% assign abs_check = script.src | slice: 0 %}
- {% if abs_check == '/' %}
- {% assign url = script.src %}
- {% else %}
- {% assign url = script.src | relative_url %}
- {% endif %}
- {% endif %}
- <script src="{{ url }}"{% for attr in script %}{% if attr[0] == 'src' %}{% continue %}{% endif %} {{ attr[0] }}="{{ attr[1] }}"{% endfor %}></script>
- {% endfor %}
- </body>
-</html>
diff --git a/_includes/common/ga.html b/_includes/common/ga.html
deleted file mode 100644
index 56eaca7..0000000
--- a/_includes/common/ga.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!-- Global site tag (gtag.js) - Google Analytics -->
-<script async src="https://www.googletagmanager.com/gtag/js?id={{ include.ga_tag }}"></script>
-<script>
- window.dataLayer = window.dataLayer || [];
- function gtag(){dataLayer.push(arguments);}
- gtag('js', new Date());
-
- gtag('config', '{{ include.ga_tag }}');
-</script>
diff --git a/_includes/common/header.html b/_includes/common/header.html
deleted file mode 100644
index 07ba1c5..0000000
--- a/_includes/common/header.html
+++ /dev/null
@@ -1,80 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
-
- {% assign project_name = site.settings.project.name %}
- {% unless project_name %}
- {% if site.github %}
- {% comment %}
- What the damn hell? site.github.is_project_page is set to true even
- for my root user site (the one with the .github.io suffix).
- TODO: remove the following workaround and replace with a simple check
- site.github.is_project_page above when this is fixed?
- {% endcomment %}
- {% capture assumed_user_name %}{{ site.github.owner_name }}.github.io{% endcapture %}
- {% if site.github.repository_name != assumed_user_name %}
- {% assign project_name = site.github.repository_name %}
- {% endif %}
- {% 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 %}{{ author_name }}{% endcapture %}
- {% endif %}
- {% if page.url != '/' %}
- {% capture title %}{{ page.title }} - {{ title }}{% endcapture %}
- {% endif %}
- <title>{{ title }}</title>
-
- <link rel="stylesheet" href="{{ '/assets/bootstrap/css/bootstrap.min.css' | relative_url }}">
- <!--[if lt IE 9]>
- <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
- <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
- <![endif]-->
-
- {% include mathjax.html %}
-
- <link rel="stylesheet" href="{{ '/assets/css/jekyll-theme.css' | relative_url }}">
-
- {% 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 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 %}
- {% include common/ga.html ga_tag=site.settings.ga_tag %}
- {% endif %}
- </head>
- <body>
- <div style="display: flex; flex-direction: column; min-height: 100vh;">
- {% include common/navbar.html %}
- <div class="container" style="flex: 1;">
diff --git a/_includes/common/navbar.html b/_includes/common/navbar.html
deleted file mode 100644
index 67db12e..0000000
--- a/_includes/common/navbar.html
+++ /dev/null
@@ -1,66 +0,0 @@
-{% unless site.settings.navbar.hide or page.navbar.hide %}
-<nav class="navbar navbar-default navbar-static-top">
- <div class="container">
- <div class="navbar-header">
- <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
- <span class="sr-only">Toggle navigation</span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </button>
- {% 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' %}
- <a class="navbar-brand" href="/">{{ author_name }}</a>
- </div>
- <div class="navbar-collapse collapse">
- <ul class="nav navbar-nav">
- {% assign page_list = site.pages | where_exp: "x","x.navbar.link" | sort: "navbar.priority" %}
- {% for node in page_list %}
- {% comment %}
- Whether a page should be present in the navbar is determined by
- the presense of navbar.link in the page's front matter. It can be
- true, in which case page's title is used, or it can be custom HTML.
-
- If the page is paginated, it should be marked as such by setting
- navbar.paginated to true in its front matter. That way, /pageN/
- pages, which would have the same navbar_link, wouldn't appear in
- the navbar.
- {% endcomment %}
- {% if node.navbar.paginated %}
- {% if navbar_has_paginated %}
- {% continue %}
- {% endif %}
- {% assign navbar_has_paginated = true %}
- {% endif %}
- {% assign link = node.navbar.link %}
- {% if link == true %}
- {% assign link = node.title %}
- {% endif %}
- {% capture link %}{{ link | upcase }}{% endcapture %}
- {% assign icon = node.navbar.icon %}
- {% if icon %}
- {% capture icon %}<span class="glyphicon glyphicon-{{ icon }}"></span>&nbsp;{% endcapture %}
- {% endif %}
- {% if page.url == node.url %}
- <li class="active"><a href="{{ node.url | relative_url }}" class="active">{{ icon }}{{ link }}</a></li>
- {% else %}
- <li><a href="{{ node.url | relative_url }}">{{ icon }}{{ link }}</a></li>
- {% endif %}
- {% endfor %}
-
- {% if site.github and site.settings.navbar.github != false %}
- {% assign github_link = site.settings.navbar.github.link | default: 'GitHub' %}
- {% assign github_icon = site.settings.navbar.github.icon | default: 'globe' %}
- {% capture github_icon %}<span class="glyphicon glyphicon-{{ github_icon }}"></span>&nbsp;{% endcapture %}
- <li><a href="{{ site.github.repository_url }}" target="_blank">{{ github_icon }}{{ github_link | upcase }}</a></li>
- {% endif %}
- </ul>
- </div>
- </div>
-</nav>
-{% endunless %}
diff --git a/_includes/common/sidebar.html b/_includes/common/sidebar.html
deleted file mode 100644
index 4eeeac2..0000000
--- a/_includes/common/sidebar.html
+++ /dev/null
@@ -1,47 +0,0 @@
-{% unless site.settings.sidebar.hide or page.sidebar.hide %}
-<div class="row">
-
-{% capture about_content %}
-{% assign project_desc = site.settings.project.description %}
-{% unless project_desc %}
- {% if site.github %}
- {% assign project_desc = site.github.project_tagline %}
- {% endif %}
-{% endunless %}
-{% if project_desc %}
- {% capture project_desc %}{{ project_desc }}. {% endcapture %}
-{% endif %}
-{% capture project_desc %}{{ project_desc }}Feel free to contribute or contact me.{% endcapture %}
-<p>{{ project_desc }}</p>
-<div class="list-group wide-enough">
- {% if site.github %}
- {% assign github_link = site.settings.navbar.github.link | default: 'GitHub' %}
- {% assign github_icon = site.settings.navbar.github.icon | default: 'globe' %}
- {% capture github_icon %}<span class="glyphicon glyphicon-{{ github_icon }}"></span>&nbsp;{% endcapture %}
- <a class="list-group-item" href="{{ site.github.repository_url }}" target="_blank">{{ github_icon }}{{ github_link }}</a>
- {% endif %}
- {% assign author_email = site.settings.author.email | default: 'John.Doe@example.com' %}
- <a class="list-group-item" href="mailto:{{ author_email }}"><span class="glyphicon glyphicon-envelope"></span>&nbsp;{{ author_email }}</a>
-</div>
-{% endcapture %}
-
-{% include common/sidebar_entry.html header='About' content=about_content %}
-
-{% if site.posts.size > 0 %}
-
-{% capture latest_posts_content %}
-<div class="list-group wide-enough">
- {% for post in site.posts limit: 5 %}
- <a class="list-group-item" href="{{ post.url | relative_url }}">
- <span class="badge"><span class="glyphicon glyphicon-time"></span>&nbsp;{{ post.date | date: '%-d %b %Y' }}</span>
- <span class="glyphicon glyphicon-file"></span>&nbsp;{{ post.title }}
- </a>
- {% endfor %}
-</div>
-{% endcapture %}
-
-{% include common/sidebar_entry.html header='Latest posts' content=latest_posts_content %}
-{% endif %}
-
-</div>
-{% endunless %}
diff --git a/_includes/common/sidebar_entry.html b/_includes/common/sidebar_entry.html
deleted file mode 100644
index 761119d..0000000
--- a/_includes/common/sidebar_entry.html
+++ /dev/null
@@ -1,4 +0,0 @@
-<div class="col-xs-12 col-sm-6 col-md-12">
- <h4>{{ include.header }}</h4>
- {{ include.content }}
-</div>