jekyll-theme-amethyst 2.1.0 → 2.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2fac70f56f1769603d1d784c69d33c9fa40b9a200ef8eee0a8d126eb5c8178b1
4
- data.tar.gz: a59c9b8182e67c571ac5ef59488eef8dec691bec4f802ee966876cd1a0d33770
3
+ metadata.gz: b821452b60270650a16031ce0c02143e94cc397e8c99dd661318398d59576497
4
+ data.tar.gz: f23da2ecb2b942d07cdb71a96e2de9c30f3d2ad3506b4bc3ef1fa2548e59a04d
5
5
  SHA512:
6
- metadata.gz: fd6693f94f8f0c67f85dce79533fc0ac9b6fcc95d96e2cb3ec06afb60745e42c1b1f270c0fb27b6dd0361b6278383346a3e69f2f1a98cf2d94c81ed9bf0baeca
7
- data.tar.gz: 31ac837f404e4c5d2592b9c0034038f02db666c7c9de294002a8aaf73ba89b1e11d13adfc1554c558e55a1c5d7837c055ea2e88a11ea79a4575c5cce87749bc1
6
+ metadata.gz: 7739a80aa0ad3174a480b5302b6d8510fc3c0d219dfcebb6cfe6d2ff958ee87e346972b97102c5bc1bf13cd89dea9ce6996fb65d84fa0c693a9e1ea64eb6f7d4
7
+ data.tar.gz: 5cb9d1535f2899914db53358d579b846b233c0853d6210ac76f52c3c2844b38bd0d6b14791700740c5af5e049d814ee20aadf906b342ff7a15fbf71f5f52460b
@@ -53,7 +53,7 @@
53
53
  {% if page.layout == "post" and page.date and page.author %}
54
54
  <meta property="og:type" content="article">
55
55
  <meta property="article:published_time" content="{{ page.date | date_to_xmlschema }}">
56
- <meta name="author" content="{% include author-text.html author=page.author %}">
56
+ <meta name="author" content="{{ site.data.authors[include.author] | default: include.author | escape }}">
57
57
  {% endif %}
58
58
 
59
59
  {% endcapture -%}
data/_layouts/post.html CHANGED
@@ -11,8 +11,8 @@ layout: wrapper
11
11
  <p class="post-meta byline">Posted on <a href="{{ page.url | relative_url }}" rel="bookmark"><time itemprop="pubdate" datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date: date_format }}</time></a>{% if page.author %} by <span class="vcard"><span class="fn n" rel="author">
12
12
  {%- assign author_page = site.pages | where: "layout", "posts-author" | where: "author", page.author | first -%}
13
13
  {%- if author_page -%}
14
- <a href="{{ author_page.url | relative_url }}">{{ author_page.title | escape }}</a>
15
- {%- else -%}{{ page.author | escape }}
14
+ <a href="{{ author_page.url | relative_url }}">{{ site.data.authors[page.author] | default: page.author | escape }}</a>
15
+ {%- else -%}{{ site.data.authors[page.author] | default: page.author | escape}}
16
16
  {%- endif -%}</span></span>{% endif %}</p>
17
17
  </header>
18
18
  {{ content }}
@@ -12,7 +12,7 @@ amethyst:
12
12
  {%- for post in posts -%}
13
13
  <div class="post-row">
14
14
  <h2><a href="{{ post.url | relative_url }}">{{ post.title | escape }}</a></h2>
15
- <p class="post-meta">Posted on <time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: date_format }}</time>{% if post.author %} by {% include author-text.html author=post.author %}{% endif %}</p>
15
+ <p class="post-meta">Posted on <time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: date_format }}</time>{% if post.author %} by {{ site.data.authors[include.author] | default: include.author | escape }}{% endif %}</p>
16
16
  <div class="post">
17
17
  {{- post.excerpt -}}
18
18
  {%- if post.excerpt != post.content %}
@@ -12,7 +12,7 @@ amethyst:
12
12
  {%- for post in posts -%}
13
13
  <div class="post-row">
14
14
  <h2><a href="{{ post.url | relative_url }}">{{ post.title | escape }}</a></h2>
15
- <p class="post-meta">Posted on <time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: date_format }}</time>{% if post.author %} by {% include author-text.html author=post.author %}{% endif %}</p>
15
+ <p class="post-meta">Posted on <time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: date_format }}</time>{% if post.author %} by {{ site.data.authors[include.author] | default: include.author | escape }}{% endif %}</p>
16
16
  <div class="post">
17
17
  {{- post.excerpt -}}
18
18
  {%- if post.excerpt != post.content %}
data/_layouts/posts.html CHANGED
@@ -13,7 +13,7 @@ amethyst:
13
13
  {% for post in posts -%}
14
14
  <div class="post-row">
15
15
  <h2><a href="{{ post.url | relative_url }}">{{ post.title | escape }}</a></h2>
16
- <p class="post-meta">Posted on <time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: date_format }}</time>{% if post.author %} by {% include author-text.html author=post.author %}{% endif %}</p>
16
+ <p class="post-meta">Posted on <time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: date_format }}</time>{% if post.author %} by {{ site.data.authors[include.author] | default: include.author | escape }}{% endif %}</p>
17
17
  <div class="post">
18
18
  {{- post.excerpt -}}
19
19
  {%- if post.excerpt != post.content %}
@@ -37,3 +37,37 @@ module Jekyll
37
37
  end
38
38
 
39
39
  Liquid::Template.register_filter(Jekyll::AmethystFilters)
40
+
41
+ module AmethystPlugin
42
+
43
+ class AuthorPageWithoutAFile < Jekyll::PageWithoutAFile
44
+ def template
45
+ # The template of the permalink, can be customized e.g. to "/blog/author/:author/"
46
+ # for sites with both API docs and a blog.
47
+ site.config["amethyst"]["author_permalink"] || "/author/:author"
48
+ end
49
+
50
+ def url_placeholders
51
+ super.merge({
52
+ "author" => data["author"]
53
+ })
54
+ end
55
+ end
56
+
57
+ class AuthorPageGenerator < Jekyll::Generator
58
+ safe true
59
+
60
+ def generate(site)
61
+ site.data["authors"].each do |slug, name|
62
+ site.pages << AuthorPageWithoutAFile.new(site, site.source, 'author', "#{slug}.html").tap do |page|
63
+ page.data.merge!(
64
+ "layout" => "posts-author",
65
+ "title" => name,
66
+ "author" => slug
67
+ )
68
+ end
69
+ end
70
+ end
71
+ end
72
+
73
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-amethyst
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timo Tijhof
@@ -108,7 +108,6 @@ extensions: []
108
108
  extra_rdoc_files: []
109
109
  files:
110
110
  - LICENSE.txt
111
- - _includes/author-text.html
112
111
  - _includes/opengraph.html
113
112
  - _includes/search.html
114
113
  - _includes/sidebar.html
@@ -1,6 +0,0 @@
1
- {%- assign author_page = site.pages | where: "layout", "posts-author" | where: "author", include.author | first -%}
2
- {%- if author_page -%}
3
- {{ author_page.title | escape }}
4
- {%- else -%}
5
- {{ include.author | escape }}
6
- {%- endif -%}