willamette 0.5.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.
Files changed (45) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +37 -0
  3. data/.rubocop.yml +54 -0
  4. data/CHANGELOG.md +14 -0
  5. data/CODE_OF_CONDUCT.md +92 -0
  6. data/Gemfile +15 -0
  7. data/Gemfile.lock +250 -0
  8. data/LICENSE.txt +22 -0
  9. data/README.md +3 -0
  10. data/Rakefile +11 -0
  11. data/automations/components.automation.rb +123 -0
  12. data/automations/frontend.automation.rb +30 -0
  13. data/automations/layouts.automation.rb +122 -0
  14. data/bridgetown.automation.rb +7 -0
  15. data/components/willamette/back_to_top.css +35 -0
  16. data/components/willamette/back_to_top.js +32 -0
  17. data/components/willamette/code_element.css +10 -0
  18. data/components/willamette/code_element.js +49 -0
  19. data/components/willamette/header_navbar.dsd.css +19 -0
  20. data/components/willamette/header_navbar.rb +20 -0
  21. data/components/willamette/holy_grail_layout.dsd.css +81 -0
  22. data/components/willamette/holy_grail_layout.rb +17 -0
  23. data/components/willamette/pagination.erb +12 -0
  24. data/components/willamette/pagination.rb +7 -0
  25. data/components/willamette/post_item.css +102 -0
  26. data/components/willamette/post_item.rb +90 -0
  27. data/components/willamette/previous_next.erb +12 -0
  28. data/components/willamette/previous_next.rb +7 -0
  29. data/components/willamette/search_dialog.rb +18 -0
  30. data/components/willamette/search_dialog_element.js +90 -0
  31. data/content/search.erb +29 -0
  32. data/content/willamette/style-guide.md +93 -0
  33. data/layouts/willamette/default.erb +44 -0
  34. data/lib/willamette/builders/inspectors.rb +28 -0
  35. data/lib/willamette/builders/toc.rb +11 -0
  36. data/lib/willamette/locales/en.yml +22 -0
  37. data/lib/willamette/strategies/link.rb +20 -0
  38. data/lib/willamette/strategies/sidebar.rb +83 -0
  39. data/lib/willamette/version.rb +5 -0
  40. data/lib/willamette.rb +83 -0
  41. data/package-lock.json +303 -0
  42. data/package.json +22 -0
  43. data/setup.automation.rb +14 -0
  44. data/willamette.gemspec +30 -0
  45. metadata +143 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 9149665415bc559f3f735689e21e66ef846f2e983b942981b470d00b6818a5a3
4
+ data.tar.gz: d0471972d4523082c8bca63f5b3a0b3a050e89df62a052c2e51a10bdccb65f0f
5
+ SHA512:
6
+ metadata.gz: 04c06c41d1f68a80083b6848838eb9513338d8dcc31d4d5e60a40a59ad27f8c3a4f2d1860949c987fa6b7295262716ec25ea172ddbea52d596987e488b26a908
7
+ data.tar.gz: bd7f4eb8fcfa4d1f40f7d7ce2cd64826784384d5cabf5939b27479146666dde5d5d7188d2311203ed5e13f23b54dc6f06f7dd74f091da0c49b59c51533a73205
data/.gitignore ADDED
@@ -0,0 +1,37 @@
1
+ /vendor
2
+ /.bundle/
3
+ /.yardoc
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
15
+ *.gem
16
+ .bundle
17
+
18
+ # Node
19
+ node_modules
20
+ .npm
21
+ .node_repl_history
22
+
23
+ # Yarn
24
+ yarn-error.log
25
+ yarn-debug.log*
26
+ .pnp/
27
+ .pnp.js
28
+
29
+ # Yarn Integrity file
30
+ .yarn-integrity
31
+
32
+ test/dest
33
+ .bridgetown-metadata
34
+ .bridgetown-cache
35
+ .bridgetown-webpack
36
+
37
+ .env
data/.rubocop.yml ADDED
@@ -0,0 +1,54 @@
1
+ require: rubocop-bridgetown
2
+
3
+ inherit_gem:
4
+ rubocop-bridgetown: .rubocop.yml
5
+
6
+ AllCops:
7
+ TargetRubyVersion: 3.2
8
+
9
+ Exclude:
10
+ - .gitignore
11
+ - .rubocop.yml
12
+ - "*.gemspec"
13
+
14
+ - Gemfile.lock
15
+ - CHANGELOG.md
16
+ - LICENSE.txt
17
+ - README.md
18
+ - Rakefile
19
+ - bridgetown.automation.rb
20
+
21
+ - automations/**/*
22
+ - script/**/*
23
+ - test/fixtures/**/*
24
+ - vendor/**/*
25
+
26
+ Style/FrozenStringLiteralComment:
27
+ Enabled: false
28
+
29
+ Metrics/BlockLength:
30
+ Exclude:
31
+ - lib/willamette.rb
32
+
33
+ ### TODO: set up good rules for Streamlined! ###
34
+ Layout/BlockEndNewline:
35
+ Enabled: false
36
+
37
+ Layout/SpaceBeforeBlockBraces:
38
+ Enabled: false
39
+
40
+ Layout/SpaceBeforeFirstArg:
41
+ Enabled: false
42
+
43
+ Layout/SpaceInsideBlockBraces:
44
+ Enabled: false
45
+
46
+ Layout/MultilineBlockLayout:
47
+ Enabled: false
48
+
49
+ Lint/MissingSuper:
50
+ Enabled: false
51
+
52
+ Style/EmptyStringInsideInterpolation:
53
+ Enabled: false
54
+ ###
data/CHANGELOG.md ADDED
@@ -0,0 +1,14 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ - ...
11
+
12
+ ## [0.1.0] - YYYY-MM-DD
13
+
14
+ - First version
@@ -0,0 +1,92 @@
1
+ # Contributor Covenant 3.0 Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We pledge to make our community welcoming, safe, and equitable for all.
6
+
7
+ We are committed to fostering an environment that respects and promotes the dignity, rights, and contributions of all individuals, regardless of characteristics including race, ethnicity, caste, color, age, physical characteristics, neurodiversity, disability, sex or gender, gender identity or expression, sexual orientation, language, philosophy or religion, national or social origin, socio-economic position, level of education, or other status. The same privileges of participation are extended to everyone who participates in good faith and in accordance with this Covenant.
8
+
9
+ ## Encouraged Behaviors
10
+
11
+ While acknowledging differences in social norms, we all strive to meet our community's expectations for positive behavior. We also understand that our words and actions may be interpreted differently than we intend based on culture, background, or native language.
12
+
13
+ With these considerations in mind, we agree to behave mindfully toward each other and act in ways that center our shared values, including:
14
+
15
+ 1. Respecting the **purpose of our community**, our activities, and our ways of gathering.
16
+ 2. Engaging **kindly and honestly** with others.
17
+ 3. Respecting **different viewpoints** and experiences.
18
+ 4. **Taking responsibility** for our actions and contributions.
19
+ 5. Gracefully giving and accepting **constructive feedback**.
20
+ 6. Committing to **repairing harm** when it occurs.
21
+ 7. Behaving in other ways that promote and sustain the **well-being of our community**.
22
+
23
+
24
+ ## Restricted Behaviors
25
+
26
+ We agree to restrict the following behaviors in our community. Instances, threats, and promotion of these behaviors are violations of this Code of Conduct.
27
+
28
+ 1. **Harassment.** Violating explicitly expressed boundaries or engaging in unnecessary personal attention after any clear request to stop.
29
+ 2. **Character attacks.** Making insulting, demeaning, or pejorative comments directed at a community member or group of people.
30
+ 3. **Stereotyping or discrimination.** Characterizing anyone’s personality or behavior on the basis of immutable identities or traits.
31
+ 4. **Sexualization.** Behaving in a way that would generally be considered inappropriately intimate in the context or purpose of the community.
32
+ 5. **Violating confidentiality**. Sharing or acting on someone's personal or private information without their permission.
33
+ 6. **Endangerment.** Causing, encouraging, or threatening violence or other harm toward any person or group.
34
+ 7. Behaving in other ways that **threaten the well-being** of our community.
35
+
36
+ ### Other Restrictions
37
+
38
+ 1. **Misleading identity.** Impersonating someone else for any reason, or pretending to be someone else to evade enforcement actions.
39
+ 2. **Failing to credit sources.** Not properly crediting the sources of content you contribute.
40
+ 3. **Promotional materials**. Sharing marketing or other commercial content in a way that is outside the norms of the community.
41
+ 4. **Irresponsible communication.** Failing to responsibly present content which includes, links or describes any other restricted behaviors.
42
+
43
+
44
+ ## Reporting an Issue
45
+
46
+ Tensions can occur between community members even when they are trying their best to collaborate. Not every conflict represents a code of conduct violation, and this Code of Conduct reinforces encouraged behaviors and norms that can help avoid conflicts and minimize harm.
47
+
48
+ When an incident does occur, it is important to report it promptly. To report a possible violation, **please message the project team at
49
+ [maintainers@bridgetownrb.com](mailto:maintainers@bridgetownrb.com).**
50
+
51
+ Community Moderators take reports of violations seriously and will make every effort to respond in a timely manner. They will investigate all reports of code of conduct violations, reviewing messages, logs, and recordings, or interviewing witnesses and other participants. Community Moderators will keep investigation and enforcement actions as transparent as possible while prioritizing safety and confidentiality. In order to honor these values, enforcement actions are carried out in private with the involved parties, but communicating to the whole community may be part of a mutually agreed upon resolution.
52
+
53
+
54
+ ## Addressing and Repairing Harm
55
+
56
+ ****
57
+
58
+ If an investigation by the Community Moderators finds that this Code of Conduct has been violated, the following enforcement ladder may be used to determine how best to repair harm, based on the incident's impact on the individuals involved and the community as a whole. Depending on the severity of a violation, lower rungs on the ladder may be skipped.
59
+
60
+ 1) Warning
61
+ 1) Event: A violation involving a single incident or series of incidents.
62
+ 2) Consequence: A private, written warning from the Community Moderators.
63
+ 3) Repair: Examples of repair include a private written apology, acknowledgement of responsibility, and seeking clarification on expectations.
64
+ 2) Temporarily Limited Activities
65
+ 1) Event: A repeated incidence of a violation that previously resulted in a warning, or the first incidence of a more serious violation.
66
+ 2) Consequence: A private, written warning with a time-limited cooldown period designed to underscore the seriousness of the situation and give the community members involved time to process the incident. The cooldown period may be limited to particular communication channels or interactions with particular community members.
67
+ 3) Repair: Examples of repair may include making an apology, using the cooldown period to reflect on actions and impact, and being thoughtful about re-entering community spaces after the period is over.
68
+ 3) Temporary Suspension
69
+ 1) Event: A pattern of repeated violation which the Community Moderators have tried to address with warnings, or a single serious violation.
70
+ 2) Consequence: A private written warning with conditions for return from suspension. In general, temporary suspensions give the person being suspended time to reflect upon their behavior and possible corrective actions.
71
+ 3) Repair: Examples of repair include respecting the spirit of the suspension, meeting the specified conditions for return, and being thoughtful about how to reintegrate with the community when the suspension is lifted.
72
+ 4) Permanent Ban
73
+ 1) Event: A pattern of repeated code of conduct violations that other steps on the ladder have failed to resolve, or a violation so serious that the Community Moderators determine there is no way to keep the community safe with this person as a member.
74
+ 2) Consequence: Access to all community spaces, tools, and communication channels is removed. In general, permanent bans should be rarely used, should have strong reasoning behind them, and should only be resorted to if working through other remedies has failed to change the behavior.
75
+ 3) Repair: There is no possible repair in cases of this severity.
76
+
77
+ This enforcement ladder is intended as a guideline. It does not limit the ability of Community Managers to use their discretion and judgment, in keeping with the best interests of our community.
78
+
79
+
80
+ ## Scope
81
+
82
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public or other spaces. Examples of representing our community include using an official email address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
83
+
84
+
85
+ ## Attribution
86
+
87
+ This Code of Conduct is adapted from the Contributor Covenant, version 3.0, permanently available at [https://www.contributor-covenant.org/version/3/0/](https://www.contributor-covenant.org/version/3/0/).
88
+
89
+ Contributor Covenant is stewarded by the Organization for Ethical Source and licensed under CC BY-SA 4.0. To view a copy of this license, visit [https://creativecommons.org/licenses/by-sa/4.0/](https://creativecommons.org/licenses/by-sa/4.0/)
90
+
91
+ For answers to common questions about Contributor Covenant, see the FAQ at [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are provided at [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations). Additional enforcement and community guideline resources can be found at [https://www.contributor-covenant.org/resources](https://www.contributor-covenant.org/resources). The enforcement ladder was inspired by the work of [Mozilla’s code of conduct team](https://github.com/mozilla/inclusion).
92
+
data/Gemfile ADDED
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+ gemspec
5
+
6
+ gem "bridgetown", ENV["BRIDGETOWN_VERSION"] if ENV["BRIDGETOWN_VERSION"]
7
+
8
+ group :test do
9
+ gem "minitest"
10
+ gem "minitest-profile"
11
+ gem "minitest-reporters"
12
+ end
13
+
14
+ gem "rubocop-bridgetown", "~> 0.7"
15
+ gem "solargraph", "~> 0.58.2"
data/Gemfile.lock ADDED
@@ -0,0 +1,250 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ willamette (0.5.0)
5
+ bridgetown (>= 2.1, < 3.0)
6
+ nokolexbor (>= 0.6)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ addressable (2.8.7)
12
+ public_suffix (>= 2.0.2, < 7.0)
13
+ amazing_print (1.8.1)
14
+ ansi (1.5.0)
15
+ ast (2.4.3)
16
+ backport (1.2.0)
17
+ base64 (0.3.0)
18
+ benchmark (0.5.0)
19
+ bigdecimal (3.3.1)
20
+ bridgetown (2.1.0)
21
+ bridgetown-builder (= 2.1.0)
22
+ bridgetown-core (= 2.1.0)
23
+ bridgetown-foundation (= 2.1.0)
24
+ bridgetown-paginate (= 2.1.0)
25
+ bridgetown-builder (2.1.0)
26
+ bridgetown-core (= 2.1.0)
27
+ bridgetown-core (2.1.0)
28
+ addressable (~> 2.4)
29
+ amazing_print (~> 1.2)
30
+ base64 (>= 0.3)
31
+ bigdecimal (>= 3.2)
32
+ bridgetown-foundation (= 2.1.0)
33
+ csv (~> 3.2)
34
+ erubi (~> 1.9)
35
+ faraday (~> 2.0)
36
+ faraday-follow_redirects (~> 0.3)
37
+ freyia (>= 0.5)
38
+ i18n (~> 1.0)
39
+ irb (>= 1.14)
40
+ kramdown (~> 2.1)
41
+ kramdown-parser-gfm (~> 1.0)
42
+ liquid (>= 5.0, < 5.5)
43
+ listen (~> 3.0)
44
+ rack (>= 3.0)
45
+ rackup (~> 2.0)
46
+ rake (>= 13.0)
47
+ roda (~> 3.46)
48
+ rouge (>= 3.0, < 5.0)
49
+ samovar (>= 2.4)
50
+ securerandom (~> 0.4)
51
+ serbea (>= 2.4.1)
52
+ signalize (~> 1.3)
53
+ streamlined (>= 0.6.0)
54
+ tilt (~> 2.0)
55
+ zeitwerk (>= 2.7.3)
56
+ bridgetown-foundation (2.1.0)
57
+ dry-inflector (>= 1.0)
58
+ hash_with_dot_access (~> 2.0)
59
+ inclusive (~> 1.0)
60
+ zeitwerk (~> 2.5)
61
+ bridgetown-paginate (2.1.0)
62
+ bridgetown-core (= 2.1.0)
63
+ builder (3.3.0)
64
+ concurrent-ruby (1.3.5)
65
+ console (1.34.2)
66
+ fiber-annotation
67
+ fiber-local (~> 1.1)
68
+ json
69
+ csv (3.3.5)
70
+ date (3.5.0)
71
+ diff-lcs (1.6.2)
72
+ dry-inflector (1.2.0)
73
+ erb (5.1.3)
74
+ erubi (1.13.1)
75
+ faraday (2.14.0)
76
+ faraday-net_http (>= 2.0, < 3.5)
77
+ json
78
+ logger
79
+ faraday-follow_redirects (0.4.0)
80
+ faraday (>= 1, < 3)
81
+ faraday-net_http (3.4.1)
82
+ net-http (>= 0.5.0)
83
+ ffi (1.17.2-x86_64-linux-gnu)
84
+ fiber-annotation (0.2.0)
85
+ fiber-local (1.1.0)
86
+ fiber-storage
87
+ fiber-storage (1.0.1)
88
+ freyia (0.6.1)
89
+ hash_with_dot_access (2.2.0)
90
+ i18n (1.14.7)
91
+ concurrent-ruby (~> 1.0)
92
+ inclusive (1.1.0)
93
+ io-console (0.8.1)
94
+ irb (1.15.3)
95
+ pp (>= 0.6.0)
96
+ rdoc (>= 4.0.0)
97
+ reline (>= 0.4.2)
98
+ jaro_winkler (1.7.0)
99
+ json (2.16.0)
100
+ kramdown (2.5.1)
101
+ rexml (>= 3.3.9)
102
+ kramdown-parser-gfm (1.1.0)
103
+ kramdown (~> 2.0)
104
+ language_server-protocol (3.17.0.5)
105
+ lint_roller (1.1.0)
106
+ liquid (5.4.0)
107
+ listen (3.9.0)
108
+ rb-fsevent (~> 0.10, >= 0.10.3)
109
+ rb-inotify (~> 0.9, >= 0.9.10)
110
+ logger (1.7.0)
111
+ mapping (1.1.3)
112
+ minitest (5.26.0)
113
+ minitest-profile (0.0.2)
114
+ minitest-reporters (1.7.1)
115
+ ansi
116
+ builder
117
+ minitest (>= 5.0)
118
+ ruby-progressbar
119
+ net-http (0.7.0)
120
+ uri
121
+ nokogiri (1.19.0-x86_64-linux-gnu)
122
+ racc (~> 1.4)
123
+ nokolexbor (0.6.2-x86_64-linux)
124
+ observer (0.1.2)
125
+ open3 (0.2.1)
126
+ ostruct (0.6.3)
127
+ parallel (1.27.0)
128
+ parser (3.3.10.0)
129
+ ast (~> 2.4.1)
130
+ racc
131
+ pp (0.6.3)
132
+ prettyprint
133
+ prettyprint (0.2.0)
134
+ prism (1.6.0)
135
+ psych (5.2.6)
136
+ date
137
+ stringio
138
+ public_suffix (6.0.2)
139
+ racc (1.8.1)
140
+ rack (3.2.4)
141
+ rackup (2.2.1)
142
+ rack (>= 3)
143
+ rainbow (3.1.1)
144
+ rake (13.3.1)
145
+ rb-fsevent (0.11.2)
146
+ rb-inotify (0.11.1)
147
+ ffi (~> 1.0)
148
+ rbs (3.10.3)
149
+ logger
150
+ tsort
151
+ rdoc (6.15.1)
152
+ erb
153
+ psych (>= 4.0.0)
154
+ tsort
155
+ regexp_parser (2.11.3)
156
+ reline (0.6.2)
157
+ io-console (~> 0.5)
158
+ reverse_markdown (3.0.2)
159
+ nokogiri
160
+ rexml (3.4.4)
161
+ roda (3.97.0)
162
+ rack
163
+ rouge (4.6.1)
164
+ rubocop (1.81.7)
165
+ json (~> 2.3)
166
+ language_server-protocol (~> 3.17.0.2)
167
+ lint_roller (~> 1.1.0)
168
+ parallel (~> 1.10)
169
+ parser (>= 3.3.0.2)
170
+ rainbow (>= 2.2.2, < 4.0)
171
+ regexp_parser (>= 2.9.3, < 3.0)
172
+ rubocop-ast (>= 1.47.1, < 2.0)
173
+ ruby-progressbar (~> 1.7)
174
+ unicode-display_width (>= 2.4.0, < 4.0)
175
+ rubocop-ast (1.47.1)
176
+ parser (>= 3.3.7.2)
177
+ prism (~> 1.4)
178
+ rubocop-bridgetown (0.7.0)
179
+ rubocop (~> 1.72)
180
+ rubocop-performance (~> 1.24)
181
+ rubocop-performance (1.26.1)
182
+ lint_roller (~> 1.1)
183
+ rubocop (>= 1.75.0, < 2.0)
184
+ rubocop-ast (>= 1.47.1, < 2.0)
185
+ ruby-progressbar (1.13.0)
186
+ samovar (2.4.1)
187
+ console (~> 1.0)
188
+ mapping (~> 1.0)
189
+ securerandom (0.4.1)
190
+ serbea (2.4.1)
191
+ erubi (>= 1.13)
192
+ tilt (>= 2.6)
193
+ signalize (1.3.1)
194
+ concurrent-ruby (~> 1.2)
195
+ solargraph (0.58.2)
196
+ ast (~> 2.4.3)
197
+ backport (~> 1.2)
198
+ benchmark (~> 0.4)
199
+ bundler (>= 2.0)
200
+ diff-lcs (~> 1.4)
201
+ jaro_winkler (~> 1.6, >= 1.6.1)
202
+ kramdown (~> 2.3)
203
+ kramdown-parser-gfm (~> 1.1)
204
+ logger (~> 1.6)
205
+ observer (~> 0.1)
206
+ open3 (~> 0.2.1)
207
+ ostruct (~> 0.6)
208
+ parser (~> 3.0)
209
+ prism (~> 1.4)
210
+ rbs (>= 3.6.1, <= 4.0.0.dev.4)
211
+ reverse_markdown (~> 3.0)
212
+ rubocop (~> 1.76)
213
+ thor (~> 1.0)
214
+ tilt (~> 2.0)
215
+ yard (~> 0.9, >= 0.9.24)
216
+ yard-activesupport-concern (~> 0.0)
217
+ yard-solargraph (~> 0.1)
218
+ streamlined (0.6.2)
219
+ serbea (>= 2.1)
220
+ zeitwerk (~> 2.5)
221
+ stringio (3.1.7)
222
+ thor (1.5.0)
223
+ tilt (2.6.1)
224
+ tsort (0.2.0)
225
+ unicode-display_width (3.2.0)
226
+ unicode-emoji (~> 4.1)
227
+ unicode-emoji (4.1.0)
228
+ uri (1.1.1)
229
+ yard (0.9.38)
230
+ yard-activesupport-concern (0.0.1)
231
+ yard (>= 0.8)
232
+ yard-solargraph (0.1.0)
233
+ yard (~> 0.9)
234
+ zeitwerk (2.7.3)
235
+
236
+ PLATFORMS
237
+ x86_64-linux-gnu
238
+
239
+ DEPENDENCIES
240
+ bundler
241
+ minitest
242
+ minitest-profile
243
+ minitest-reporters
244
+ rake (>= 13.0)
245
+ rubocop-bridgetown (~> 0.7)
246
+ solargraph (~> 0.58.2)
247
+ willamette!
248
+
249
+ BUNDLED WITH
250
+ 2.6.2
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025-present
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # Willamette: a Modern Theme for Bridgetown
2
+
3
+ _a work in progress…public beta release coming later in Q2 2026!_
data/Rakefile ADDED
@@ -0,0 +1,11 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList["test/**/test_*.rb"]
8
+ t.warning = false
9
+ end
10
+
11
+ task :default => :test
@@ -0,0 +1,123 @@
1
+ remove_file "src/_components/shared/navbar.rb"
2
+ create_file "src/_components/shared.rb" do <<~RUBY
3
+ module Shared
4
+ class Navbar < Bridgetown::Component
5
+ attr_reader :metadata, :resource
6
+
7
+ def initialize(metadata:, resource:) = (@metadata, @resource = metadata, resource)
8
+ end
9
+
10
+ class Sidebar < Bridgetown::Component
11
+ attr_reader :metadata, :resource, :strategy
12
+
13
+ # @param metadata [HashWithDotAccess::Hash]
14
+ # @param resource [Bridgetown::Resource::Base]
15
+ def initialize(metadata:, resource:)
16
+ @metadata, @resource = metadata, resource
17
+
18
+ explore_links = if resource.is_a?(Bridgetown::Resource::Base) && resource.collection.label == "docs"
19
+ Willamette.links_for(resource)
20
+ end
21
+
22
+ @strategy = Willamette.sidebar(
23
+ self,
24
+ description: metadata.description,
25
+ explore_links:,
26
+ follow_links: [
27
+ Willamette.link(icon: "rss", title: "Newsfeed", url: "/feed.xml"),
28
+ Willamette.link(icon: "bluesky", icon_family: "brands", title: "@myblue", url: "https://bsky.social"),
29
+ ],
30
+ subscribe: true,
31
+ see_also_links: [
32
+ Willamette.link(icon: "file-lines", title: "Another Project", url: "#/another"),
33
+ Willamette.link(icon: "keyboard", title: "Personal Journal", url: "#/journal"),
34
+ ]
35
+ )
36
+ end
37
+ end
38
+ end
39
+ RUBY
40
+ end
41
+
42
+ remove_file "src/_components/shared/navbar.erb"
43
+ create_file "src/_components/shared/navbar.erb" do <<~HTML
44
+ <header slot="header">
45
+ <%= dsd do %>
46
+ <%= render Willamette::HeaderNavbar.new %>
47
+ <% end %>
48
+
49
+ <a slot="logo" href="/">
50
+ <img src="<%= relative_url '/images/logo.svg' %>" alt="Website Logo" />
51
+ <span><%= metadata.title %></span>
52
+ </a>
53
+
54
+ <a href="<%= relative_url '/search' %>" slot="search"><wa-icon label="<%= t "labels.search" %>" name="search"></wa-icon> <span class="hide-for-mobile"><%= t "labels.search" %> <kbd style="vertical-align: 10%">⌘K</kbd></span></a>
55
+
56
+ <ul slot="nav">
57
+ <!-- customize this list! -->
58
+ <li><a href="<%= relative_url '/blog' %>">Blog</a></li>
59
+ <li><a href="<%= relative_url '/about' %>">About</a></li>
60
+ <li><a href="#"><wa-icon label="Mastodon" family="brands" name="mastodon"></wa-icon></a></li>
61
+ </ul>
62
+ </header>
63
+ HTML
64
+ end
65
+
66
+ create_file "src/_components/shared/sidebar.erb" do <<~HTML
67
+ <% if strategy.description? %>
68
+ <p><%= strategy.description %></p>
69
+ <% end %>
70
+
71
+ <% if strategy.explore? %>
72
+ <details open>
73
+ <summary><h2><wa-icon class="show-for-mobile" name="bars"></wa-icon>
74
+ <%= t "documentation.explore" %>
75
+ </h2></summary>
76
+
77
+ <nav>
78
+ <%= strategy.explore_links %>
79
+ </nav>
80
+ </details>
81
+ <% end %>
82
+
83
+ <% if strategy.follow? %>
84
+ <details open>
85
+ <summary><h2><wa-icon class="show-for-mobile" name="bars"></wa-icon> <%= t "marketing.follow" %></h2></summary>
86
+
87
+ <nav>
88
+ <%= strategy.follow_links %>
89
+ </nav>
90
+
91
+ <% if strategy.subscribe? %>
92
+ <h2><%= t "marketing.subscribe" %></h2>
93
+
94
+ <p><strong>Get important updates</strong> sent directly to your inbox.</p>
95
+
96
+ <form action="#/subscribe-url" method="post" class="wa-stack">
97
+ <label class="wa-size-s"><%= t "labels.email_address" %>
98
+ <input id="sidebar-subscribe-email" placeholder="me@example.com" type="email" name="email"></label>
99
+ <label class="wa-size-s"><%= t "labels.first_name" %>
100
+ <input id="sidebar-subscribe-name type="text" name="metadata__first_name"></label>
101
+
102
+ <p><button type="submit" class="wa-brand wa-size-s">
103
+ <wa-icon name="envelope"></wa-icon>
104
+ <span><%= t "labels.subscribe" %></span>
105
+ </button></p>
106
+
107
+ <p style="opacity:0.75"><small>Free of spam, promise!<br><a href="#/archives" style="font-weight: bold" target="_blank">Visit the Archives</a></small></p>
108
+ </form>
109
+ <% end %>
110
+ <% end %>
111
+
112
+ <% if strategy.see_also? %>
113
+ <h2><%= t "marketing.see_also" %></h2>
114
+
115
+ <nav>
116
+ <%= strategy.see_also_links %>
117
+ </nav>
118
+ <% end %>
119
+ </details>
120
+ HTML
121
+ end
122
+
123
+ gsub_file "src/_partials/_footer.erb", %(<footer>), %(<footer slot="footer">)
@@ -0,0 +1,30 @@
1
+ javascript_import do <<~JS
2
+ import Willamette from "willamette"
3
+
4
+ Willamette.init()
5
+ JS
6
+ end
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
+ css = <<~CSS
12
+ /* Import the base Web Awesome stylesheet: */
13
+ @import "@awesome.me/webawesome/dist/styles/webawesome.css";
14
+ @import "willamette/frontend/styles/theme.css";
15
+
16
+ /** Customize Willamette theme tokens or Web Awesome tokens (or make your own!) **/
17
+ :root {
18
+ /* --wll-color-brand: var(--wa-color-blue-50); */
19
+ /* --wll-color-brand: rgb(105, 26, 184); */
20
+ /* --wll-layout-padding: 2rem; */
21
+ }
22
+ CSS
23
+
24
+ remove_file "frontend/styles/index.css"
25
+ create_file "frontend/styles/index.css", css
26
+ remove_file "frontend/styles/syntax-highlighting.css"
27
+ create_file "frontend/styles/syntax-highlighting.css" do <<~CSS
28
+ /* Syntax highlighting is provided by Willamette based on GitHub Light/Dark. */
29
+ CSS
30
+ end