willamette 0.9.1 → 0.9.3

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: 241a44f5f27cc4a7e24cebb6bca2e10af1c50b264e3d77e33dc89fdd732f4492
4
+ data.tar.gz: be3eb2f192c2794a6da37d3ecef4fac95974b2ac0e2d9ff058f3c55b20de9615
5
5
  SHA512:
6
- metadata.gz: ecf0197ae7aa88a11168fa5a43e9efdd66c167f06dea126de8c7aa08dad140f6eb56e3981aec086908de379815df531463bd349ebf6933d0502e2de8da68cb6c
7
- data.tar.gz: 381e4de8e3fc44f301cf0ac7b79cd96b650eeac0a375fef6bada39ca2874469eaa8e53e9f42d8bcf3b50a86fd90fa5d368e87bea206006d60fcabf1a3f98b5b5
6
+ metadata.gz: 9c76fb3068735c824fdd3fca3ec5263ba482f3e4872314313c4ab19fc6ce932d1f70e5834ce17c4eaed284eab4192ae5948059bbcaaaba98801cc7be8628e0ab
7
+ data.tar.gz: 37021f7423e72911c1a3a50dcf1fb016d1500a05e2819bcb7d909fbe36220ffc2a1e3689e6ba8e904d605fc89918487b20e22cdff9b46be976f8210a390bc021
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,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  - ...
11
11
 
12
+ ## [0.9.3] - 2026-05-07
13
+
14
+ - Fix contents menu button on mobile so page titles don't overlay
15
+
16
+ ## [0.9.2] - 2026-05-07
17
+
18
+ - Keep explore menu open on mobile if previously opened
19
+ - Fix some HTML title escaping issues
20
+
12
21
  ## [0.9.1] - 2026-05-07
13
22
 
14
23
  - 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.3)
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
 
@@ -13,7 +13,7 @@
13
13
 
14
14
  <main slot="content" id="content">
15
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>
16
+ <button type="button" class="wa-outlined wa-size-s" onclick="document.body.classList.toggle('sidebar-end-open')"><wa-icon name="list"></wa-icon></button>
17
17
  </div>
18
18
 
19
19
  <main-contents<%= ' data-pagefind-body' unless data.exclude_from_pagefind %>>
@@ -31,7 +31,7 @@
31
31
 
32
32
  <aside slot="sidebar-end" hidden>
33
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>
34
+ <button type="button" class="wa-outlined wa-size-s" onclick="document.body.classList.toggle('sidebar-end-open')"><wa-icon name="close"></wa-icon></button>
35
35
  </div>
36
36
  <h2><%= t "documentation.contents" %></h2>
37
37
 
@@ -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.3"
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.3",
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.3
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