jekyll-theme-switch 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aae47871456f3c6e9630d8cb01cce692cb6827da23ca97b2784eae7580da46b5
4
- data.tar.gz: b55fcb12119f6417c976e3fa5a89e9ed326a1662c7c50777bd6ceed386ec1058
3
+ metadata.gz: 0f91fdbd29c08c049e873104ce8a9d3a8a14735ac77594ea1f36c4200374973e
4
+ data.tar.gz: b9c7b7e1f107c5c8de11212298fa681336e7f8661175eb40832b9a9f2c645f9f
5
5
  SHA512:
6
- metadata.gz: e1f6a03ccd584df49c02ab9b5f7fea86a6054e4e35c011f638b213607450fda3a6aaa37588f83dd617b3e6170c257ac57a7e545ac071f9924fbee40b0710797b
7
- data.tar.gz: 0d663a1f75225348a84f9cc3f8855a8fb5a5b75d2bfd618a9103c1a93afb46b5330909d32d38ce34db81d782ed9d9312f32b683fa041c8e7ba46e0a68a242c9c
6
+ metadata.gz: 55c1055b62a2141b5196c3685de1bd1602fe721a603dd458cfabf2718abf3a694bef1d974dc96122b6a30f49fc70955f3cd1149ce9600cd3c6d4acd1f4416a38
7
+ data.tar.gz: d8ec20b50f7cbd243fcfcd5624aa3275b2a2aa70d62f5b0940824fe3034b3f0b9c23042a9d6369e738ca59633474bc655800891fc9db620ba4051fe3ba1934ab
data/README.md CHANGED
@@ -13,10 +13,12 @@ git 'https://gitlab.com/islandsvinur/jekyll-theme-switch.git' do
13
13
  end
14
14
  ```
15
15
 
16
- Run `bundle install`, then set the theme in your `_config.yml`:
16
+ Run `bundle install`, then set the theme and add the plugin in your `_config.yml`:
17
17
 
18
18
  ```
19
19
  theme: jekyll-theme-switch
20
+ plugins:
21
+ - jekyll-theme-switch
20
22
  ```
21
23
 
22
24
  ## Usage
data/_data/i18n.yaml ADDED
@@ -0,0 +1,42 @@
1
+ read_more: Read more
2
+
3
+ archives:
4
+ index_header: Archives
5
+ yearly_header: Yearly archive for %{year}
6
+ monthly_header: Monthly archive for %{month}
7
+
8
+ category: Category
9
+ tag: Tag
10
+
11
+ series: This post is part of the series
12
+
13
+ nav:
14
+ next: Next
15
+ previous: Previous
16
+ page_of_pages: Page %{page} of %{pages}
17
+
18
+ rss:
19
+ originally_posted: Originally posted on
20
+
21
+ date:
22
+ months:
23
+ - January
24
+ - February
25
+ - March
26
+ - April
27
+ - May
28
+ - June
29
+ - July
30
+ - August
31
+ - September
32
+ - October
33
+ - November
34
+ - December
35
+ weekday:
36
+ - Monday
37
+ - Tuesday
38
+ - Wednesday
39
+ - Thursday
40
+ - Friday
41
+ - Saturday
42
+ - Sunday
data/_includes/date.html CHANGED
@@ -1,4 +1 @@
1
- <time datetime="{{ include.date | date_to_xmlschema }}">{{ include.date | date: "%-d" }}
2
- {% assign m = include.date | date: "%-m" %}
3
- {% include month.html month=m %}
4
- {{ include.date | date: "%Y" }}</time>
1
+ <time datetime="{{ include.date | date_to_xmlschema }}">{{ include.date | date: "%-d" }} {% include month.html date=include.date %} {{ include.date | date: "%Y" }}</time>
@@ -16,7 +16,7 @@
16
16
  <ul class="social-media-list">
17
17
  {% if site.gitlab_username %}
18
18
  <li>
19
- <a href="https://gitlab.com/{{ site.gitlab_username }}" rel="me">
19
+ <a title="GitLab" href="https://gitlab.com/{{ site.gitlab_username }}" rel="me">
20
20
  <span class="icon icon--gitlab">
21
21
  <svg viewBox="0 0 100 100">
22
22
  <path d="m50 96h0l18.42-56.63h-36.82z" fill="#9c9b9b"/>
@@ -34,7 +34,7 @@
34
34
 
35
35
  {% if site.github_username %}
36
36
  <li>
37
- <a href="https://github.com/{{ site.github_username }}" rel="me">
37
+ <a title="GitHub" href="https://github.com/{{ site.github_username }}" rel="me">
38
38
  <span class="icon icon--github">
39
39
  <svg viewBox="0 0 16 16">
40
40
  <path fill="#828282" d="M7.999,0.431c-4.285,0-7.76,3.474-7.76,7.761 c0,3.428,2.223,6.337,5.307,7.363c0.388,0.071,0.53-0.168,0.53-0.374c0-0.184-0.007-0.672-0.01-1.32 c-2.159,0.469-2.614-1.04-2.614-1.04c-0.353-0.896-0.862-1.135-0.862-1.135c-0.705-0.481,0.053-0.472,0.053-0.472 c0.779,0.055,1.189,0.8,1.189,0.8c0.692,1.186,1.816,0.843,2.258,0.645c0.071-0.502,0.271-0.843,0.493-1.037 C4.86,11.425,3.049,10.76,3.049,7.786c0-0.847,0.302-1.54,0.799-2.082C3.768,5.507,3.501,4.718,3.924,3.65 c0,0,0.652-0.209,2.134,0.796C6.677,4.273,7.34,4.187,8,4.184c0.659,0.003,1.323,0.089,1.943,0.261 c1.482-1.004,2.132-0.796,2.132-0.796c0.423,1.068,0.157,1.857,0.077,2.054c0.497,0.542,0.798,1.235,0.798,2.082 c0,2.981-1.814,3.637-3.543,3.829c0.279,0.24,0.527,0.713,0.527,1.437c0,1.037-0.01,1.874-0.01,2.129 c0,0.208,0.14,0.449,0.534,0.373c3.081-1.028,5.302-3.935,5.302-7.362C15.76,3.906,12.285,0.431,7.999,0.431z"/>
@@ -48,7 +48,7 @@
48
48
 
49
49
  {% if site.twitter_username %}
50
50
  <li>
51
- <a href="https://twitter.com/{{ site.twitter_username }}" rel="me">
51
+ <a title="Twitter" href="https://twitter.com/{{ site.twitter_username }}" rel="me">
52
52
  <span class="icon icon--twitter">
53
53
  <svg viewBox="0 0 16 16">
54
54
  <path fill="#828282" d="M15.969,3.058c-0.586,0.26-1.217,0.436-1.878,0.515c0.675-0.405,1.194-1.045,1.438-1.809
@@ -61,9 +61,45 @@
61
61
  </li>
62
62
  {% endif %}
63
63
 
64
+ {% if site.mastodon_profile %}
65
+ <li>
66
+ <a title="Mastodon" href="{{ site.mastodon_profile | mastodon_url }}" rel="me">
67
+ <span class="icon icon--mastodon">
68
+ <svg viewBox="0 0 74 79">
69
+ <path fill="#828282" d="M73.7014 17.9592C72.5616 9.62034 65.1774 3.04876 56.424 1.77536C54.9472
70
+ 1.56019 49.3517 0.7771 36.3901 0.7771H36.2933C23.3281 0.7771 20.5465 1.56019 19.0697 1.77536C10.56
71
+ 3.01348 2.78877 8.91838 0.903306 17.356C-0.00357857 21.5113 -0.100361 26.1181 0.068112
72
+ 30.3439C0.308275 36.404 0.354874 42.4535 0.91406 48.489C1.30064 52.498 1.97502 56.4751 2.93215
73
+ 60.3905C4.72441 67.6217 11.9795 73.6395 19.0876 76.0945C26.6979 78.6548 34.8821 79.0799 42.724
74
+ 77.3221C43.5866 77.1245 44.4398 76.8953 45.2833 76.6342C47.1867 76.0381 49.4199 75.3714 51.0616
75
+ 74.2003C51.0841 74.1839 51.1026 74.1627 51.1156 74.1382C51.1286 74.1138 51.1359 74.0868 51.1368
76
+ 74.0592V68.2108C51.1364 68.185 51.1302 68.1596 51.1185 68.1365C51.1069 68.1134 51.0902 68.0932 51.0695
77
+ 68.0773C51.0489 68.0614 51.0249 68.0503 50.9994 68.0447C50.9738 68.0391 50.9473 68.0392 50.9218
78
+ 68.045C45.8976 69.226 40.7491 69.818 35.5836 69.8087C26.694 69.8087 24.3031 65.6569 23.6184
79
+ 63.9285C23.0681 62.4347 22.7186 60.8764 22.5789 59.2934C22.5775 59.2669 22.5825 59.2403 22.5934
80
+ 59.216C22.6043 59.1916 22.621 59.1702 22.6419 59.1533C22.6629 59.1365 22.6876 59.1248 22.714
81
+ 59.1191C22.7404 59.1134 22.7678 59.1139 22.794 59.1206C27.7345 60.2936 32.799 60.8856 37.8813
82
+ 60.8843C39.1036 60.8843 40.3223 60.8843 41.5447 60.8526C46.6562 60.7115 52.0437 60.454 57.0728
83
+ 59.4874C57.1983 59.4628 57.3237 59.4416 57.4313 59.4098C65.3638 57.9107 72.9128 53.2051 73.6799
84
+ 41.2895C73.7086 40.8204 73.7803 36.3758 73.7803 35.889C73.7839 34.2347 74.3216 24.1533 73.7014
85
+ 17.9592ZM61.4925 47.6918H53.1514V27.5855C53.1514 23.3526 51.3591 21.1938 47.7136 21.1938C43.7061
86
+ 21.1938 41.6988 23.7476 41.6988 28.7919V39.7974H33.4078V28.7919C33.4078 23.7476 31.3969 21.1938
87
+ 27.3894 21.1938C23.7654 21.1938 21.9552 23.3526 21.9516 27.5855V47.6918H13.6176V26.9752C13.6176
88
+ 22.7423 14.7157 19.3795 16.9118 16.8868C19.1772 14.4 22.1488 13.1231 25.8373 13.1231C30.1064 13.1231
89
+ 33.3325 14.7386 35.4832 17.9662L37.5587 21.3949L39.6377 17.9662C41.7884 14.7386 45.0145 13.1231
90
+ 49.2765 13.1231C52.9614 13.1231 55.9329 14.4 58.2055 16.8868C60.4017 19.3772 61.4997 22.74 61.4997
91
+ 26.9752L61.4925 47.6918Z"/>
92
+ </svg>
93
+ </span>
94
+
95
+ <span class="username">{{ site.mastodon_profile }}</span>
96
+ </a>
97
+ </li>
98
+ {% endif %}
99
+
64
100
  {% if site.instagram_username %}
65
101
  <li>
66
- <a href="https://instagram.com/{{ site.instagram_username }}"
102
+ <a title="Instagram" href="https://instagram.com/{{ site.instagram_username }}"
67
103
  rel="me">
68
104
  <span class="icon icon--instagram">
69
105
  <svg viewBox="0 0 512 512">
@@ -79,7 +115,7 @@
79
115
  </li>
80
116
  {% endif %}
81
117
  <li>
82
- <a href="{{ "/feed.xml" | prepend: site.baseurl }}">
118
+ <a title="RSS" href="{{ "/feed.xml" | prepend: site.baseurl }}">
83
119
  <span class="icon">
84
120
  <svg viewBox="0 0 256 256">
85
121
  <circle cx="68" cy="189" r="24" fill="#828282"/>
@@ -100,8 +136,7 @@
100
136
 
101
137
  <div class="footer-col-wrapper">
102
138
  <div class="footer-wide">
103
- Generated by <a href="https://jekyllrb.com/">Jekyll</a>
104
- and the <a href="https://islandsvinur.gitlab.io/jekyll-theme-switch/">Logging the Switch theme</a>.
139
+ {% include footer_text.html %}
105
140
  </div>
106
141
  </div>
107
142
 
@@ -0,0 +1,5 @@
1
+ Generated by <a href="https://jekyllrb.com/">Jekyll</a>
2
+ and the <a href="https://islandsvinur.gitlab.io/jekyll-theme-switch/">Logging the Switch theme</a>.
3
+ {% if site.site_repository_base_url %}
4
+ <a href="{{ site.site_repository_base_url }}/{{ page.path }}">Edit this page</a>.
5
+ {% endif %}
data/_includes/head.html CHANGED
@@ -1,45 +1,42 @@
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">
1
+ <meta charset="utf-8">
2
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
3
+ <meta name="viewport" content="width=device-width, initial-scale=1">
5
4
 
6
- {% if page.excerpt %}
7
- {% assign description = page.excerpt | strip_html | normalize_whitespace | truncate: 160 %}
8
- {% else %}
9
- {% assign description = site.description | markdownify | strip_html | normalize_whitespace %}
10
- {% endif %}
11
- {% if page.title %}{% assign title = page.title %}{% else %}{% assign title = site.title %}{% endif %}
12
- <title>{{ title }}</title>
13
- <meta name="description" content="{{ description }}">
5
+ {% if page.excerpt %}
6
+ {% assign description = page.excerpt | strip_html | normalize_whitespace | truncate: 160 %}
7
+ {% else %}
8
+ {% assign description = site.description | markdownify | strip_html | normalize_whitespace %}
9
+ {% endif %}
10
+ <title>{% include page_title.html %}</title>
11
+ <meta name="description" content="{{ description }}">
14
12
 
15
- <link rel="stylesheet" href="{{ "/assets/css/jekyll-theme-switch.css" | prepend: site.baseurl }}">
16
- <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
17
- {% if page.previous %}<link rel="prev" href="{{ page.previous.url | absolute_url }}">{% endif %}
18
- {% assign canonical_url = page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url %}
19
- <link rel="canonical" href="{{ canonical_url }}">
20
- {% if page.next %}<link rel="next" href="{{ page.next.url | absolute_url }}">{% endif %}
21
- <link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}" />
13
+ <link rel="stylesheet" href="{{ "/assets/css/jekyll-theme-switch.css" | prepend: site.baseurl }}">
14
+ <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"/>
15
+ {% if page.previous %}<link rel="prev" href="{{ page.previous.url | absolute_url }}">{% endif %}
16
+ {% assign canonical_url = page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url %}
17
+ <link rel="canonical" href="{{ canonical_url }}">
18
+ {% if page.next %}<link rel="next" href="{{ page.next.url | absolute_url }}">{% endif %}
19
+ <link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}" />
22
20
 
23
- {% for link in site.links %}
24
- <link rel="{{ link.rel }}" href="{{ link.href }}" />
25
- {% endfor %}
21
+ {% for link in site.links %}
22
+ <link rel="{{ link.rel }}" href="{{ link.href }}"/>
23
+ {% endfor %}
26
24
 
27
- <meta property="og:title" content="{{ title }}">
28
- <meta property="og:description" content="{{ description }}">
29
- <meta property="og:site_name" content="{{ site.title }}">
30
- <meta property="og:url" content="{{ canonical_url }}">
31
- {% if page.lead_image %}
32
- <meta property="og:image" content="{{ page.lead_image | absolute_url }}" />
33
- {% endif %}
25
+ <meta property="og:title" content="{% include page_title.html %}">
26
+ <meta property="og:description" content="{{ description }}">
27
+ <meta property="og:site_name" content="{{ site.title }}">
28
+ <meta property="og:url" content="{{ canonical_url }}">
29
+ {% if page.lead_image %}
30
+ <meta property="og:image" content="{{ page.lead_image | absolute_url }}"/>
31
+ {% endif %}
34
32
 
35
- {% if page.lead_image %}
36
- <meta property="twitter:card" content="summary_large_image" />
37
- <meta property="twitter:image" content="{{ page.lead_image | absolute_url }}" />
38
- {% else %}
39
- <meta property="twitter:card" content="summary" />
40
- {% endif %}
41
- <meta property="twitter:title" content="{{ title }}" />
42
- <meta property="twitter:description" content="{{ description }}" />
43
- {% if site.twitter_username %}<meta property="twitter:creator" content="@{{ site.twitter_username }}" />{% endif %}
44
- <meta property="twitter:site" content="{{ canonical_url }}" />
45
- </head>
33
+ {% if page.lead_image %}
34
+ <meta property="twitter:card" content="summary_large_image"/>
35
+ <meta property="twitter:image" content="{{ page.lead_image | absolute_url }}"/>
36
+ {% else %}
37
+ <meta property="twitter:card" content="summary"/>
38
+ {% endif %}
39
+ <meta property="twitter:title" content="{% include page_title.html %}"/>
40
+ <meta property="twitter:description" content="{{ description }}"/>
41
+ {% if site.twitter_username %}<meta property="twitter:creator" content="@{{ site.twitter_username }}"/>{% endif %}
42
+ <meta property="twitter:site" content="{{ canonical_url }}"/>
data/_includes/month.html CHANGED
@@ -1,14 +1,7 @@
1
- {% case include.month %}
2
- {% when '1' %}januari
3
- {% when '2' %}februari
4
- {% when '3' %}maart
5
- {% when '4' %}april
6
- {% when '5' %}mei
7
- {% when '6' %}juni
8
- {% when '7' %}juli
9
- {% when '8' %}augustus
10
- {% when '9' %}september
11
- {% when '10' %}oktober
12
- {% when '11' %}november
13
- {% when '12' %}december
14
- {% endcase %}
1
+ {% if include.date %}
2
+ {% assign m = include.date | date: "%-m" | minus: 1 %}
3
+ {{ site.data.i18n.date.months | slice: m }}
4
+ {% else %}
5
+ {% assign m = include.month | minus: 1 %}
6
+ {{ site.data.i18n.date.months | slice: m }}
7
+ {% endif %}
@@ -0,0 +1 @@
1
+ {% if page.title %}{{ page.title | append: " ≪ " | append: site.title }}{% else %}{{ site.title }}{% endif %}
@@ -0,0 +1,24 @@
1
+ <!-- Pagination links -->
2
+ <div class="pagination">
3
+ {% if paginator.previous_page %}
4
+ <a href="{{ paginator.previous_page_path | prepend: site.baseurl }}" class="previous button">
5
+ <i class="material-icons">keyboard_arrow_left</i> {{ site.data.i18n.nav.previous }}
6
+ </a>
7
+ {% else %}
8
+ <span class="previous button">
9
+ <i class="material-icons">keyboard_arrow_left</i> {{ site.data.i18n.nav.previous }}
10
+ </span>
11
+ {% endif %}
12
+ <span class="page_number" style="display: flex; align-items: center">
13
+ {{ site.data.i18n.nav.page_of_pages | params: page: paginator.page, pages: paginator.total_pages }}
14
+ </span>
15
+ {% if paginator.next_page %}
16
+ <a href="{{ paginator.next_page_path | prepend: site.baseurl }}" class="next button">
17
+ {{ site.data.i18n.nav.next }} <i class="material-icons">keyboard_arrow_right</i>
18
+ </a>
19
+ {% else %}
20
+ <span class="next button">
21
+ {{ site.data.i18n.nav.next }} <i class="material-icons">keyboard_arrow_right</i>
22
+ </span>
23
+ {% endif %}
24
+ </div>
@@ -0,0 +1,34 @@
1
+ {% if post.lead_image %}
2
+ <style type="text/css" scoped>
3
+ li#post-{{ post.id | slugify }} {
4
+ background-image: radial-gradient(farthest-corner at 100% 0, rgba(255,255,255,0.7) 33%, rgba(255,255,255,1) 66%),
5
+ url('{{ post.lead_image | prepend: site.baseurl | prepend: site.url }}');
6
+ background-size: cover;
7
+ background-repeat: no-repeat;
8
+ background-position: right center;
9
+ }
10
+
11
+ @media (prefers-color-scheme: dark) {
12
+ li#post-{{ post.id | slugify }} {
13
+ background-image: radial-gradient(farthest-corner at 100% 0, rgba(31,31,31,0.7) 33%, rgba(31,31,31,1) 66%),
14
+ url('{{ post.lead_image | prepend: site.baseurl | prepend: site.url }}');
15
+ }
16
+ }
17
+ </style>
18
+ {% endif %}
19
+
20
+ <li id="post-{{ post.id | slugify }}">
21
+ <article>
22
+ {% include post_meta.html post=post %}
23
+
24
+ <h2>
25
+ <a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
26
+ </h2>
27
+
28
+ <div class="post-content">
29
+ {{ post.content }}
30
+ </div>
31
+
32
+ <a class="read-more" href="{{ post.url | prepend: site.baseurl }}">{{ site.data.i18n.read_more }}</a>
33
+ </article>
34
+ </li>
@@ -0,0 +1,7 @@
1
+
2
+ <ul class="post-list">
3
+ {% assign first = true %}
4
+ {% for post in include.posts %}
5
+ {% include post_item.html post=post %}
6
+ {% endfor %}
7
+ </ul>
@@ -8,6 +8,15 @@
8
8
  </span>
9
9
  <span class="meta-text">{% include date.html date=include.post.date %}</span>
10
10
  </li>
11
+ {% if include.post.modified_date %}
12
+ <li>
13
+ <span class="meta-icon">
14
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path
15
+ d="M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3v7.12zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8h1.5z"/></svg>
16
+ </span>
17
+ <span class="meta-text">{% include date.html date=include.post.modified_date %}</span>
18
+ </li>
19
+ {% endif %}
11
20
  <li>
12
21
  <span class="meta-icon">
13
22
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path
@@ -0,0 +1,22 @@
1
+ <nav class="post-nav">
2
+ {% if page.previous %}
3
+ <a href="{{ page.previous.url | prepend: site.baseurl }}"
4
+ class="previous button" title="{{ page.previous.title }}">
5
+ <i class="material-icons">keyboard_arrow_left</i> {{ site.data.i18n.nav.previous }}
6
+ </a>
7
+ {% else %}
8
+ <span class="previous button disabled">
9
+ <i class="material-icons">keyboard_arrow_left</i> {{ site.data.i18n.nav.previous }}
10
+ </span>
11
+ {% endif %}
12
+ {% if page.next %}
13
+ <a href="{{ page.next.url | prepend: site.baseurl }}" class="next button"
14
+ title="{{ page.next.title }}">
15
+ {{ site.data.i18n.nav.next }} <i class="material-icons">keyboard_arrow_right</i>
16
+ </a>
17
+ {% else %}
18
+ <span class="next button disabled">
19
+ {{ site.data.i18n.nav.next }} <i class="material-icons">keyboard_arrow_right</i>
20
+ </span>
21
+ {% endif %}
22
+ </nav>
@@ -0,0 +1,3 @@
1
+ <language>en-US</language>
2
+ <title>{{ site.title | xml_escape }}</title>
3
+ <description>{{ site.description | markdownify | strip_html | normalize_whitespace }}</description>
@@ -1,4 +1,4 @@
1
1
  {{ post.content | xml_escape }}
2
- &lt;p&gt;&lt;em&gt;Originally posted on
2
+ &lt;p&gt;&lt;em&gt;{{ site.data.i18n.rss.originally_posted }}
3
3
  &lt;a href='{{ post.url | prepend: site.baseurl | prepend: site.url }}'&gt;{{ site.title | xml_escape }}&lt;/a&gt;.
4
4
  &lt;/em&gt;&lt;/p&gt;
@@ -3,7 +3,7 @@ layout: wrapped
3
3
  ---
4
4
  <div class="archives">
5
5
  <div>
6
- <h1 class="title">Archieven</h1>
6
+ <h1 class="title">{{ site.data.i18n.archives.index_header }}</h1>
7
7
  </div>
8
8
  <div>
9
9
  <ul>
@@ -3,42 +3,7 @@ layout: wrapped
3
3
  ---
4
4
 
5
5
  <div class="category-index">
6
- <h1 class="page-heading">{{ page.title | capitalize | replace: "Ij", "IJ" }}</h1>
6
+ <h1 class="page-heading">{{ site.data.i18n.category }}: {{ page.title | capitalize | replace: "Ij", "IJ" }}</h1>
7
7
 
8
- <ul class="post-list">
9
- {% for post in page.posts %}
10
- {% if post.lead_image %}
11
- <style type="text/css" scoped>
12
- li#post-{{ post.id | slugify }} {
13
- background-image: radial-gradient(farthest-corner at 100% 0, rgba(255,255,255,0.7) 33%, rgba(255,255,255,1) 66%),
14
- url('{{ post.lead_image | prepend: site.baseurl | prepend: site.url }}');
15
- background-size: cover;
16
- background-repeat: no-repeat;
17
- background-position-x: right;
18
- }
19
-
20
- @media (prefers-color-scheme: dark) {
21
- li#post-{{ post.id | slugify }} {
22
- background-image: radial-gradient(farthest-corner at 100% 0, rgba(31,31,31,0.7) 33%, rgba(31,31,31,1) 66%),
23
- url('{{ post.lead_image | prepend: site.baseurl | prepend: site.url }}');
24
- }
25
- }
26
- </style>
27
- {% endif %}
28
- <li id="post-{{ post.id | slugify }}">
29
- <article>
30
-
31
- {% include post_meta.html post=post %}
32
-
33
- <h2>
34
- <a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
35
- </h2>
36
- <div>
37
- {{ post.excerpt }}
38
- </div>
39
- <a href="{{ post.url | prepend: site.baseurl }}">lees verder</a>
40
- </article>
41
- </li>
42
- {% endfor %}
43
- </ul>
8
+ {% include post_list.html posts=page.posts %}
44
9
  </div>
@@ -1,7 +1,9 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
3
 
4
+ <head>
4
5
  {% include head.html %}
6
+ </head>
5
7
 
6
8
  <body>
7
9
 
data/_layouts/home.html CHANGED
@@ -4,75 +4,8 @@ layout: wrapped
4
4
 
5
5
  <div class="home">
6
6
 
7
- <ul class="post-list">
8
- {% assign first = true %}
9
- {% for post in paginator.posts %}
10
- {% if post.lead_image %}
11
- <style type="text/css" scoped>
12
- li#post-{{ post.id | slugify }} {
13
- background-image: radial-gradient(farthest-corner at 100% 0, rgba(255,255,255,0.7) 33%, rgba(255,255,255,1) 66%),
14
- url('{{ post.lead_image | prepend: site.baseurl | prepend: site.url }}');
15
- background-size: cover;
16
- background-repeat: no-repeat;
17
- background-position: right center;
18
- }
19
-
20
- @media (prefers-color-scheme: dark) {
21
- li#post-{{ post.id | slugify }} {
22
- background-image: radial-gradient(farthest-corner at 100% 0, rgba(31,31,31,0.7) 33%, rgba(31,31,31,1) 66%),
23
- url('{{ post.lead_image | prepend: site.baseurl | prepend: site.url }}');
24
- }
25
- }
26
- </style>
27
- {% endif %}
28
- <li id="post-{{ post.id | slugify }}">
29
- <article>
30
- {% include post_meta.html post=post %}
31
-
32
- <h2>
33
- <a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
34
- </h2>
35
- {% if paginator.page == 1 and first %}
36
- <div>
37
- {{ post.content }}
38
- {% assign first = false %}
39
- </div>
40
- {% else %}
41
- <div>
42
- {{ post.excerpt }}
43
- </div>
44
- <a href="{{ post.url | prepend: site.baseurl }}">lees verder</a>
45
- {% endif %}
46
- </article>
47
- </li>
48
- {% endfor %}
49
- </ul>
50
-
51
- <!-- Pagination links -->
52
- <div class="pagination">
53
- {% if paginator.previous_page %}
54
- <a href="{{ paginator.previous_page_path | prepend: site.baseurl }}" class="previous button">
55
- <i class="material-icons">keyboard_arrow_left</i> Vorige
56
- </a>
57
- {% else %}
58
- <span class="previous button">
59
- <i class="material-icons">keyboard_arrow_left</i> Vorige
60
- </span>
61
- {% endif %}
62
- <span class="page_number" style="display: flex; align-items: center">
63
- Pagina: {{ paginator.page }} van {{ paginator.total_pages }}
64
- </span>
65
- {% if paginator.next_page %}
66
- <a href="{{ paginator.next_page_path | prepend: site.baseurl }}" class="next button">
67
- Volgende <i class="material-icons">keyboard_arrow_right</i>
68
- </a>
69
- {% else %}
70
- <span class="next button">
71
- Volgende <i class="material-icons">keyboard_arrow_right</i>
72
- </span>
73
- {% endif %}
74
- </div>
75
-
7
+ {% include post_list.html posts=paginator.posts %}
76
8
 
9
+ {% include paginator_nav.html %}
77
10
 
78
11
  </div>
@@ -3,8 +3,8 @@ layout: wrapped
3
3
  ---
4
4
  <div class="monthly-archive">
5
5
  <div>
6
- {% assign m = page.date | date: "%-m" %}
7
- <h1 class="title">Maandarchief voor <time datetime="{{ page.date | date: '%Y-%m' }}">{% include month.html month=m %} {{ page.date | date: "%Y" }}</time></h1>
6
+ {% capture month %}<time datetime="{{ page.date | date: '%Y-%m' }}">{% include month.html date=page.date %} {{ page.date | date: "%Y" }}</time>{% endcapture %}
7
+ <h1 class="title">{{ site.data.i18n.archives.monthly_header | params: month: month }}</h1>
8
8
  </div>
9
9
  <div>
10
10
  <dl>
data/_layouts/post.html CHANGED
@@ -38,27 +38,6 @@ layout: default
38
38
  {% include disqus.html %}
39
39
  {% endunless %}
40
40
 
41
- <div class="post-nav">
42
- {% if page.previous %}
43
- <a href="{{ page.previous.url | prepend: site.baseurl }}"
44
- class="previous button" title="{{ page.previous.title }}">
45
- <i class="material-icons">keyboard_arrow_left</i> Vorige
46
- </a>
47
- {% else %}
48
- <span class="previous button disabled">
49
- <i class="material-icons">keyboard_arrow_left</i> Vorige
50
- </span>
51
- {% endif %}
52
- {% if page.next %}
53
- <a href="{{ page.next.url | prepend: site.baseurl }}" class="next button"
54
- title="{{ page.next.title }}">
55
- Volgende <i class="material-icons">keyboard_arrow_right</i>
56
- </a>
57
- {% else %}
58
- <span class="next button disabled">
59
- Volgende <i class="material-icons">keyboard_arrow_right</i>
60
- </span>
61
- {% endif %}
62
- </div>
41
+ {% include post_nav.html %}
63
42
  </div>
64
43
  </div>
data/_layouts/rss.html CHANGED
@@ -1,8 +1,7 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
3
3
  <channel>
4
- <title>{{ site.title | xml_escape }}</title>
5
- <description>{{ site.description | markdownify | strip_html | normalize_whitespace }}</description>
4
+ {% include rss/channel.html %}
6
5
  <link>{{ site.url }}{{ site.baseurl }}/</link>
7
6
  <atom:link href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}" rel="self" type="application/rss+xml"/>
8
7
  <pubDate>{{ site.time | date_to_rfc822 }}</pubDate>
@@ -3,11 +3,11 @@ layout: post
3
3
  ---
4
4
  {% assign series_index = page.series_index[0] %}
5
5
  <div class="series-header">
6
- <p>This post is part of the series <a href="{{ series_index.url | prepend: site.baseurl }}">{{ series_index.title }}</a>.</p>
6
+ <p>{{ site.data.i18n.series }}: <a href="{{ series_index.url | prepend: site.baseurl }}">{{ series_index.title }}</a>.</p>
7
7
  </div>
8
8
  {{ content }}
9
9
  <div class="series-footer">
10
- <p>This post is part of the series <a href="{{ series_index.url | prepend: site.baseurl }}">{{ series_index.title }}</a>.</p>
10
+ <p>{{ site.data.i18n.series }}: <a href="{{ series_index.url | prepend: site.baseurl }}">{{ series_index.title }}</a>.</p>
11
11
  <ul>
12
12
  {% for post in series_index.series_posts %}
13
13
  <li><a href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a></li>
@@ -3,41 +3,7 @@ layout: wrapped
3
3
  ---
4
4
 
5
5
  <div class="tag-index">
6
- <h1 class="page-heading">{{ page.title | capitalize | replace: "Ij", "IJ" }}</h1>
6
+ <h1 class="page-heading">{{ site.data.i18n.tag }}: {{ page.title | capitalize | replace: "Ij", "IJ" }}</h1>
7
7
 
8
- <ul class="post-list">
9
- {% for post in page.posts %}
10
- {% if post.lead_image %}
11
- <style type="text/css" scoped>
12
- li#post-{{ post.id | slugify }} {
13
- background-image: radial-gradient(farthest-corner at 100% 0, rgba(255,255,255,0.7) 33%, rgba(255,255,255,1) 66%),
14
- url('{{ post.lead_image | prepend: site.baseurl | prepend: site.url }}');
15
- background-size: cover;
16
- background-repeat: no-repeat;
17
- background-position-x: right;
18
- }
19
-
20
- @media (prefers-color-scheme: dark) {
21
- li#post-{{ post.id | slugify }} {
22
- background-image: radial-gradient(farthest-corner at 100% 0, rgba(31,31,31,0.7) 33%, rgba(31,31,31,1) 66%),
23
- url('{{ post.lead_image | prepend: site.baseurl | prepend: site.url }}');
24
- }
25
- }
26
- </style>
27
- {% endif %}
28
- <li id="post-{{ post.id | slugify }}">
29
- <article>
30
- {% include post_meta.html post=post %}
31
-
32
- <h2>
33
- <a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
34
- </h2>
35
- <div>
36
- {{ post.excerpt }}
37
- </div>
38
- <a href="{{ post.url | prepend: site.baseurl }}">lees verder</a>
39
- </article>
40
- </li>
41
- {% endfor %}
42
- </ul>
8
+ {% include post_list.html posts=page.posts %}
43
9
  </div>
@@ -3,7 +3,8 @@ layout: wrapped
3
3
  ---
4
4
  <div class="yearly-archive">
5
5
  <div>
6
- <h1 class="title">Jaararchief voor <time datetime="{{ page.date | date: '%Y' }}">{{ page.date | date: "%Y" }}</time></h1>
6
+ {% capture year %}<time datetime="{{ page.date | date: '%Y' }}">{{ page.date | date: "%Y" }}</time>{% endcapture %}
7
+ <h1 class="title">{{ site.data.i18n.archives.yearly_header | params: year: year }}</h1>
7
8
  </div>
8
9
  <div>
9
10
  {% assign posts = page.posts | group_by_exp: "post", "post.date | date: '%-m'" %}
@@ -15,7 +15,6 @@
15
15
 
16
16
  body,
17
17
  .page-content,
18
- .post-content,
19
18
  {
20
19
  background-color: $background-color-dark;
21
20
  }
@@ -33,6 +32,11 @@
33
32
  background-color: lighten($background-color-dark, 5%);
34
33
  }
35
34
 
35
+ .category-index ul.post-list > li article a.read-more, .tag-index ul.post-list > li article a.read-more, .home ul.post-list > li article a.read-more {
36
+ background: lighten($background-color-dark, 5%);
37
+ box-shadow: 0 -12px 50px 50px lighten($background-color-dark, 5%);
38
+ }
39
+
36
40
  .post-content {
37
41
  td, th {
38
42
  border-bottom-color: $brand-color-dark;
@@ -82,6 +82,46 @@
82
82
  }
83
83
 
84
84
 
85
+ .category-index,
86
+ .tag-index,
87
+ .home {
88
+ padding: $spacing-unit;
89
+
90
+ ul.post-list {
91
+ display: flex;
92
+ flex-wrap: wrap;
93
+ flex-direction: row;
94
+ column-gap: $spacing-unit;
95
+ row-gap: $spacing-unit;
96
+
97
+ & > li {
98
+ flex-grow: 1;
99
+ //width: 300px;
100
+ height: 350px;
101
+ overflow: hidden;
102
+
103
+ article {
104
+ display: flex;
105
+ flex-direction: column;
106
+ justify-items: stretch;
107
+ height: 100%;
108
+
109
+ div.post-content {
110
+ flex-shrink: 1;
111
+ flex-grow: 1;
112
+ overflow: hidden;
113
+ }
114
+
115
+ a.read-more {
116
+ background: $background-color;
117
+ box-shadow: 0 -12px 50px 50px $background-color;
118
+ padding-top: 8px;
119
+ }
120
+ }
121
+ }
122
+ }
123
+ }
124
+
85
125
 
86
126
  /**
87
127
  * Site footer
@@ -125,13 +165,13 @@
125
165
  }
126
166
 
127
167
  .footer-col-2 {
128
- width: -webkit-calc(25% - (#{$spacing-unit} / 2));
129
- width: calc(25% - (#{$spacing-unit} / 2));
168
+ width: -webkit-calc(30% - (#{$spacing-unit} / 2));
169
+ width: calc(30% - (#{$spacing-unit} / 2));
130
170
  }
131
171
 
132
172
  .footer-col-3 {
133
- width: -webkit-calc(45% - (#{$spacing-unit} / 2));
134
- width: calc(45% - (#{$spacing-unit} / 2));
173
+ width: -webkit-calc(40% - (#{$spacing-unit} / 2));
174
+ width: calc(40% - (#{$spacing-unit} / 2));
135
175
  }
136
176
 
137
177
  @include media-query($on-laptop) {
@@ -176,7 +216,6 @@
176
216
  > li {
177
217
  background-color: white;
178
218
  padding: $spacing-unit;
179
- margin: $spacing-unit 0;
180
219
  border-radius: 4px;
181
220
  @include BoxShadow(1);
182
221
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-switch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Luijten
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-28 00:00:00.000000000 Z
11
+ date: 2024-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -122,7 +122,7 @@ dependencies:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: 1.4.0
125
- description:
125
+ description:
126
126
  email:
127
127
  - christian@luijten.org
128
128
  executables: []
@@ -131,15 +131,23 @@ extra_rdoc_files: []
131
131
  files:
132
132
  - LICENSE.txt
133
133
  - README.md
134
+ - _data/i18n.yaml
134
135
  - _includes/date.html
135
136
  - _includes/disqus.html
136
137
  - _includes/footer.html
138
+ - _includes/footer_text.html
137
139
  - _includes/head.html
138
140
  - _includes/header.html
139
141
  - _includes/holidays_contents.html
140
142
  - _includes/holidays_ul.html
141
143
  - _includes/month.html
144
+ - _includes/page_title.html
145
+ - _includes/paginator_nav.html
146
+ - _includes/post_item.html
147
+ - _includes/post_list.html
142
148
  - _includes/post_meta.html
149
+ - _includes/post_nav.html
150
+ - _includes/rss/channel.html
143
151
  - _includes/rss/post.html
144
152
  - _includes/section_nav.html
145
153
  - _includes/vimeo.html
@@ -158,14 +166,6 @@ files:
158
166
  - _layouts/tag_page.html
159
167
  - _layouts/wrapped.html
160
168
  - _layouts/yearly_archive.html
161
- - _plugins/blog_series_plugin.rb
162
- - _plugins/category_tag_filter.rb
163
- - _plugins/filesize_filter.rb
164
- - _plugins/normalize_whitespace_filter.rb
165
- - _plugins/songlink_tag_plugin.rb
166
- - _plugins/video_tag_plugin.rb
167
- - _plugins/vimeo_tag_plugin.rb
168
- - _plugins/yearly_archive_plugin.rb
169
169
  - _sass/jekyll-theme-switch/_base.scss
170
170
  - _sass/jekyll-theme-switch/_dark.scss
171
171
  - _sass/jekyll-theme-switch/_image-effects.scss
@@ -181,7 +181,7 @@ homepage: https://islandsvinur.gitlab.io/jekyll-theme-switch/
181
181
  licenses:
182
182
  - MIT
183
183
  metadata: {}
184
- post_install_message:
184
+ post_install_message:
185
185
  rdoc_options: []
186
186
  require_paths:
187
187
  - lib
@@ -197,7 +197,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
197
  version: '0'
198
198
  requirements: []
199
199
  rubygems_version: 3.3.26
200
- signing_key:
200
+ signing_key:
201
201
  specification_version: 4
202
202
  summary: The theme for Logging the Switch.
203
203
  test_files: []
@@ -1,16 +0,0 @@
1
-
2
-
3
- Jekyll::Hooks.register :site, :pre_render do |site|
4
-
5
- seriesIndexes = site.posts.docs
6
- .select { |p| p.data.key? 'series_slug' }
7
- .reduce(Hash.new {|h,k| h[k] = []} ) { |series, post| series[post.data['series_slug']] << post; series }
8
-
9
- seriesPosts = site.posts.docs
10
- .select { |p| p.data.key? 'series' }
11
- .reduce(Hash.new {|h,k| h[k] = []}) { |series, post| series[post.data['series']] << post; series }
12
-
13
- seriesIndexes.each { |slug, posts| posts.each {|post| post.data['series_posts'] = seriesPosts[slug] }}
14
- seriesPosts.each { |slug, posts| posts.each {|post| post.data['series_index'] = seriesIndexes[slug] }}
15
- end
16
-
@@ -1,36 +0,0 @@
1
-
2
- module Jekyll
3
- module CategoryTagFilter
4
- def taglinks(input)
5
- site = @context.registers[:site]
6
- input.map do |tag|
7
- "<a href=\"#{site.baseurl}/#{site.config['tag_dir']}/#{Utils.slugify(tag)}\">#{tag}</a>"
8
- end
9
- end
10
-
11
- def categorylinks(input)
12
- site = @context.registers[:site]
13
- input.map do |cat|
14
- "<a href=\"#{site.baseurl}/#{site.config['category_dir']}/#{Utils.slugify(cat)}\">#{cat}</a>"
15
- end
16
- end
17
- end
18
-
19
- class CategoryLinkTag < Liquid::Tag
20
- def initialize(tag_name, text, tokens)
21
- super
22
- @text = text
23
- end
24
-
25
- def render(context)
26
- @context = context
27
- site = context.registers[:site]
28
- dir = site.config['category_dir'] || 'categories'
29
-
30
- "/#{dir}/#{@text}"
31
- end
32
- end
33
- end
34
-
35
- Liquid::Template.register_tag('category_link', Jekyll::CategoryLinkTag)
36
- Liquid::Template.register_filter(Jekyll::CategoryTagFilter)
@@ -1,13 +0,0 @@
1
-
2
- module Jekyll
3
- module FilesizeFilter
4
- def filesize(input)
5
- site = @context.registers[:site]
6
- file = site.static_files.find {|f| f.path.end_with?(input) }
7
-
8
- File.size(file.path)
9
- end
10
- end
11
- end
12
-
13
- Liquid::Template.register_filter(Jekyll::FilesizeFilter)
@@ -1,10 +0,0 @@
1
-
2
- module Jekyll
3
- module NormalizeWhitespaceFilter
4
- def normalize_whitespace(input)
5
- input.gsub(/\s+/, ' ')
6
- end
7
- end
8
- end
9
-
10
- Liquid::Template.register_filter(Jekyll::NormalizeWhitespaceFilter)
@@ -1,18 +0,0 @@
1
-
2
- module Jekyll
3
- class SonglinkTag < Liquid::Tag
4
- @songlink = ''
5
-
6
- def initialize(tag_name, markup, tokens)
7
- @songlink = markup.split(' ').first
8
- end
9
-
10
- def render(context)
11
- output = super
12
- url = "https://embed.song.link/?url=#{@songlink}&theme=light"
13
- songlink = "<iframe width='100%' height='414' src='#{url}' frameborder='0' allowfullscreen sandbox='allow-same-origin allow-scripts allow-presentation allow-popups allow-popups-to-escape-sandbox'></iframe>"
14
- end
15
- end
16
- end
17
-
18
- Liquid::Template.register_tag('songlink', Jekyll::SonglinkTag)
@@ -1,62 +0,0 @@
1
- # Title: Simple Video tag for Jekyll
2
- # Author: Brandon Mathis http://brandonmathis.com
3
- # Description: Easily output MPEG4 HTML5 video with a flash backup.
4
- #
5
- # Syntax {% video url/to/video [width height] [url/to/poster] %}
6
- #
7
- # Example:
8
- # {% video http://site.com/video.mp4 720 480 http://site.com/poster-frame.jpg %}
9
- #
10
- # Output:
11
- # <video width='720' height='480' preload='none' controls poster='http://site.com/poster-frame.jpg'>
12
- # <source src='http://site.com/video.mp4' type='video/mp4; codecs=\"avc1.42E01E, mp4a.40.2\"'/>
13
- # </video>
14
- #
15
-
16
- module Jekyll
17
-
18
- class VideoTag < Liquid::Tag
19
- @video = nil
20
- @poster = ''
21
- @height = ''
22
- @width = ''
23
-
24
- def initialize(tag_name, markup, tokens)
25
- @videos = markup.scan(/((https?:\/\/|\/)\S+\.(webm|ogv|mp4)\S*)/i).map(&:first).compact
26
- @poster = markup.scan(/((https?:\/\/|\/)\S+\.(png|gif|jpe?g)\S*)/i).map(&:first).compact.first
27
- @sizes = markup.scan(/\s(\d\S+)/i).map(&:first).compact
28
- super
29
- end
30
-
31
- def render(context)
32
- output = super
33
- types = {
34
- '.mp4' => "type='video/mp4; codecs=\"avc1.42E01E, mp4a.40.2\"'",
35
- '.ogv' => "type='video/ogg; codecs=theora, vorbis'",
36
- '.webm' => "type='video/webm; codecs=vp8, vorbis'"
37
- }
38
- if @videos.size > 0
39
- video = "<video #{sizes} preload='metadata' controls #{poster}>"
40
- @videos.each do |v|
41
- video << "<source src='#{v}' #{types[File.extname(v)]}>"
42
- end
43
- video += "</video>"
44
- else
45
- "Error processing input, expected syntax: {% video url/to/video [url/to/video] [url/to/video] [width height] [url/to/poster] %}"
46
- end
47
- end
48
-
49
- def poster
50
- "poster='#{@poster}'" if @poster
51
- end
52
-
53
- def sizes
54
- attrs = "width='#{@sizes[0]}'" if @sizes[0]
55
- attrs += " height='#{@sizes[1]}'" if @sizes[1]
56
- attrs
57
- end
58
- end
59
- end
60
-
61
- Liquid::Template.register_tag('video', Jekyll::VideoTag)
62
-
@@ -1,23 +0,0 @@
1
-
2
- class VimeoEmbed < Liquid::Tag
3
-
4
- def initialize(tagName, content, tokens)
5
- super
6
- @content = content
7
- content[/([0-9]+)/]
8
- @vimeo_id = $1
9
- end
10
-
11
- def render(context)
12
- tmpl_path = File.join Dir.pwd, "_includes", "vimeo.html"
13
- if File.exist?(tmpl_path)
14
- tmpl = File.read tmpl_path
15
- site = context.registers[:site]
16
- tmpl = (Liquid::Template.parse tmpl).render site.site_payload.merge!({"vimeo_id" => @vimeo_id})
17
- else
18
- %Q{<style>.embed-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }</style><div class='embed-container'> <iframe title="vimeo video player" width="640" height="390" src="//www.vimeo.com/embed/#{ @vimeo_id }" frameborder="0" allowfullscreen></iframe></div>}
19
- end
20
- end
21
-
22
- Liquid::Template.register_tag "vimeo", self
23
- end
@@ -1,81 +0,0 @@
1
- # Jekyll Module to create yearly archive pages
2
- #
3
- # Shigeya Suzuki, November 2013
4
- # Copyright notice (MIT License) attached at the end of this file
5
- #
6
-
7
- #
8
- # This code is based on the following works:
9
- # https://gist.github.com/ilkka/707909
10
- # https://gist.github.com/ilkka/707020
11
- # https://gist.github.com/nlindley/6409459
12
- #
13
-
14
- #
15
- # Archive will be written as #{archive_path}/#{year}/#{month}/index.html
16
- # archive_path can be configured in 'path' key in 'yearly_archive' of
17
- # site configuration file. 'path' is default null.
18
- #
19
-
20
- module Jekyll
21
-
22
- module YearlyArchiveUtil
23
- def self.archive_base(site)
24
- site.config['yearly_archive'] && site.config['yearly_archive']['path'] || ''
25
- end
26
- end
27
-
28
- # Generator class invoked from Jekyll
29
- class YearlyArchiveGenerator < Generator
30
- def generate(site)
31
- posts_by_year = posts_group_by_year(site)
32
- site.pages << ArchivePage.new(site, YearlyArchiveUtil.archive_base(site), posts_by_year)
33
- end
34
-
35
- def posts_group_by_year(site)
36
- site.posts.docs.each.group_by { |post| post.date.year }
37
- end
38
-
39
- end
40
-
41
- class ArchivePage < Page
42
- def initialize(site, dir, posts_by_year)
43
- @site = site
44
- @dir = dir
45
- @years = posts_by_year
46
- @layout = 'archive'
47
- self.ext = '.html'
48
- self.basename = 'archive'
49
- self.data = {
50
- 'layout' => @layout,
51
- 'type' => 'archive',
52
- 'title' => 'Archieven',
53
- 'site_header' => 'Archieven',
54
- 'years' => @years,
55
- 'url' => File.join('/', YearlyArchiveUtil.archive_base(site), 'archives.html')
56
- }
57
- end
58
- end
59
- end
60
-
61
- # The MIT License (MIT)
62
- #
63
- # Copyright (c) 2013 Shigeya Suzuki
64
- #
65
- # Permission is hereby granted, free of charge, to any person obtaining a copy
66
- # of this software and associated documentation files (the "Software"), to deal
67
- # in the Software without restriction, including without limitation the rights
68
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
69
- # copies of the Software, and to permit persons to whom the Software is
70
- # furnished to do so, subject to the following conditions:
71
- #
72
- # The above copyright notice and this permission notice shall be included in all
73
- # copies or substantial portions of the Software.
74
- #
75
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
76
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
77
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
78
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
79
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
80
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
81
- # SOFTWARE.