jekyll-theme-endless 0.2.1 → 0.3.0
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 +30 -0
- data/_includes/function_list-posts.html +1 -1
- data/_includes/function_tag-cloud.html +60 -0
- data/_layouts/default.html +17 -1
- data/_layouts/page-postlist.html +1 -1
- data/_layouts/page-tag.html +22 -0
- data/_plugins/generate-tagpages.rb +76 -0
- data/_sass/address.scss +15 -0
- data/_sass/tag-cloud.scss +18 -0
- data/assets/css/main.scss +2 -1
- metadata +7 -3
- data/_sass/icons.scss +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a765efd0983e1ceede6edf8cb5e9585d1a7443ab9caa5bf1ed9d21d8a83d991
|
4
|
+
data.tar.gz: 7a0845b138a722faca39492e729990081a622cb694b7434ce6bb15ff1cbe2d98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 218292073372247f62a3a5233e7833a4f1c01daef7ae856547d1b3b163b3104288e851d636e8170eeedd7c1c0bb68fa7b7cca1ea4c0646efe324fe43e1fa574b
|
7
|
+
data.tar.gz: 4547082a60f0a47c89539ddad558b303efda39350942f2e604b428a54a39cdc455daa1780cd34709607444c57ab8ab8d40f55e32e0408d6926b78c0b2078d832
|
data/README.adoc
CHANGED
@@ -122,6 +122,10 @@ Content
|
|
122
122
|
`_layouts/page-postlist.html`::
|
123
123
|
Layout of page-content with a list of blog posts at the end.
|
124
124
|
|
125
|
+
`_layouts/page-tag.html`::
|
126
|
+
Layout of pages containing a list of those posts being tagged with a given tag.
|
127
|
+
This file is required by the `generate-tagpages`-plugin.
|
128
|
+
|
125
129
|
`_layouts/post.html`::
|
126
130
|
Layout of blog-posts.
|
127
131
|
|
@@ -173,6 +177,9 @@ This can be useful for your 404 page, which should be generated by Jekyll, but n
|
|
173
177
|
Generates the code containing links to each blog-post.
|
174
178
|
The text of the link is the title of the post.
|
175
179
|
|
180
|
+
`_includes/function_tag-cloud.html`::
|
181
|
+
Generates a tag cloud.
|
182
|
+
|
176
183
|
`_includes/content_footer-usernames.html`::
|
177
184
|
Creates a list of contact options based on provided usernames and addresses.
|
178
185
|
The entries are preceded with the icons of (e.g.) the social network and are linked to the corresponding profile.
|
@@ -190,6 +197,29 @@ username_linkedin: XXXX
|
|
190
197
|
|
191
198
|
|
192
199
|
|
200
|
+
=== Plugins
|
201
|
+
|
202
|
+
`_plugins/generate-tagpages.rb`
|
203
|
+
|
204
|
+
Generates a page for each tag listed in `site.tags`.
|
205
|
+
The files created are by default named `tags/<tagname>/index.html`.
|
206
|
+
The content is generated using the layout file `_layouts/page-tag.html`
|
207
|
+
|
208
|
+
The following values can be set in `_config.yml`:
|
209
|
+
|
210
|
+
[source, YAML]
|
211
|
+
----
|
212
|
+
# Settings for tag cloud:
|
213
|
+
# The name of the directory in which the files for each tag are created
|
214
|
+
# default: `tags`
|
215
|
+
tag_dir: post-for-tag
|
216
|
+
# Prefix to be used for the title of the tag-page
|
217
|
+
# default: `Tag: `
|
218
|
+
tag_title_prefix: "Posts tagged with: "
|
219
|
+
----
|
220
|
+
|
221
|
+
|
222
|
+
|
193
223
|
=== Styles
|
194
224
|
|
195
225
|
In order to contribute SCSS-code, simply add a file `_sass/user.scss`, containing your SCCS-code.
|
@@ -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 %}
|
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
@@ -53,7 +53,23 @@ layout: html
|
|
53
53
|
<!-- Page content -->
|
54
54
|
<main class="container pt-4 pb-5" style="flex-grow: 1;" aria-label="Content">
|
55
55
|
|
56
|
-
|
56
|
+
<div class="row">
|
57
|
+
|
58
|
+
<div class="col-lg-8">
|
59
|
+
{{ content }}
|
60
|
+
</div>
|
61
|
+
|
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>
|
57
73
|
|
58
74
|
</main>
|
59
75
|
|
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
|
+
|
@@ -0,0 +1,76 @@
|
|
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
|
+
# TagPageGenerator is a subclass of Generator
|
30
|
+
class TagPageGenerator < Generator
|
31
|
+
safe true
|
32
|
+
# A Generator needs to implement the generate method
|
33
|
+
def generate(site)
|
34
|
+
# If a layout with the name `page-tag` exists
|
35
|
+
if site.layouts.key? 'page-tag'
|
36
|
+
# The directory in which the files are to be created is configured in `site.tag_dir`.
|
37
|
+
# If not, the directory `tags/` is used.
|
38
|
+
dir = site.config['tag_dir'] || 'tags'
|
39
|
+
|
40
|
+
# For each tag in the tag-list:
|
41
|
+
site.tags.each_key do |tag|
|
42
|
+
# Create a page-object using TagPage and add it to the `site.pages` array
|
43
|
+
site.pages << TagPage.new(site, site.source, File.join(dir, tag), tag)
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
# TagPage is a subclass of Page
|
51
|
+
# It is used in the `TagPageGenerator`
|
52
|
+
class TagPage < Page
|
53
|
+
def initialize(site, base, dir, tag)
|
54
|
+
# Define instance variables ('@') to make values available in the super-class `Page`.
|
55
|
+
# The variables are available in the layout as e.g. `page.name`.
|
56
|
+
@site = site
|
57
|
+
@base = base
|
58
|
+
@dir = dir
|
59
|
+
@name = 'index.html'
|
60
|
+
|
61
|
+
self.process(@name)
|
62
|
+
self.read_yaml(File.join(base, '_layouts'), 'page-tag.html')
|
63
|
+
|
64
|
+
# The prefix for the generated title is set via `tag_title_prefix` in `_config.yml` and defaults to `Tag: `
|
65
|
+
tag_title_prefix = site.config['tag_title_prefix'] || 'Tag: '
|
66
|
+
# Generates the title for the tag page and makes it available in the layout file as `page.title`
|
67
|
+
self.data['title'] = "#{tag_title_prefix}#{tag}"
|
68
|
+
# Makes `page.tag` available in the layout file
|
69
|
+
self.data['tag'] = tag
|
70
|
+
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
75
|
+
|
76
|
+
|
data/_sass/address.scss
ADDED
@@ -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/assets/css/main.scss
CHANGED
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.0
|
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-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -37,13 +37,17 @@ files:
|
|
37
37
|
- _includes/content_footer-usernames.html
|
38
38
|
- _includes/function_list-pages.html
|
39
39
|
- _includes/function_list-posts.html
|
40
|
+
- _includes/function_tag-cloud.html
|
40
41
|
- _layouts/default.html
|
41
42
|
- _layouts/html.html
|
42
43
|
- _layouts/page-postlist.html
|
44
|
+
- _layouts/page-tag.html
|
43
45
|
- _layouts/page.html
|
44
46
|
- _layouts/post.html
|
47
|
+
- _plugins/generate-tagpages.rb
|
48
|
+
- _sass/address.scss
|
45
49
|
- _sass/background.scss
|
46
|
-
- _sass/
|
50
|
+
- _sass/tag-cloud.scss
|
47
51
|
- _sass/user.scss
|
48
52
|
- assets/css/main.scss
|
49
53
|
homepage: https://gitlab.com/jekyll-theme-endless/jekyll-theme-endless.gitlab.io
|