willamette 0.9.1 → 0.9.2

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: 34641d8b1ea9d1a1b3f45cfb987cca4b7f677e26528f09cd937dea558de947db
4
- data.tar.gz: 87565d30bd6d1eb25a0fb3b66e066326192ceb0dd128e23dd9f285ee3523eb8e
3
+ metadata.gz: bd618dd52310a190a7592ac6ed51b60e0a03ea6e17a929da4b387311e8a6704d
4
+ data.tar.gz: 8f456abadabac5a51693bb77ea7da330ec3b6c4138ea1c41e004350980860040
5
5
  SHA512:
6
- metadata.gz: ecf0197ae7aa88a11168fa5a43e9efdd66c167f06dea126de8c7aa08dad140f6eb56e3981aec086908de379815df531463bd349ebf6933d0502e2de8da68cb6c
7
- data.tar.gz: 381e4de8e3fc44f301cf0ac7b79cd96b650eeac0a375fef6bada39ca2874469eaa8e53e9f42d8bcf3b50a86fd90fa5d368e87bea206006d60fcabf1a3f98b5b5
6
+ metadata.gz: 2a1c4daf43c9da9bf1cf5b9345ee29c29fc890c9dd7045eda27f74df8a5627cebb879892fb6595a3e4176b306407ee5cfbee3cce211144fd67f8af799ded758c
7
+ data.tar.gz: 23b6212410320068828225f25a2f5777b3e9e6fd81d35adcad61d175ab1cc789e3277a9b613202e2884d0590983b953d5fd92e212a83e45b10da113098a69c0c
data/.rubocop.yml CHANGED
@@ -30,6 +30,10 @@ Metrics/BlockLength:
30
30
  Exclude:
31
31
  - lib/willamette.rb
32
32
 
33
+ Layout/LineLength:
34
+ Exclude:
35
+ - test/**/*
36
+
33
37
  ### TODO: set up good rules for Streamlined! ###
34
38
  Layout/BlockEndNewline:
35
39
  Enabled: false
data/CHANGELOG.md CHANGED
@@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  - ...
11
11
 
12
+ ## [0.9.2] - 2026-05-07
13
+
14
+ - Keep explore menu open on mobile if previously opened
15
+ - Fix some HTML title escaping issues
16
+
12
17
  ## [0.9.1] - 2026-05-07
13
18
 
14
19
  - Make search icon truly optional, clean up TOC appearance
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- willamette (0.9.1)
4
+ willamette (0.9.2)
5
5
  bridgetown (>= 2.1, < 3.0)
6
6
  nokolexbor (>= 0.6)
7
7
 
@@ -90,7 +90,7 @@ create_file "src/_components/shared/sidebar.erb" do <<~HTML
90
90
  <% end %>
91
91
 
92
92
  <% if strategy.explore? %>
93
- <details open>
93
+ <details id="explore-menu" open>
94
94
  <summary><h2><wa-icon class="show-small-screen" name="bars"></wa-icon>
95
95
  <%= t "documentation.explore" %>
96
96
  </h2></summary>
@@ -102,7 +102,7 @@ create_file "src/_components/shared/sidebar.erb" do <<~HTML
102
102
  <% end %>
103
103
 
104
104
  <% if strategy.follow? %>
105
- <details open>
105
+ <details id="follow-menu" open>
106
106
  <summary><h2><wa-icon class="show-small-screen" name="bars"></wa-icon> <%= t "marketing.follow" %></h2></summary>
107
107
 
108
108
  <nav>
@@ -5,9 +5,6 @@ javascript_import do <<~JS
5
5
  JS
6
6
  end
7
7
 
8
- # gsub_file "frontend/javascript/index.js", %(import "@awesome.me/webawesome/dist/components/button/button.js"\n), ""
9
- # gsub_file "frontend/javascript/index.js", %(import "@awesome.me/webawesome/dist/components/icon/icon.js"\n), ""
10
-
11
8
  css = <<~CSS
12
9
  /* Import the base Web Awesome stylesheet: */
13
10
  @import "@awesome.me/webawesome/dist/styles/webawesome.css";
@@ -19,7 +19,7 @@ create_file "src/_layouts/page.erb" do <<~ERB
19
19
 
20
20
  <article class="<%= data.willamette&.article_classes %>">
21
21
 
22
- <h1><%= pipe(data.title) { strip_html | smartify } %></h1>
22
+ <h1><%= pipe(data.title) { strip_html | smartify | safe } %></h1>
23
23
 
24
24
  <%= yield %>
25
25
 
@@ -35,7 +35,7 @@ create_file "src/_layouts/post.erb" do <<~ERB
35
35
 
36
36
  <article class="<%= data.willamette&.article_classes %>">
37
37
 
38
- <h1><%= pipe(data.title) { strip_html | smartify } %></h1>
38
+ <h1><%= pipe(data.title) { strip_html | smartify | safe } %></h1>
39
39
 
40
40
  <%
41
41
  if data.image
@@ -66,7 +66,7 @@ create_file "src/_layouts/documentation.erb" do <<~ERB
66
66
 
67
67
  <article class="<%= data.willamette&.article_classes %>">
68
68
 
69
- <h1><%= pipe(data.title) { strip_html | smartify } %></h1>
69
+ <h1><%= pipe(data.title) { strip_html | smartify | safe } %></h1>
70
70
 
71
71
  <%= yield %>
72
72
 
@@ -1,6 +1,9 @@
1
1
  module Willamette
2
2
  class Builders::Inspectors < Bridgetown::Builder
3
- def build # rubocop:disable Metrics/CyclomaticComplexity
3
+ def build # rubocop:disable Metrics
4
+ # TODO: make these all optional/configurable
5
+
6
+ # Open external links in new windows
4
7
  inspect_html do |document|
5
8
  document.query_selector_all("a").each do |anchor|
6
9
  next if anchor[:target]
@@ -13,6 +16,7 @@ module Willamette
13
16
  end
14
17
  end
15
18
 
19
+ # Add visible hash anchors for headings
16
20
  inspect_html do |document|
17
21
  document.query_selector_all("article h2[id], article h3[id]").each do |heading|
18
22
  heading << document.create_text_node(" ")
@@ -23,6 +27,21 @@ module Willamette
23
27
  )
24
28
  end
25
29
  end
30
+
31
+ # Lazy-load images by default
32
+ inspect_html do |document|
33
+ main = document.query_selector("main")
34
+
35
+ main.query_selector_all("img").each do |img|
36
+ # TODO: evaluate if this fix should belong here or in Bridgetown Core
37
+ #if img[:src].start_with?("./")
38
+ # img[:src] = resource.relative_url + img[:src].delete_prefix(".")
39
+ #end
40
+ next if img[:loading]
41
+
42
+ img[:loading] = :lazy
43
+ end
44
+ end
26
45
  end
27
46
  end
28
47
  end
@@ -30,7 +30,7 @@ module Willamette
30
30
 
31
31
  if link.title
32
32
  anchor << doc.create_text_node(" ")
33
- anchor << doc.create_text_node(link.title)
33
+ anchor << @component.smartify(@component.strip_html(link.title))
34
34
  end
35
35
 
36
36
  item << anchor
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Willamette
4
- VERSION = "0.9.1"
4
+ VERSION = "0.9.2"
5
5
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "willamette",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
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.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bridgetown Team
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-05-07 00:00:00.000000000 Z
10
+ date: 2026-05-17 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: bridgetown