jekyll-theme-endless 0.1.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.adoc +87 -3
- data/_config.yml +2 -15
- data/_includes/content_footer-usernames.html +36 -0
- data/_includes/function_list-posts.html +1 -1
- data/_includes/function_tag-cloud.html +60 -0
- data/_layouts/default.html +74 -2
- data/_layouts/html.html +4 -0
- data/_layouts/page-postlist.html +1 -1
- data/_layouts/page-tag.html +22 -0
- data/_sass/address.scss +15 -0
- data/_sass/background.scss +5 -1
- data/_sass/tag-cloud.scss +18 -0
- data/_sass/user.scss +1 -7
- data/assets/css/main.scss +3 -0
- data/lib/jekyll-theme-endless.rb +8 -0
- data/lib/jekyll-theme-endless/generate-tagpages.rb +80 -0
- data/lib/jekyll-theme-endless/version.rb +5 -0
- metadata +10 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b04d7b3586e572280a4fd5247a8eaf94ec4552ce73a9481e51c833fcb6ffdc3
|
4
|
+
data.tar.gz: 5c18618cdf44c90589548091abb2835f026d66668b46fab51f62e74ec3cac70a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af6018f32a44bb618451c96114ff690440f8683721ec866d2ea5acebe81838308297ce98e74c1d720571d79466d39884472821a33c5d245aa3fff72edd3f7a13
|
7
|
+
data.tar.gz: 27b2e49ee0315ebcc171c65038b20c8a523b78f2d1e400438df31e10e193a4950c50159e21bdddde468d0e903c76a4dac4b448247e807adced8dbbd291495514
|
data/README.adoc
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
= jekyll-theme-endless
|
2
|
+
:page-menu_label: Documentation
|
3
|
+
:page-menu_position: 300
|
2
4
|
|
3
5
|
|
6
|
+
== Quicktstart for testing
|
7
|
+
|
8
|
+
* Clone the repository
|
9
|
+
* Run `bundle exec jekyll serve --config _config.yml,_data.yml`
|
10
|
+
* Open http://127.0.0.1:4000/ to view a page using this theme
|
4
11
|
|
5
12
|
== Installation
|
6
13
|
|
@@ -52,7 +59,7 @@ HTML boilerplate code used for all layouts.
|
|
52
59
|
`_layouts/default.html`::
|
53
60
|
Default website structure (menue, tag cloud, ...) used for pages and posts.
|
54
61
|
|
55
|
-
Contains a navigation bar with a configurable brand-label.
|
62
|
+
Contains a *navigation bar* with a configurable brand-label.
|
56
63
|
Set `brand` in your `_config.yml`, to determine what is shown on the left side of the navigation.
|
57
64
|
Example:
|
58
65
|
|
@@ -61,6 +68,32 @@ Example:
|
|
61
68
|
brand: '"<i>endless</i>"-Theme'
|
62
69
|
----
|
63
70
|
|
71
|
+
Contains a configurable *title bar*.
|
72
|
+
Set `title` and `subtitle` in your `_config.yml`, to determine what is shown below the navigation bar.
|
73
|
+
If none of the two values is set, the title bar is omitted.
|
74
|
+
Example:
|
75
|
+
|
76
|
+
[source, yaml]
|
77
|
+
----
|
78
|
+
title: 'Brandname'
|
79
|
+
subtitle: 'Vision statement'
|
80
|
+
----
|
81
|
+
|
82
|
+
Contains a configurable *footer*.
|
83
|
+
Includes `content_footer-usernames.html` to generate a list of contact options.
|
84
|
+
Configure values in `_config.yml`.
|
85
|
+
Example:
|
86
|
+
|
87
|
+
[source, yaml]
|
88
|
+
----
|
89
|
+
author: Sven Boekhoff
|
90
|
+
copydate: 2020
|
91
|
+
disclaimer: >- # this means to ignore newlines until the next entry
|
92
|
+
I'm creating this Jekyll theme because I want to use it myself.
|
93
|
+
Therefore, many things (e.g. the support of AsciiDoc) are based on personal requirements.
|
94
|
+
You are welcome to use the theme (at your own risk) and contribute to the development.
|
95
|
+
----
|
96
|
+
|
64
97
|
|
65
98
|
`_layouts/page.html`::
|
66
99
|
Layout of page-content.
|
@@ -94,6 +127,10 @@ Content
|
|
94
127
|
`_layouts/page-postlist.html`::
|
95
128
|
Layout of page-content with a list of blog posts at the end.
|
96
129
|
|
130
|
+
`_layouts/page-tag.html`::
|
131
|
+
Layout of pages containing a list of those posts being tagged with a given tag.
|
132
|
+
This file is required by the `generate-tagpages`-plugin.
|
133
|
+
|
97
134
|
`_layouts/post.html`::
|
98
135
|
Layout of blog-posts.
|
99
136
|
|
@@ -145,6 +182,48 @@ This can be useful for your 404 page, which should be generated by Jekyll, but n
|
|
145
182
|
Generates the code containing links to each blog-post.
|
146
183
|
The text of the link is the title of the post.
|
147
184
|
|
185
|
+
`_includes/function_tag-cloud.html`::
|
186
|
+
Generates a tag cloud.
|
187
|
+
|
188
|
+
`_includes/content_footer-usernames.html`::
|
189
|
+
Creates a list of contact options based on provided usernames and addresses.
|
190
|
+
The entries are preceded with the icons of (e.g.) the social network and are linked to the corresponding profile.
|
191
|
+
|
192
|
+
In your `_config.yml` use for example:
|
193
|
+
|
194
|
+
[source, YAML]
|
195
|
+
----
|
196
|
+
email: your-email@example.com
|
197
|
+
username_gitlab: XXXX
|
198
|
+
username_github: XXXX
|
199
|
+
username_xing: XXXX
|
200
|
+
username_linkedin: XXXX
|
201
|
+
----
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
=== Plugins
|
206
|
+
|
207
|
+
`_plugins/generate-tagpages.rb`
|
208
|
+
|
209
|
+
Generates a page for each tag listed in `site.tags`.
|
210
|
+
The files created are by default named `tags/<tagname>/index.html`.
|
211
|
+
The content is generated using the layout file `_layouts/page-tag.html`
|
212
|
+
|
213
|
+
The following values can be set in `_config.yml`:
|
214
|
+
|
215
|
+
[source, YAML]
|
216
|
+
----
|
217
|
+
# Settings for tag cloud:
|
218
|
+
# The name of the directory in which the files for each tag are created
|
219
|
+
# default: `tags`
|
220
|
+
tag_dir: post-for-tag
|
221
|
+
# Prefix to be used for the title of the tag-page
|
222
|
+
# default: `Tag: `
|
223
|
+
tag_title_prefix: "Posts tagged with: "
|
224
|
+
----
|
225
|
+
|
226
|
+
|
148
227
|
|
149
228
|
=== Styles
|
150
229
|
|
@@ -181,9 +260,14 @@ To set up your environment to develop this theme:
|
|
181
260
|
. clone this repository
|
182
261
|
. run `bundle install`
|
183
262
|
|
184
|
-
|
185
|
-
To test
|
263
|
+
The theme is setup just like a normal Jekyll site!
|
264
|
+
To test the theme, run `bundle exec jekyll serve` and open your browser at `http://localhost:4000`.
|
186
265
|
This starts a Jekyll server using your theme.
|
266
|
+
To test the theme *with example-data*, run `bundle exec jekyll serve --config _config.yml,_data.yml`.
|
267
|
+
Values for theme specific configurations are stored in `_data.yml` and not in the themes `_config.yml`.
|
268
|
+
Since the `_config.yml` is shipped with the gem,
|
269
|
+
the users of your theme would otherwise have to unset the values in their own `config.yml`.
|
270
|
+
|
187
271
|
Add pages, documents, data, etc. like normal to test your theme's contents.
|
188
272
|
As you make modifications to your theme and to your content, your site will regenerate and
|
189
273
|
you should see the changes in the browser after a refresh, just like normal.
|
data/_config.yml
CHANGED
@@ -18,26 +18,14 @@
|
|
18
18
|
# You can create any custom variable you would like, and they will be accessible
|
19
19
|
# in the templates via {{ site.myvariable }}.
|
20
20
|
|
21
|
-
title: Your awesome title
|
22
|
-
email: your-email@example.com
|
23
|
-
description: >- # this means to ignore newlines until "baseurl:"
|
24
|
-
Write an awesome description for your new site here. You can edit this
|
25
|
-
line in _config.yml. It will appear in your document head meta (for
|
26
|
-
Google search results) and in your feed.xml site description.
|
27
21
|
baseurl: "" # the subpath of your site, e.g. /blog
|
28
22
|
url: "" # the base hostname & protocol for your site, e.g. http://example.com
|
29
|
-
#twitter_username: jekyllrb
|
30
|
-
#github_username: jekyll
|
31
23
|
|
32
24
|
|
33
25
|
|
34
26
|
# Theme specific settings
|
35
|
-
#
|
36
|
-
|
37
|
-
# Brand is not escaped in the layout.
|
38
|
-
# Thus, HTML-commands can be used.
|
39
|
-
brand: '"<i>endless</i>"-Theme'
|
40
|
-
|
27
|
+
# Find example data in _data.yml of the theme repository.
|
28
|
+
# Run `bundle exec jekyll serve --config _config.yml,_data.yml`
|
41
29
|
|
42
30
|
|
43
31
|
# Build settings
|
@@ -56,7 +44,6 @@ brand: '"<i>endless</i>"-Theme'
|
|
56
44
|
exclude:
|
57
45
|
- '*.gemspec'
|
58
46
|
- LICENSE.txt
|
59
|
-
- README.adoc
|
60
47
|
# - .sass-cache/
|
61
48
|
# - .jekyll-cache/
|
62
49
|
# - gemfiles/
|
@@ -0,0 +1,36 @@
|
|
1
|
+
{% comment %}
|
2
|
+
List of contacts in adress-bar.
|
3
|
+
{% endcomment %}
|
4
|
+
|
5
|
+
<ul class="list-unstyled">
|
6
|
+
{% if site.username_gitlab %}
|
7
|
+
<li>
|
8
|
+
<i class="fa fa-gitlab"></i>
|
9
|
+
<a href="https://gitlab.com/{{ site.username_gitlab }}">{{ site.username_gitlab }}</a>
|
10
|
+
</li>
|
11
|
+
{% endif %}
|
12
|
+
{% if site.username_github %}
|
13
|
+
<li>
|
14
|
+
<i class="fa fa-github"></i>
|
15
|
+
<a href="https://github.com/{{ site.username_github }}">{{ site.username_github }}</a>
|
16
|
+
</li>
|
17
|
+
{% endif %}
|
18
|
+
{% if site.username_xing %}
|
19
|
+
<li>
|
20
|
+
<i class="fa fa-xing"></i>
|
21
|
+
<a href="https://www.xing.com/profile/{{ site.username_xing }}">{{ site.username_xing }}</a>
|
22
|
+
</li>
|
23
|
+
{% endif %}
|
24
|
+
{% if site.username_linkedin %}
|
25
|
+
<li>
|
26
|
+
<i class="fa fa-linkedin"></i>
|
27
|
+
<a href="https://de.linkedin.com/in/{{ site.username_linkedin }}">{{ site.username_linkedin }}</a>
|
28
|
+
</li>
|
29
|
+
{% endif %}
|
30
|
+
{% if site.email %}
|
31
|
+
<li>
|
32
|
+
<i class="fa fa-at"></i>
|
33
|
+
<a href="mailto:{{ site.email }}">{{ site.email }}</a>
|
34
|
+
</li>
|
35
|
+
{% endif %}
|
36
|
+
</ul>
|
@@ -5,7 +5,7 @@ List of blog-posts.
|
|
5
5
|
<ul>
|
6
6
|
{% for current_post in site.posts %}
|
7
7
|
<li>
|
8
|
-
<a href="{{ current_post.url }}">{{ current_post.title }}</a>
|
8
|
+
{{ current_post.date | date: "%Y-%m-%d" }}: <a href="{{ current_post.url }}">{{ current_post.title }}</a>
|
9
9
|
</li>
|
10
10
|
{% endfor %}
|
11
11
|
</ul>
|
@@ -0,0 +1,60 @@
|
|
1
|
+
{% comment %}
|
2
|
+
|
3
|
+
{% endcomment %}
|
4
|
+
{% assign tags = site.tags | sort_natural %}
|
5
|
+
|
6
|
+
{% comment %}
|
7
|
+
Requirements:
|
8
|
+
- The tag with the most posts should always be displayed at 250%
|
9
|
+
- The tag with the fewest posts (this can also be more than 1!) always with 100%.
|
10
|
+
- All gradations in between should be distributed linearly.
|
11
|
+
|
12
|
+
Determine minimum an maximum value.
|
13
|
+
Assumption: Non of the tags occurs more than one million times.
|
14
|
+
|
15
|
+
{% endcomment %}
|
16
|
+
{% assign min = 1000000 %}
|
17
|
+
{% assign max = 0 %}
|
18
|
+
|
19
|
+
{% for tag in tags %}
|
20
|
+
{% assign postsWithThisTag = tag | last | size %}
|
21
|
+
{% if postsWithThisTag > max %}
|
22
|
+
{% assign max = postsWithThisTag %}
|
23
|
+
{% endif %}
|
24
|
+
{% if postsWithThisTag < min %}
|
25
|
+
{% assign min = postsWithThisTag %}
|
26
|
+
{% endif %}
|
27
|
+
{% endfor %}
|
28
|
+
|
29
|
+
{% assign sizeDifference = 150 %}
|
30
|
+
{% assign steps = max | minus: min %}
|
31
|
+
|
32
|
+
<ul class="tag-cloud list-unstyled">
|
33
|
+
|
34
|
+
{% for tag in tags %}
|
35
|
+
<li>
|
36
|
+
{% comment %}
|
37
|
+
The size difference should be 150%.
|
38
|
+
The rarest tag should be displayed in 100%, the most frequent should be 250%.
|
39
|
+
100 + (aktZahl - min) * (250 / (max -min))
|
40
|
+
|
41
|
+
100: Minimum size
|
42
|
+
(aktZahl - min): Distance from the current value to the smallest value
|
43
|
+
(150 / (max -min)): Size difference in measures of the number of steps between the largest and the smallest value.
|
44
|
+
|
45
|
+
https://shopify.github.io/liquid/filters/divided_by/
|
46
|
+
To be on the safe side, create a float (times: 1.0)
|
47
|
+
{% endcomment %}
|
48
|
+
|
49
|
+
{% assign number = tag | last | size %}
|
50
|
+
{% assign percent = number | times: 1.0 | minus: min | times: sizeDifference | divided_by: steps | plus: 100 %}
|
51
|
+
{% assign tagname = tag | first | replace:'-', ' ' %}
|
52
|
+
|
53
|
+
<a
|
54
|
+
href = "/{{ site.tag_dir | default: 'tags' }}/{{ tag | first }}"
|
55
|
+
style = "font-size: {{ percent }}%"
|
56
|
+
title = "Number of posts with the tag '{{ tagname }}': {{ number }}"
|
57
|
+
>{{ tagname }}</a>
|
58
|
+
</li>
|
59
|
+
{% endfor %}
|
60
|
+
</ul>
|
data/_layouts/default.html
CHANGED
@@ -8,7 +8,9 @@ layout: html
|
|
8
8
|
<div class="container">
|
9
9
|
|
10
10
|
<!-- Brand Icon -->
|
11
|
+
{% if site.brand %}
|
11
12
|
<a class="navbar-brand" href="{{ "/" | relative_url}}">{{ site.brand }}</a>
|
13
|
+
{% endif %}
|
12
14
|
|
13
15
|
<!-- Burger menu -->
|
14
16
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
@@ -29,15 +31,85 @@ layout: html
|
|
29
31
|
|
30
32
|
|
31
33
|
|
34
|
+
<!-- Page title -->
|
35
|
+
{% if site.title or site.subtitle %}
|
36
|
+
<div class="jumbotron border-bottom bg-light py-4">
|
37
|
+
<div class="container">
|
38
|
+
|
39
|
+
{% if site.title %}
|
40
|
+
<div class="h1">{{ site.title }}</div>
|
41
|
+
{% endif %}
|
42
|
+
|
43
|
+
{% if site.subtitle %}
|
44
|
+
<div class="h2">{{ site.subtitle }}</div>
|
45
|
+
{% endif %}
|
46
|
+
|
47
|
+
</div>
|
48
|
+
</div>
|
49
|
+
{% endif %}
|
50
|
+
|
51
|
+
|
52
|
+
|
32
53
|
<!-- Page content -->
|
33
|
-
<main class="container" aria-label="Content">
|
54
|
+
<main class="container pt-4 pb-5" style="flex-grow: 1;" aria-label="Content">
|
55
|
+
|
56
|
+
<div class="row">
|
57
|
+
|
58
|
+
<div class="col-lg-8">
|
59
|
+
{{ content }}
|
60
|
+
</div>
|
34
61
|
|
35
|
-
|
62
|
+
<div class="col-lg-4">
|
63
|
+
<aside>
|
64
|
+
<h3>Blog Navigation</h3>
|
65
|
+
|
66
|
+
<!-- Tag-cloud -->
|
67
|
+
{% include function_tag-cloud.html %}
|
68
|
+
|
69
|
+
</aside>
|
70
|
+
</div>
|
71
|
+
|
72
|
+
</div>
|
36
73
|
|
37
74
|
</main>
|
38
75
|
|
39
76
|
|
40
77
|
|
41
78
|
<!-- Footer -->
|
79
|
+
<footer class="footer border-top bg-light">
|
80
|
+
<div class="container">
|
81
|
+
|
82
|
+
<div class="row">
|
83
|
+
|
84
|
+
<div class="col-lg-3 col-md-4 text-left py-3">
|
85
|
+
<address>
|
86
|
+
<div class="h4">Contact me:</div>
|
87
|
+
{% include content_footer-usernames.html %}
|
88
|
+
</address>
|
89
|
+
</div>
|
90
|
+
|
91
|
+
<div class="col-lg-6 col-md-5 text-left py-3">
|
92
|
+
{% if site.disclaimer %}
|
93
|
+
<h4>Disclaimer:</h4>
|
94
|
+
{{ site.disclaimer }}
|
95
|
+
{% endif %}
|
96
|
+
</div>
|
97
|
+
|
98
|
+
<div class="col-md-3 text-left py-3">
|
99
|
+
<h4>Note:</h4>
|
100
|
+
{% if site.copydate and site.author %}
|
101
|
+
<p>
|
102
|
+
© {{ site.copydate }} by <em>{{ site.author }}</em>
|
103
|
+
</p>
|
104
|
+
{% endif %}
|
105
|
+
<p>
|
106
|
+
Powered by <a href="https://jekyll-theme-endless.gitlab.io/">jekyll-theme-endless</a>.
|
107
|
+
</p>
|
108
|
+
</div>
|
109
|
+
|
110
|
+
</div>
|
111
|
+
|
112
|
+
</div>
|
113
|
+
</footer>
|
42
114
|
|
43
115
|
|
data/_layouts/html.html
CHANGED
@@ -11,8 +11,12 @@
|
|
11
11
|
{{ page.title }}
|
12
12
|
</title>
|
13
13
|
|
14
|
+
<!-- Font-awesome CSS: https://www.bootstrapcdn.com/fontawesome/ -->
|
15
|
+
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
|
14
16
|
<!-- Bootstrap CSS -->
|
15
17
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha256-93wNFzm2GO3EoByj9rKZCwGjAJAwr0nujPaOgwUt8ZQ=" crossorigin="anonymous">
|
18
|
+
|
19
|
+
<!-- Theme CSS -->
|
16
20
|
<link rel="stylesheet" href="/assets/css/main.css">
|
17
21
|
|
18
22
|
</head>
|
data/_layouts/page-postlist.html
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
---
|
2
|
+
layout: default
|
3
|
+
menu_position: -10
|
4
|
+
---
|
5
|
+
{% comment %}
|
6
|
+
page.tag and page.title are set by the plugin `generate-taglist`.
|
7
|
+
{% endcomment %}
|
8
|
+
{% if page.title %}
|
9
|
+
<h1>{{ page.title }}</h1>
|
10
|
+
{% endif %}
|
11
|
+
|
12
|
+
<ul>
|
13
|
+
{% for post in site.tags[ page.tag ] %}
|
14
|
+
|
15
|
+
<li>
|
16
|
+
{{ post.date | date: "%Y-%m-%d" }}: <a href="{{ post.url }}">{{ post.title }}</a>
|
17
|
+
</li>
|
18
|
+
|
19
|
+
{% endfor %}
|
20
|
+
</ul>
|
21
|
+
|
22
|
+
|
data/_sass/address.scss
ADDED
data/_sass/background.scss
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
/**
|
2
|
+
* Tag cloud.
|
3
|
+
*/
|
4
|
+
.tag-cloud {
|
5
|
+
text-align: center;
|
6
|
+
|
7
|
+
li {
|
8
|
+
display: inline;
|
9
|
+
}
|
10
|
+
/* Every tag in the tag cloud should have a point as a separator. */
|
11
|
+
li::after {
|
12
|
+
content: "·";
|
13
|
+
}
|
14
|
+
/* The last entry in the tag cloud should not have a point. */
|
15
|
+
li:last-child::after {
|
16
|
+
content: "";
|
17
|
+
}
|
18
|
+
}
|
data/_sass/user.scss
CHANGED
data/assets/css/main.scss
CHANGED
@@ -0,0 +1,80 @@
|
|
1
|
+
# Generator
|
2
|
+
|
3
|
+
# Generates a page for each tag listed in `site.tags`.
|
4
|
+
# The files created are by default named `tags/<tagname>/index.html`.
|
5
|
+
# The content is generated using the layout file `_layouts/page-tag.html`
|
6
|
+
|
7
|
+
# The following values can be set in `_config.yml`
|
8
|
+
# `tag_dir`
|
9
|
+
# * the name of the directory in which the files for each tag are created;
|
10
|
+
# * default: `tags`
|
11
|
+
# `tag_title_prefix`
|
12
|
+
# * Prefix to be used for the title of the page
|
13
|
+
# * default: `Tag: `
|
14
|
+
|
15
|
+
# Necessary files:
|
16
|
+
# `_layouts/page-tag.html` - used to generate content of tag files.
|
17
|
+
|
18
|
+
# The following values are made available in the layout:
|
19
|
+
# * `page.tag` - contains the tag
|
20
|
+
# * `page.title` - contains the generated title, e.g. "Tag: <tagname>"
|
21
|
+
|
22
|
+
# NOTE: after changes to the plugin, `jekyll serve` must be started again.
|
23
|
+
|
24
|
+
# See also: https://jekyllrb.com/docs/plugins/
|
25
|
+
# See also: https://jekyllrb.com/docs/plugins/generators/
|
26
|
+
|
27
|
+
module Jekyll
|
28
|
+
|
29
|
+
module Endless
|
30
|
+
|
31
|
+
# TagPageGenerator is a subclass of Generator
|
32
|
+
class TagPageGenerator < Generator
|
33
|
+
safe true
|
34
|
+
# A Generator needs to implement the generate method
|
35
|
+
def generate(site)
|
36
|
+
# If a layout with the name `page-tag` exists
|
37
|
+
if site.layouts.key? 'page-tag'
|
38
|
+
# The directory in which the files are to be created is configured in `site.tag_dir`.
|
39
|
+
# If not, the directory `tags/` is used.
|
40
|
+
dir = site.config['tag_dir'] || 'tags'
|
41
|
+
|
42
|
+
# For each tag in the tag-list:
|
43
|
+
site.tags.each_key do |tag|
|
44
|
+
# Create a page-object using TagPage and add it to the `site.pages` array
|
45
|
+
site.pages << TagPage.new(site, site.source, File.join(dir, tag), tag)
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
# TagPage is a subclass of Page
|
53
|
+
# It is used in the `TagPageGenerator`
|
54
|
+
class TagPage < Page
|
55
|
+
def initialize(site, base, dir, tag)
|
56
|
+
# Define instance variables ('@') to make values available in the super-class `Page`.
|
57
|
+
# The variables are available in the layout as e.g. `page.name`.
|
58
|
+
@site = site
|
59
|
+
@base = base
|
60
|
+
@dir = dir
|
61
|
+
@name = 'index.html'
|
62
|
+
|
63
|
+
self.process(@name)
|
64
|
+
self.read_yaml(File.join(base, '_layouts'), 'page-tag.html')
|
65
|
+
|
66
|
+
# The prefix for the generated title is set via `tag_title_prefix` in `_config.yml` and defaults to `Tag: `
|
67
|
+
tag_title_prefix = site.config['tag_title_prefix'] || 'Tag: '
|
68
|
+
# Generates the title for the tag page and makes it available in the layout file as `page.title`
|
69
|
+
self.data['title'] = "#{tag_title_prefix}#{tag}"
|
70
|
+
# Makes `page.tag` available in the layout file
|
71
|
+
self.data['tag'] = tag
|
72
|
+
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
|
80
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-theme-endless
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sven Boekhoff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -34,16 +34,24 @@ files:
|
|
34
34
|
- LICENSE.txt
|
35
35
|
- README.adoc
|
36
36
|
- _config.yml
|
37
|
+
- _includes/content_footer-usernames.html
|
37
38
|
- _includes/function_list-pages.html
|
38
39
|
- _includes/function_list-posts.html
|
40
|
+
- _includes/function_tag-cloud.html
|
39
41
|
- _layouts/default.html
|
40
42
|
- _layouts/html.html
|
41
43
|
- _layouts/page-postlist.html
|
44
|
+
- _layouts/page-tag.html
|
42
45
|
- _layouts/page.html
|
43
46
|
- _layouts/post.html
|
47
|
+
- _sass/address.scss
|
44
48
|
- _sass/background.scss
|
49
|
+
- _sass/tag-cloud.scss
|
45
50
|
- _sass/user.scss
|
46
51
|
- assets/css/main.scss
|
52
|
+
- lib/jekyll-theme-endless.rb
|
53
|
+
- lib/jekyll-theme-endless/generate-tagpages.rb
|
54
|
+
- lib/jekyll-theme-endless/version.rb
|
47
55
|
homepage: https://gitlab.com/jekyll-theme-endless/jekyll-theme-endless.gitlab.io
|
48
56
|
licenses:
|
49
57
|
- MIT
|