jekyll-theme-amethyst 2.2.1 → 2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 33f7b0f9d251222c85f49f4af58db521600c1181d7e48b2ae10909cae943d7c1
4
- data.tar.gz: 6266b78cf47fca3f3f8004f5e014e2b264d0aa7e2ea7f64952162b15c90a0ea4
3
+ metadata.gz: fc393106dfbf4834a28cd8a2b51fb278658e64ad6af6356561c0e3bfab76adf5
4
+ data.tar.gz: e774ffc6f990b590526ff5ffeb296f9303aa63a4c61bd4cdcfb122b2166d8b51
5
5
  SHA512:
6
- metadata.gz: e727632a049809d4f346d2d9cf89fc13a21e6428f87cb4b806edda1765be44611abff2c05d470902510d2099dee40bb234439169692fe08eb2d3adcbb532a4a1
7
- data.tar.gz: a2f951769200180f3e5159c63af66641c8155b45ceeef2fb3e21d74b86643ebb3c4ed297dc23a899dd27f18c1b37e3235aa289a0f5186a2a88130d8699511147
6
+ metadata.gz: 5182dc86a1e6fa2e2723488029f7c84c8c25528a1c1bd332e5a16cd5e6fcae2cd88f4f91f92b3fe8822c10c61032c095427e9092a8af588fe5964e15380e3d1f
7
+ data.tar.gz: c8701134ac06e006c7bb025de2303835c761fd699f48580f689ce68725500d6f36b7abf0218217c3a36ec6078116f1e442bb5c03fca8cc4a927c5f8521e992f0
@@ -15,7 +15,11 @@ Block data:
15
15
  - "group" to query a list of pages from a page group.
16
16
  - "list" to specify your own custom list.
17
17
  - "link" to specify a single link.
18
- - "archive" to query a list of chronological pages based on their layout.
18
+ - "archive" to query a list of chronological pages using the 'posts-year' layout.
19
+ This is designed for use with the jekyll-archives plugin, with a separate
20
+ archive page for each year.
21
+ - "archive-flat" to generate links to anchors on a singular flat 'posts-archive' page.
22
+ This is designed for blogs with less than ~1,000 posts.
19
23
  - "tags" to query a list of alphabetical pages based on their layout.
20
24
 
21
25
  * title: [Default: group_page.title or ""]
@@ -67,6 +71,9 @@ Block data:
67
71
  {%- assign block_contents = site.pages | where: "layout", "posts-year" | sort_natural: 'date' | reverse -%}
68
72
  {%- assign group_page = site.pages | where: "layout", "posts-archive" | first -%}
69
73
  {%- assign block_url = block.url | default: group_page.url -%}
74
+ {%- elsif block_type == "archive-flat" -%}
75
+ {%- assign group_page = site.pages | where: "layout", "posts-archive" | first -%}
76
+ {%- assign block_url = block.url | default: group_page.url -%}
70
77
  {%- elsif block_type == "tags" -%}
71
78
  {%- assign block_contents = site.pages | where: "layout", "posts-tag" | sort_natural: 'title' -%}
72
79
  {%- elsif block_type == "link" -%}
@@ -95,6 +102,12 @@ Block data:
95
102
  <h4 {%- if block_expand %} class="sidebar-title-open"{% endif %}>{% if block_url %}<a href="{{ block_url | relative_url }}">{{ block_title }}</a>{% else %}{{ block_title }}{% endif %}</h4>
96
103
  {% if block_expand -%}
97
104
  <ul class="sidebar-list">
105
+ {%- if block_type == "archive-flat" -%}
106
+ {%- for year in site.data.amethyst_post_years -%}
107
+ {%- assign year_page = site.pages | where: "layout", "posts-year" | sort_natural: 'title' -%}
108
+ <li class="sidebar-item"><a href="{{ block_url | relative_url }}#{{ year | escape }}">{{ year | escape }}</a></li>
109
+ {%- endfor -%}
110
+ {%- else -%}
98
111
  {%- for entry in block_contents -%}
99
112
  <li class="sidebar-item{% if page.url == entry.url %} sidebar-item-active{% endif %}">
100
113
  <a href="{{ entry.url | relative_url }}">
@@ -102,10 +115,11 @@ Block data:
102
115
  {%- if entry.title == nil and entry.date -%}
103
116
  {%- assign entry_title = entry.date | date: '%Y' -%}
104
117
  {%- endif -%}
105
- {{- entry_title -}}
118
+ {{- entry_title | escape -}}
106
119
  </a>
107
120
  </li>
108
121
  {%- endfor -%}
122
+ {%- endif -%}
109
123
  </ul>
110
124
  {%- endif -%}
111
125
  {%- endfor -%}
@@ -5,13 +5,20 @@ amethyst:
5
5
  ---
6
6
 
7
7
  <div class="main main--columns wrapper">
8
- {%- assign date_format = site.amethyst.date_format | default: "%e %B %Y" -%}
8
+ {%- assign date_format_archive = site.amethyst.date_format_archive | default: "%B %Y" -%}
9
9
  {%- assign posts = site.posts -%}
10
+ {%- assign prev_year = false -%}
10
11
  <div class="posts content">
11
12
  <h1>{{ page.title }}</h1>
12
- <ul>
13
13
  {% for post in posts -%}
14
- <li><a href="{{ post.url | relative_url }}">{{ post.title | escape }}</a>, <time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: date_format }}</time>.</li>
14
+ {%- assign post_year = post.date | date: '%Y' -%}
15
+ {%- if post_year != prev_year -%}
16
+ {%- if prev_year != false %}</ul>{% endif %}
17
+ <p id="{{ post_year | escape }}"><strong>{{ post_year | escape }}</strong></p>
18
+ <ul>
19
+ {%- assign prev_year = post_year -%}
20
+ {%- endif %}
21
+ <li><a href="{{ post.url | relative_url }}">{{ post.title | escape }}</a>, <time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: date_format_archive }}</time></li>
15
22
  {%- endfor -%}
16
23
  </ul>
17
24
  </div>
@@ -5,19 +5,15 @@ amethyst:
5
5
  ---
6
6
 
7
7
  <div class="main main--columns wrapper">
8
- {%- assign date_format = site.amethyst.date_format | default: "%e %B %Y" -%}
8
+ {%- assign date_format_archive = site.amethyst.date_format_archive | default: "%B %Y" -%}
9
9
  {%- assign posts = site.posts | where: 'author', page.author -%}
10
10
  <div class="posts content">
11
11
  <h1>Author: {{ page.title | escape }}</h1>
12
- {%- for post in posts -%}
13
- <div class="post-row">
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></p>
16
- <div class="post">
17
- {{- post.excerpt -}}
18
- </div>
19
- </div>
12
+ <ul>
13
+ {% for post in posts -%}
14
+ <li><a href="{{ post.url | relative_url }}">{{ post.title | escape }}</a>, <time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: date_format_archive }}</time></li>
20
15
  {%- endfor -%}
16
+ </ul>
21
17
  </div>
22
18
  {% include sidebar.html blocks="sidebar_blog" %}
23
19
  </div>
@@ -5,22 +5,15 @@ amethyst:
5
5
  ---
6
6
 
7
7
  <div class="main main--columns wrapper">
8
- {%- assign date_format = site.amethyst.date_format | default: "%e %B %Y" -%}
8
+ {%- assign date_format_archive = site.amethyst.date_format_archive | default: "%B %Y" -%}
9
9
  {%- assign posts = site.tags[page.tag] -%}
10
10
  <div class="posts content">
11
11
  <h1>Tag: {{ page.title | escape }}</h1>
12
- {%- for post in posts -%}
13
- <div class="post-row">
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 {{ site.data.authors[post.author] | default: post.author | escape }}{% endif %}</p>
16
- <div class="post">
17
- {{- post.excerpt -}}
18
- {%- if post.excerpt != post.content %}
19
- <a class="screen-reader-text" href="{{ post.url | relative_url }}">Continue reading "{{ post.title | escape }}".</a>
20
- {%- endif -%}
21
- </div>
22
- </div>
12
+ <ul>
13
+ {% for post in posts -%}
14
+ <li><a href="{{ post.url | relative_url }}">{{ post.title | escape }}</a>, <time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: date_format_archive }}</time></li>
23
15
  {%- endfor -%}
16
+ </ul>
24
17
  </div>
25
18
  {% include sidebar.html blocks="sidebar_blog" %}
26
19
  </div>
@@ -5,19 +5,16 @@ amethyst:
5
5
  ---
6
6
 
7
7
  <div class="main main--columns wrapper">
8
- {%- assign date_format = site.amethyst.date_format | default: "%e %B %Y" -%}
8
+ {%- assign date_format_archive = site.amethyst.date_format_archive | default: "%B %Y" -%}
9
9
  {%- assign posts = page.posts -%}
10
10
  <div class="posts content">
11
11
  <h1>Archive: {{ page.date | date: '%Y' }}</h1>
12
- {%- for post in posts -%}
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 {{ site.data.authors[post.author] | default: post.author | escape }}{% endif %}</p>
15
+ <p class="post-meta">Posted on {{ post.date | date: date_format_archive }}</time>{% if post.author %} by {{ site.data.authors[post.author] | default: post.author | escape }}{% endif %}</p>
16
16
  <div class="post">
17
- {{- post.excerpt -}}
18
- {%- if post.excerpt != post.content %}
19
- <a class="screen-reader-text" href="{{ post.url | relative_url }}">Continue reading "{{ post.title | escape }}".</a>
20
- {%- endif -%}
17
+ <p>{{- post.excerpt | strip_html -}}</p>
21
18
  </div>
22
19
  </div>
23
20
  {%- endfor -%}
data/_layouts/posts.html CHANGED
@@ -6,17 +6,17 @@ amethyst:
6
6
  ---
7
7
 
8
8
  <div class="main main--columns wrapper">
9
- {%- assign date_format = site.amethyst.date_format | default: "%e %B %Y" -%}
9
+ {%- assign date_format_archive = site.amethyst.date_format_archive | default: "%B %Y" -%}
10
10
  {%- assign posts = site.posts | slice: 0, 10 -%}
11
11
  <div class="posts content">
12
12
  <h1>{{ page.title }}</h1>
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 {{ site.data.authors[post.author] | default: post.author | escape }}{% endif %}</p>
16
+ <p class="post-meta">Posted on {{ post.date | date: date_format_archive }}</time>{% if post.author %} by {{ site.data.authors[post.author] | default: post.author | escape }}{% endif %}</p>
17
17
  <div class="post">
18
- {{- post.excerpt -}}
19
- {%- if post.excerpt != post.content %}
18
+ <p>{{- post.excerpt | strip_html -}}</p>
19
+ {%- if post.excerpt != post.content -%}
20
20
  <a class="screen-reader-text" href="{{ post.url | relative_url }}">Continue reading "{{ post.title | escape }}".</a>
21
21
  {%- endif -%}
22
22
  </div>
data/_sass/amethyst.scss CHANGED
@@ -759,6 +759,9 @@ article > header {
759
759
 
760
760
  /* Layout: posts */
761
761
 
762
+ .posts > ul > li::marker {
763
+ color: $color-off-white;
764
+ }
762
765
 
763
766
  .post-row h2 {
764
767
  margin-bottom: $size-1;
@@ -768,6 +771,15 @@ article > header {
768
771
  margin-bottom: $size-sm;
769
772
  }
770
773
 
774
+ .post-read-more {
775
+ // avoid spanning "continue" "reading" over two different lines
776
+ // prefer inline if it fits, otherwise on the next line
777
+ // but, don't force `white-space: nowrap` either
778
+ display: inline-block;
779
+ font-size: $size-sm;
780
+ vertical-align: text-bottom;
781
+ }
782
+
771
783
  /* Site footer */
772
784
 
773
785
  .site-footer {
@@ -17,6 +17,7 @@
17
17
  # ```
18
18
  #
19
19
  require "digest"
20
+ require "set"
20
21
 
21
22
  module Jekyll
22
23
  module AmethystFilters
@@ -70,4 +71,14 @@ module AmethystPlugin
70
71
  end
71
72
  end
72
73
 
74
+ class YearDataGenerator < Jekyll::Generator
75
+ safe true
76
+
77
+ def generate(site)
78
+ s = Set.new()
79
+ site.posts&.docs&.each { |post| s.add(post.date.strftime('%Y')) }
80
+ site.data["amethyst_post_years"] = s.to_a.sort!.reverse!
81
+ end
82
+ end
83
+
73
84
  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.2.1
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timo Tijhof