willamette 0.5.1 → 0.6.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: 9ba226dec5ae8415607d57cd071bd83677e191c9e8d8f165fd664b8a15ede8eb
4
- data.tar.gz: 69037fb05b3ba2dd3398db6ecbcc32db312a5cf2487820d9cff2c036e0d36d50
3
+ metadata.gz: b14600bc1b9466fbdeaae3e1add8e22c329a429809c59a352078980a79f12632
4
+ data.tar.gz: f5df323495a95da1c249714d97872e0e0502ca7804927988f8e6396a46d5d4b9
5
5
  SHA512:
6
- metadata.gz: 580fc1a9c6f76ac9043d9bf1cccde630cfa90d9891039eab5eda0fd1b48bb3262aeca64d5445c3220b386dae119a20138f862ab26c97f959ff5814a12a740073
7
- data.tar.gz: b5722b5511bbf10a521495246209e83f9f26ff49bb4da13a857d73ad8a8004631094ee889f09393a8dcebe54e25fd6d8f785b82a3d8a05192da520863d646199
6
+ metadata.gz: 5fd4dff6fc3f50dab2807d5a55b03219a9e7c84fcf40f9a8782f7826162676dc4157447bf7b14cfc87a5a10803f3cd663f4aabbfbac0edcccc1a462720405953
7
+ data.tar.gz: b7d4a23d04a9490b52d2eb139bbc0127b81a3f9b3a9725ca830c66c590e1b9d0e4bed76a96b1a11741390db5cda0d63a566a4b0760726c7d09a264ac8700788e
data/CHANGELOG.md CHANGED
@@ -9,6 +9,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  - ...
11
11
 
12
+ ## [0.6.0] - 2026-04-23
13
+
14
+ - Clean up layout settings, improve blockquotes and image bleeds
15
+ - Add post metadata component, icons, improved styles
16
+
17
+ ## [0.5.2] - 2026-04-03
18
+
19
+ - Add `author_name` resource extension method
20
+
12
21
  ## [0.5.1] - 2026-04-02
13
22
 
14
23
  - Remove `swap` display from fonts CSS
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- willamette (0.5.1)
4
+ willamette (0.6.0)
5
5
  bridgetown (>= 2.1, < 3.0)
6
6
  nokolexbor (>= 0.6)
7
7
 
@@ -70,7 +70,7 @@ create_file "src/_components/shared/sidebar.erb" do <<~HTML
70
70
 
71
71
  <% if strategy.explore? %>
72
72
  <details open>
73
- <summary><h2><wa-icon class="show-for-mobile" name="bars"></wa-icon>
73
+ <summary><h2><wa-icon class="show-small-screen" name="bars"></wa-icon>
74
74
  <%= t "documentation.explore" %>
75
75
  </h2></summary>
76
76
 
@@ -82,7 +82,7 @@ create_file "src/_components/shared/sidebar.erb" do <<~HTML
82
82
 
83
83
  <% if strategy.follow? %>
84
84
  <details open>
85
- <summary><h2><wa-icon class="show-for-mobile" name="bars"></wa-icon> <%= t "marketing.follow" %></h2></summary>
85
+ <summary><h2><wa-icon class="show-small-screen" name="bars"></wa-icon> <%= t "marketing.follow" %></h2></summary>
86
86
 
87
87
  <nav>
88
88
  <%= strategy.follow_links %>
@@ -40,22 +40,17 @@ create_file "src/_layouts/post.erb" do <<~ERB
40
40
  image_alt = data.image.is_a?(String) ? t("content.featured_post_image") : data.image.alt
41
41
  image_caption = data.image.is_a?(String) ? nil : data.image.caption
42
42
  %>
43
- <figure class="full-main-<%= data.image_bleed ? "bleed" : "size" %>">
43
+ <figure class="<%= data.image_bleed ? "inline-bleed" : "" %>">
44
44
  <img src="<%= image_path %>" alt="" />
45
45
  <% if image_caption %>
46
46
  <figcaption><%= markdownify image_caption %></figcaption>
47
47
  <% end %>
48
48
  </figure>
49
49
  <% end %>
50
-
50
+
51
51
  <%= yield %>
52
-
53
- <hr />
54
-
55
- <wa-icon class="article-metadata" name="newspaper"></wa-icon>
56
- <p class="article-metadata"><article-author>by So and So</article-author></p>
57
- <p class="article-metadata"><time><%= pipe(resource.date) { to_date | l(format: :long) } %></time></p>
58
- <p class="article-metadata"><article-tags>#foo #BarBaz</article-tags></p>
52
+
53
+ <%= render Willamette::PostMetadata.new(post: resource) %>
59
54
 
60
55
  </article>
61
56
  ERB
@@ -0,0 +1,15 @@
1
+ <wll-post-metadata>
2
+ <wa-icon class="wll-decoration" name="newspaper"></wa-icon>
3
+ <p><wa-icon name="calendar"></wa-icon> <time><%= pipe(@post.date) { to_date | l(format: :long) } %></time></p>
4
+ <p><wa-icon name="user-pen"></wa-icon> <wll-post-author>by <%= @post.author_name %></wll-post-author></p>
5
+ <% if @post.data.categories.length.positive? %>
6
+ <p><wa-icon name="paperclip"></wa-icon> <% @post.data.categories.each do |category| %>
7
+ <wll-post-category><%= t("categories.#{category}", default: category) %></wll-post-category>
8
+ <% end %></p>
9
+ <% end %>
10
+ <% if @post.data.tags.length.positive? %>
11
+ <p><wa-icon name="tags"></wa-icon> <% @post.data.tags.each do |tag| %>
12
+ <wll-post-tag>#<%= tag %></wll-post-tag>
13
+ <% end %></p>
14
+ <% end %>
15
+ </wll-post-metadata>
@@ -0,0 +1,5 @@
1
+ class Willamette::PostMetadata < Bridgetown::Component
2
+ def initialize(post:)
3
+ @post = post
4
+ end
5
+ end
@@ -3,14 +3,18 @@
3
3
  <head>
4
4
  <%= render "head", metadata: site.metadata, title: data.title %>
5
5
  </head>
6
- <body class="OFF:wll-grid-lines OFF:wll-code-dark <%= data.layout %> <%= data.page_class %>">
6
+ <body class="<%=
7
+ class_map("wll-grid-lines": site.config.willamette.layout.grid_lines, "wll-code-dark": site.config.willamette.layout.code_dark)
8
+ %> <%= data.layout %> <%= data.page_class %>">
7
9
  <%= dsd do %>
8
10
  <%= render Willamette::HolyGrailLayout.new %>
9
11
  <% end %>
10
12
  <%= render Shared::Navbar.new(metadata: site.metadata, resource:) %>
11
13
 
12
14
  <main slot="content" id="content">
13
- <div hidden class="show-for-tablet" style="position: absolute; right: var(--wa-space-m)"><button type="button" class="wa-outlined" onclick="document.body.classList.toggle('sidebar-end-open')"><wa-icon name="list"></wa-icon></button></div>
15
+ <div hidden class="show-mid-screen">
16
+ <button type="button" class="wa-outlined" onclick="document.body.classList.toggle('sidebar-end-open')"><wa-icon name="list"></wa-icon></button>
17
+ </div>
14
18
 
15
19
  <main-contents <%= "data-pagefind-body" unless data.exclude_from_pagefind %>>
16
20
  <%= yield %>
@@ -26,15 +30,16 @@
26
30
  </aside>
27
31
 
28
32
  <aside slot="sidebar-end" hidden>
29
- <!-- TODO: this should be in a shared component -->
30
- <div class="show-for-tablet" style="position: absolute; right: var(--wa-space-m)"><button type="button" class="wa-outlined" onclick="document.body.classList.toggle('sidebar-end-open')"><wa-icon name="close"></wa-icon></button></div>
33
+ <div class="show-mid-screen">
34
+ <button type="button" class="wa-outlined" onclick="document.body.classList.toggle('sidebar-end-open')"><wa-icon name="close"></wa-icon></button>
35
+ </div>
31
36
  <h2><%= t "documentation.contents" %></h2>
32
37
 
33
38
  <%= slotted :toc %>
34
39
 
35
40
  <hr />
36
41
 
37
- <!-- TOC will be relocated here -->
42
+ <!-- TOC insertion -->
38
43
  </aside>
39
44
 
40
45
  <%= render "footer", metadata: site.metadata %>
@@ -0,0 +1,33 @@
1
+ module Willamette
2
+ class Builders::AuthorExtension < Bridgetown::Builder
3
+ def build
4
+ define_resource_method :author_name
5
+ end
6
+
7
+ def author_name # rubocop:todo Metrics/CyclomaticComplexity
8
+ anon = "Anonymous"
9
+ return anon unless resource
10
+
11
+ resource_author = resource.data.author
12
+ found_author = case resource_author
13
+ when String
14
+ site.signals.authors ?
15
+ site.signals.authors[resource_author]&.name :
16
+ resource_author
17
+ when Hash
18
+ resource_author.name
19
+ end
20
+
21
+ found_author || default_metadata || anon
22
+ end
23
+
24
+ def default_metadata
25
+ case site.metadata.author
26
+ when String
27
+ site.metadata.author
28
+ when Hash
29
+ site.metadata.author.name
30
+ end
31
+ end
32
+ end
33
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Willamette
4
- VERSION = "0.5.1"
4
+ VERSION = "0.6.0"
5
5
  end
data/lib/willamette.rb CHANGED
@@ -10,6 +10,7 @@ module Willamette
10
10
  end
11
11
  end
12
12
 
13
+ require "willamette/builders/author_extension"
13
14
  require "willamette/builders/inspectors"
14
15
  require "willamette/builders/toc"
15
16
  require "willamette/strategies/link"
@@ -28,16 +29,17 @@ Kramdown::Converter::Html.class_eval do
28
29
  end
29
30
 
30
31
  # @param config [Bridgetown::Configuration::ConfigurationDSL]
31
- Bridgetown.initializer :willamette do |config, docs_url_segment: "docs"|
32
+ Bridgetown.initializer :willamette do |config, docs_url_segment: "docs", layout: {}|
32
33
  # Add code here which will run when a site includes
33
34
  # `init :willamette`
34
35
  # in its configuration
35
36
 
36
37
  # Add default configuration data:
37
38
  config.willamette ||= {}
38
- config.willamette.my_setting ||= 123
39
+ config.willamette.layout ||= layout
39
40
 
40
41
  # Register your builders:
42
+ config.builder Willamette::Builders::AuthorExtension
41
43
  config.builder Willamette::Builders::Inspectors
42
44
  config.builder Willamette::Builders::Toc
43
45
  config.builder :WillametteRegisterPermalinkPlaceholders do
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "willamette",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "main": "frontend/javascript/index.js",
5
5
  "repository": {
6
6
  "type": "git",
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: willamette
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bridgetown Team
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-04-02 00:00:00.000000000 Z
10
+ date: 2026-04-24 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: bridgetown
@@ -101,6 +101,8 @@ files:
101
101
  - components/willamette/pagination.rb
102
102
  - components/willamette/post_item.css
103
103
  - components/willamette/post_item.rb
104
+ - components/willamette/post_metadata.erb
105
+ - components/willamette/post_metadata.rb
104
106
  - components/willamette/previous_next.erb
105
107
  - components/willamette/previous_next.rb
106
108
  - components/willamette/search_dialog.rb
@@ -109,6 +111,7 @@ files:
109
111
  - content/willamette/style-guide.md
110
112
  - layouts/willamette/default.erb
111
113
  - lib/willamette.rb
114
+ - lib/willamette/builders/author_extension.rb
112
115
  - lib/willamette/builders/inspectors.rb
113
116
  - lib/willamette/builders/toc.rb
114
117
  - lib/willamette/locales/en.yml