Skip to content

Commit 16a86a9

Browse files
Merge pull request #226 from RalphHightower/RalphHightower-patch-68
feat: add _includes
2 parents 3bdbf06 + 63e1035 commit 16a86a9

File tree

8 files changed

+129
-0
lines changed

8 files changed

+129
-0
lines changed

_includes/custom-head.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{% comment %}
2+
Placeholder to allow defining custom head, in principle, you can add anything here, e.g. favicons:
3+
4+
1. Head over to https://realfavicongenerator.net/ to add your own favicons.
5+
2. Customize default _includes/custom-head.html in your source directory and insert the given code snippet.
6+
{% endcomment %}

_includes/disqus_comments.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{%- if page.comments != false and jekyll.environment == "production" -%}
2+
3+
<div id="disqus_thread"></div>
4+
<script>
5+
var disqus_config = function () {
6+
this.page.url = '{{ page.url | absolute_url }}';
7+
this.page.identifier = '{{ page.url | absolute_url }}';
8+
};
9+
10+
(function() {
11+
var d = document, s = d.createElement('script');
12+
13+
s.src = 'https://{{ site.disqus.shortname }}.disqus.com/embed.js';
14+
15+
s.setAttribute('data-timestamp', +new Date());
16+
(d.head || d.body).appendChild(s);
17+
})();
18+
</script>
19+
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
20+
{%- endif -%}

_includes/footer.html

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<footer class="site-footer h-card">
2+
<data class="u-url" href="{{ "/" | relative_url }}"></data>
3+
4+
<div class="wrapper">
5+
6+
<div class="footer-col-wrapper">
7+
<div class="footer-col">
8+
<p class="feed-subscribe">
9+
<a href="{{ site.feed.path | default: 'feed.xml' | absolute_url }}">
10+
<svg class="svg-icon orange">
11+
<use xlink:href="{{ 'assets/minima-social-icons.svg#rss' | relative_url }}"></use>
12+
</svg><span>Subscribe</span>
13+
</a>
14+
</p>
15+
{%- if site.author %}
16+
<ul class="contact-list">
17+
{% if site.author.name -%}
18+
<li class="p-name">{{ site.author.name | escape }}</li>
19+
{% endif -%}
20+
{% if site.author.email -%}
21+
<li><a class="u-email" href="mailto:{{ site.author.email }}">{{ site.author.email }}</a></li>
22+
{%- endif %}
23+
</ul>
24+
{%- endif %}
25+
</div>
26+
<div class="footer-col">
27+
<p>{{ site.description | escape }}</p>
28+
</div>
29+
</div>
30+
31+
<div class="social-links">
32+
{%- include social.html -%}
33+
</div>
34+
35+
</div>
36+
37+
</footer>

_includes/google-analytics.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
2+
<script>
3+
window['ga-disable-{{ site.google_analytics }}'] = window.doNotTrack === "1" || navigator.doNotTrack === "1" || navigator.doNotTrack === "yes" || navigator.msDoNotTrack === "1";
4+
window.dataLayer = window.dataLayer || [];
5+
function gtag(){window.dataLayer.push(arguments);}
6+
gtag('js', new Date());
7+
8+
gtag('config', '{{ site.google_analytics }}');
9+
</script>

_includes/head.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<head>
2+
<meta charset="utf-8">
3+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
4+
<meta name="viewport" content="width=device-width, initial-scale=1">
5+
{%- seo -%}
6+
<link rel="stylesheet" href="{{ "/assets/css/style.css" | relative_url }}">
7+
{%- feed_meta -%}
8+
{%- if jekyll.environment == 'production' and site.google_analytics -%}
9+
{%- include google-analytics.html -%}
10+
{%- endif -%}
11+
12+
{%- include custom-head.html -%}
13+
14+
</head>

_includes/header.html

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<header class="site-header">
2+
3+
<div class="wrapper">
4+
{%- assign default_paths = site.pages | map: "path" -%}
5+
{%- assign page_paths = site.header_pages | default: default_paths -%}
6+
{%- assign titles_size = site.pages | map: 'title' | join: '' | size -%}
7+
<a class="site-title" rel="author" href="{{ "/" | relative_url }}">{{ site.title | escape }}</a>
8+
9+
{%- if titles_size > 0 -%}
10+
<nav class="site-nav">
11+
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
12+
<label for="nav-trigger">
13+
<span class="menu-icon">
14+
<svg viewBox="0 0 18 15" width="18px" height="15px">
15+
<path d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.032C17.335,0,18,0.665,18,1.484L18,1.484z M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.032C17.335,6.031,18,6.696,18,7.516L18,7.516z M18,13.516C18,14.335,17.335,15,16.516,15H1.484 C0.665,15,0,14.335,0,13.516l0,0c0-0.82,0.665-1.483,1.484-1.483h15.032C17.335,12.031,18,12.695,18,13.516L18,13.516z"/>
16+
</svg>
17+
</span>
18+
</label>
19+
20+
<div class="trigger">
21+
{%- for path in page_paths -%}
22+
{%- assign my_page = site.pages | where: "path", path | first -%}
23+
{%- if my_page.title -%}
24+
<a class="page-link" href="{{ my_page.url | relative_url }}">{{ my_page.title | escape }}</a>
25+
{%- endif -%}
26+
{%- endfor -%}
27+
</div>
28+
</nav>
29+
{%- endif -%}
30+
</div>
31+
</header>

_includes/social-item.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<li>{% assign entry = include.item %}
2+
<a {% unless entry.platform == 'rss' %}rel="me" {% endunless %}href="{{ entry.user_url }}" target="_blank" title="{{ entry.title | default: entry.platform }}">
3+
<svg class="svg-icon grey">
4+
<use xlink:href="{{ '/assets/minima-social-icons.svg#' | append: entry.platform | relative_url }}"></use>
5+
</svg>
6+
</a>
7+
</li>

_includes/social.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<ul class="social-media-list">
2+
{%- for entry in site.minima.social_links -%}
3+
{%- include social-item.html item = entry -%}
4+
{%- endfor -%}
5+
</ul>

0 commit comments

Comments
 (0)