jekyll-theme-endless 0.3.0 → 0.4.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 +23 -0
- data/_includes/function_show-dates.html +16 -0
- data/_includes/function_show-prev-next-navigation.html +13 -0
- data/_includes/function_tag-cloud.html +24 -7
- data/_includes/function_tag-list.html +15 -0
- data/_layouts/default.html +3 -3
- data/_layouts/html.html +1 -1
- data/_layouts/post.html +39 -9
- data/_sass/posts.scss +16 -0
- data/assets/css/main.scss +1 -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 +9 -3
- data/_plugins/generate-tagpages.rb +0 -76
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69ca0a202fdb3f05970cb2e99a6718220173c3383ab3649c3d4733d8d647ad8b
|
4
|
+
data.tar.gz: aa05cd183d0ae7ef3767b3ada0e101b48b515ccad38b50502ac5af04215c5275
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4a4dc344fcfe38993cc1ba0f88bc9c4eac5883bbeadfeafa5c5fea182c426ce059f24a774b6ac5b8fc9e90eed7bb0dbc71a37d74a1f5a68f93bf750b0be457a
|
7
|
+
data.tar.gz: 7137b1499ecf59cb76ad21ef4956838dbfa10ca45c2d64d278ee1976a92a62e982753fafb895f3a2905d7c3f12df34817f68f0813c661dfad48446af16df8d1d
|
data/README.adoc
CHANGED
@@ -3,6 +3,11 @@
|
|
3
3
|
:page-menu_position: 300
|
4
4
|
|
5
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
|
6
11
|
|
7
12
|
== Installation
|
8
13
|
|
@@ -195,6 +200,24 @@ username_xing: XXXX
|
|
195
200
|
username_linkedin: XXXX
|
196
201
|
----
|
197
202
|
|
203
|
+
`_includes/function_tag-list.html`::
|
204
|
+
Generates a formatted list of tags.
|
205
|
+
This is e.g. used to display the tags of a blog post.
|
206
|
+
|
207
|
+
`_includes/function_show-dates.html`::
|
208
|
+
Show the creation date and (if present) the date a blog post was last edited.
|
209
|
+
The date of the last edit can be configured by setting a value for the page-variable `lastedit`.
|
210
|
+
|
211
|
+
In AsciiDoc this would be e.g.:
|
212
|
+
|
213
|
+
[source, AsciiDoc]
|
214
|
+
----
|
215
|
+
:page-lastedit: 2020-10-29
|
216
|
+
----
|
217
|
+
|
218
|
+
`_includes/function_show-prev-next-navigation.html`::
|
219
|
+
Displays links to the previous and the next post of your blog.
|
220
|
+
|
198
221
|
|
199
222
|
|
200
223
|
=== Plugins
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<div class="text-right">
|
2
|
+
|
3
|
+
<time class="created" datetime="{{ include.created | date_to_xmlschema }}">
|
4
|
+
<span class="sr-only sr-only-focusable">created:</span>
|
5
|
+
<strong title="date of creation">{{ include.created | date: "%b %-d, %Y" }}</strong>
|
6
|
+
</time>
|
7
|
+
|
8
|
+
{% if include.edited != "" and include.edited %}
|
9
|
+
/
|
10
|
+
<time class="edited" datetime="{{ include.edited | date_to_xmlschema }}">
|
11
|
+
<span class="sr-only sr-only-focusable">edited:</span>
|
12
|
+
<strong title="date of last edit">{{ include.edited | date: "%b %-d, %Y" }}</strong>
|
13
|
+
</time>
|
14
|
+
{% endif %}
|
15
|
+
|
16
|
+
</div>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<div class="row text-left">
|
2
|
+
<div class="col">
|
3
|
+
{% if page.next %}
|
4
|
+
<a href="{{ page.next.url }}">« {{page.next.title}}</a>
|
5
|
+
{% endif %}
|
6
|
+
</div>
|
7
|
+
<div class="col text-right">
|
8
|
+
{% if page.previous %}
|
9
|
+
<a href="{{ page.previous.url }}">{{page.previous.title}} »</a>
|
10
|
+
{% endif %}
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
|
@@ -1,7 +1,24 @@
|
|
1
1
|
{% comment %}
|
2
|
+
Creates a tag cloud with tags beeing sized according to the number of occurences in blog posts.
|
3
|
+
{% endcomment %}
|
2
4
|
|
5
|
+
{% comment %}
|
6
|
+
Create an empty array.
|
7
|
+
{% endcomment %}
|
8
|
+
{% assign tags = "" | split:"" %}
|
9
|
+
|
10
|
+
{% comment %}
|
11
|
+
Fill the tags-array with tag-names.
|
12
|
+
The push-filter is a Jekyll specific filter.
|
13
|
+
{% endcomment %}
|
14
|
+
{% for tag in site.tags %}
|
15
|
+
{% assign tags = tags | push: tag.first %}
|
16
|
+
{% endfor %}
|
17
|
+
|
18
|
+
{% comment %}
|
19
|
+
Sort the tag-array case-insensitive.
|
3
20
|
{% endcomment %}
|
4
|
-
{% assign
|
21
|
+
{% assign tags_sorted = tags | sort_natural %}
|
5
22
|
|
6
23
|
{% comment %}
|
7
24
|
Requirements:
|
@@ -16,8 +33,8 @@ Assumption: Non of the tags occurs more than one million times.
|
|
16
33
|
{% assign min = 1000000 %}
|
17
34
|
{% assign max = 0 %}
|
18
35
|
|
19
|
-
{% for tag in
|
20
|
-
{% assign postsWithThisTag = tag |
|
36
|
+
{% for tag in tags_sorted %}
|
37
|
+
{% assign postsWithThisTag = site.tags[tag] | size %}
|
21
38
|
{% if postsWithThisTag > max %}
|
22
39
|
{% assign max = postsWithThisTag %}
|
23
40
|
{% endif %}
|
@@ -31,7 +48,7 @@ Assumption: Non of the tags occurs more than one million times.
|
|
31
48
|
|
32
49
|
<ul class="tag-cloud list-unstyled">
|
33
50
|
|
34
|
-
{% for tag in
|
51
|
+
{% for tag in tags_sorted %}
|
35
52
|
<li>
|
36
53
|
{% comment %}
|
37
54
|
The size difference should be 150%.
|
@@ -46,12 +63,12 @@ Assumption: Non of the tags occurs more than one million times.
|
|
46
63
|
To be on the safe side, create a float (times: 1.0)
|
47
64
|
{% endcomment %}
|
48
65
|
|
49
|
-
{% assign number = tag |
|
66
|
+
{% assign number = site.tags[tag] | size %}
|
50
67
|
{% assign percent = number | times: 1.0 | minus: min | times: sizeDifference | divided_by: steps | plus: 100 %}
|
51
|
-
{% assign tagname = tag |
|
68
|
+
{% assign tagname = tag | replace:'-', ' ' %}
|
52
69
|
|
53
70
|
<a
|
54
|
-
href = "/{{ site.tag_dir | default: 'tags' }}/{{ tag
|
71
|
+
href = "/{{ site.tag_dir | default: 'tags' }}/{{ tag }}"
|
55
72
|
style = "font-size: {{ percent }}%"
|
56
73
|
title = "Number of posts with the tag '{{ tagname }}': {{ number }}"
|
57
74
|
>{{ tagname }}</a>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
{% comment %}
|
2
|
+
Generates an unsorted list of tags.
|
3
|
+
Requires an array of tags beeing provided via the parameter `tags`.
|
4
|
+
{% endcomment %}
|
5
|
+
{% assign asize = include.tags | size %}
|
6
|
+
{% if asize > 0 %}
|
7
|
+
<ul class="list-inline">
|
8
|
+
{% for current_tag in include.tags %}
|
9
|
+
<li class="list-inline-item"><a
|
10
|
+
class="badge badge-pill badge-secondary"
|
11
|
+
href="/{{ site.tag_dir | default: 'tags' }}/{{ current_tag }}"
|
12
|
+
>{{ current_tag }}</a></li>
|
13
|
+
{% endfor %}
|
14
|
+
</ul>
|
15
|
+
{% endif %}
|
data/_layouts/default.html
CHANGED
@@ -51,15 +51,15 @@ layout: html
|
|
51
51
|
|
52
52
|
|
53
53
|
<!-- Page content -->
|
54
|
-
<main class="container pt-4
|
54
|
+
<main class="container pt-4" style="flex-grow: 1;" aria-label="Content">
|
55
55
|
|
56
56
|
<div class="row">
|
57
57
|
|
58
|
-
<div class="col-lg-8">
|
58
|
+
<div class="col-lg-8 pb-5">
|
59
59
|
{{ content }}
|
60
60
|
</div>
|
61
61
|
|
62
|
-
<div class="col-lg-4">
|
62
|
+
<div class="col-lg-4 pb-5">
|
63
63
|
<aside>
|
64
64
|
<h3>Blog Navigation</h3>
|
65
65
|
|
data/_layouts/html.html
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
<meta charset="utf-8">
|
9
9
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
10
10
|
<title>
|
11
|
-
{{ page.title }}
|
11
|
+
{{ page.title | default: page.menu_label | strip_html }}
|
12
12
|
</title>
|
13
13
|
|
14
14
|
<!-- Font-awesome CSS: https://www.bootstrapcdn.com/fontawesome/ -->
|
data/_layouts/post.html
CHANGED
@@ -1,12 +1,42 @@
|
|
1
1
|
---
|
2
2
|
layout: default
|
3
3
|
---
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
{% endcomment %}
|
8
|
-
{%
|
9
|
-
|
10
|
-
{%
|
11
|
-
|
12
|
-
|
4
|
+
<article>
|
5
|
+
<header>
|
6
|
+
|
7
|
+
{% comment %}Show link to previous/next post.{% endcomment %}
|
8
|
+
{% include function_show-prev-next-navigation.html %}
|
9
|
+
|
10
|
+
{% comment %}Show dates of the post.{% endcomment %}
|
11
|
+
{% include function_show-dates.html
|
12
|
+
created = page.date
|
13
|
+
edited = page.lastedit
|
14
|
+
%}
|
15
|
+
|
16
|
+
{% comment %}
|
17
|
+
In Markdown posts, page.title defaults to parts of the filename.
|
18
|
+
Thus, do not use `# Heading` in Blog posts, otherwise two H1-heading will appear.
|
19
|
+
{% endcomment %}
|
20
|
+
{% if page.title %}
|
21
|
+
<h1>{{ page.title }}</h1>
|
22
|
+
{% endif %}
|
23
|
+
|
24
|
+
{% comment %}Show tags of the post.{% endcomment %}
|
25
|
+
{% include function_tag-list.html
|
26
|
+
tags=page.tags
|
27
|
+
%}
|
28
|
+
|
29
|
+
</header>
|
30
|
+
|
31
|
+
<div>
|
32
|
+
{{ content }}
|
33
|
+
</div>
|
34
|
+
|
35
|
+
{% comment %}Show link to previous/next post.{% endcomment %}
|
36
|
+
{% include function_show-prev-next-navigation.html %}
|
37
|
+
|
38
|
+
</article>
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
data/_sass/posts.scss
ADDED
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.4.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-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -37,19 +37,25 @@ 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_show-dates.html
|
41
|
+
- _includes/function_show-prev-next-navigation.html
|
40
42
|
- _includes/function_tag-cloud.html
|
43
|
+
- _includes/function_tag-list.html
|
41
44
|
- _layouts/default.html
|
42
45
|
- _layouts/html.html
|
43
46
|
- _layouts/page-postlist.html
|
44
47
|
- _layouts/page-tag.html
|
45
48
|
- _layouts/page.html
|
46
49
|
- _layouts/post.html
|
47
|
-
- _plugins/generate-tagpages.rb
|
48
50
|
- _sass/address.scss
|
49
51
|
- _sass/background.scss
|
52
|
+
- _sass/posts.scss
|
50
53
|
- _sass/tag-cloud.scss
|
51
54
|
- _sass/user.scss
|
52
55
|
- assets/css/main.scss
|
56
|
+
- lib/jekyll-theme-endless.rb
|
57
|
+
- lib/jekyll-theme-endless/generate-tagpages.rb
|
58
|
+
- lib/jekyll-theme-endless/version.rb
|
53
59
|
homepage: https://gitlab.com/jekyll-theme-endless/jekyll-theme-endless.gitlab.io
|
54
60
|
licenses:
|
55
61
|
- MIT
|
@@ -1,76 +0,0 @@
|
|
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
|
-
|