Welcome to your new Bridgetown website! You can update this README file to provide additional context and setup information for yourself or other contributors.
- Ruby
>= 3.3
- Bridgetown gem
gem install bridgetown -N
- Node
>= 22
cd bridgetown-site-folder
bundle install && npm installLearn more: Bridgetown Getting Started Documentation.
To start your site in development mode, run bin/bridgetown start and navigate to localhost:4000!
Check out plugins if you're looking to add functionality or a theme to your site.
# running locally
bin/bridgetown start
# build & deploy to production
bin/bridgetown deploy
# load the site up within a Ruby console (IRB)
bin/bridgetown consoleLearn more: Bridgetown CLI Documentation
The site ships in two versions from one source. The real site is the finished work; the baseline is the same site rendered badly on purpose, so the two can be put side by side under Lighthouse to show what the work was worth.
The baseline is derived from the real site on every build rather than kept as a second set of templates. Change the site and the baseline changes with it — it can never drift into being a different site that merely looks worse.
# both: the real site into output/, the baseline into output/baseline/
bundle exec rake deploy_with_baseline
# the real site on its own
bin/bridgetown deployLocally that gives you / and /baseline/; deployed, meadowbrookbakery.com/
and meadowbrookbakery.com/baseline/. The GitHub Pages workflow runs
deploy_with_baseline, so both go up together as one artifact.
Point Lighthouse at ?disclaimer=off on both URLs. Lighthouse uses a fresh
profile every run, so it meets the disclaimer modal every time, and auditing a
page under a blurred scrim skews the comparison.
| File | What it does |
|---|---|
plugins/baseline.rb |
The degradations themselves. One method each, named for the Lighthouse audit it aims at. Knows nothing about Bridgetown — it takes a parsed document and mutates it. |
plugins/builders/baseline_build.rb |
Runs them over every rendered page via the Inspectors API. Does nothing at all unless BLOOMLIGHT_BASELINE is set, so ordinary builds are untouched. |
config/initializers.rb |
Sets base_path and the destination when that variable is present. |
Rakefile |
deploy_with_baseline builds the real site, then the baseline beside it. |
test/test_baseline.rb |
Each degradation against a scrap of HTML, so a failure names the transform that broke. |
Add or remove a degradation. Write a method in Baseline that takes the
parsed document, then add a call to it in Baseline.degrade. Removing one means
deleting its line from degrade. The methods are deliberately small and
independent of each other.
Change how bad the contrast is. WASHED_TEXT and WASHED_BUTTON_TEXT at the
top of plugins/baseline.rb, with BODY_FONT_SIZE for the type. Contrast is
applied as an inline style rather than by swapping in a paler Tailwind class, and
that matters: Tailwind only compiles classes it can find in the source, so an
unknown class yields no style at all and would degrade nothing.
Change which images get swapped. serve_oversized_images reaches for a
.png of the same name when one sits beside the shipped image in
src/images/photos. Drop a heavy PNG in next to an existing photo and the
baseline picks it up on the next build; the real site keeps using the webp.
Change the URL. base_path and destination in config/initializers.rb,
plus the cp_r target in the deploy_with_baseline Rake task.
- Baseline pages carry
<meta name="robots" content="noindex">so the degraded copy is never indexed in place of the real site. Lighthouse scores that against it, which is fair enough here, but it does mean one SEO mark is structural rather than earned. Dropask_not_to_be_indexedfromdegradeif you want the comparison purely on merit. output/baseline/robots.txtandoutput/baseline/sitemap.xmlare build artifacts describing the baseline's own URLs. Nothing links to them and the root sitemap excludes/baseline/— don't submit them anywhere.keep_filesin the config stops a plainbin/bridgetown buildsweeping the baseline away as an orphan of the main build.rake cleanstill removes it.
You can deploy Bridgetown sites on hosts like statichost.eu and Render as well as traditional web servers by simply building and copying the output folder to your HTML root.
Read the Bridgetown Deployment Documentation for more information.
If repo is on GitHub:
- Fork it
- Clone the fork using
git cloneto your local development machine. - Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request