Set up
home is available via homebrew, from the bearcove tap:
Installing from homebrew
Add the tap:
brew tap bearcove/tap
Install home:
brew install bearcove/tap/home
Make sure it works:
home doctor
Does it?
home.bearcove.eu on main [$!⇡]
❯ home doctor
All checks passed successfully
Then welcome home!
Keeping home updated
When a new version of home comes out, it’s tagged on https://github.com/bearcove/home/releases
Shortly after, a CI workflow / action updates the bearcove tap repository — its commit list shows that it’s all happening automatically:
Automation goes brrrr
Serving an existing home site
Running home serve --open
in an existing home site should work out of the box.
It will:
- Assume the name of the current folder is the domain of the tenant
(that’s why repositories are named things like
fasterthanli.me
andhome.bearcove.eu
) - Look for an environment variable named
HOME_API_KEY
— if it doesn’t find one, it’ll still start up, but you won’t be able to deploy.
home.bearcove.eu on main [!?]
❯ home serve --open
Reading .env file from: /Users/amos/.env
Reading .env file from: /Users/amos/bearcove/home.bearcove.eu/.env
Config-less mode enabled for tenant home.bearcove.eu
INFO mod_revision::impls::load: Built 7/7 pages in 3.985875ms
INFO mod_cub::impls: Will serve rev_01JQNW09MP7E7DMM77KPRBCZ06 (loaded in 0ns)
INFO mod_revision::impls::watch: [home.bearcove.eu] Watching /Users/amos/bearcove/home.bearcove.eu/content/
INFO mod_revision::impls::watch: [home.bearcove.eu] Watching /Users/amos/bearcove/home.bearcove.eu/templates/
INFO mod_cub::impls: 🦊 Visit the site at http://home.bearcove.eu.snug.blog:1111
INFO mod_cub::impls: GET / -> 200 (took 300.917µs)
✂️
You don’t have to use
--open
, but.. you can.
Setting up a home site
In a new folder…
~/bearcove
❯ mkdir home-from-scratch
~/bearcove
❯ cd home-from-scratch/
The home init
command sets up everything:
~/bearcove/home-from-scratch
❯ home init
📋 The following files will be created:
home.json
content/_index.md
templates/page.html.jinja
src/bundle.ts
src/main.scss
src/_reset.scss
Do you want to proceed? (y/N): y
Answering y
will create the files for you:
📄 Created file: ./home.json
📄 Created file: ./content/_index.md
📄 Created file: ./templates/page.html.jinja
📄 Created file: ./src/bundle.ts
📄 Created file: ./src/main.scss
📄 Created file: ./src/_reset.scss
✨ Created initial content and source files! 🎉
📦 package.json not found. Running `pnpm init` to create it...
✅ Successfully created package.json
🔄 Updated package.json to set "type": "module"
📝 Updated .gitignore with required entries
🚀 Development setup completed successfully! 🎊
=== 🌟 You're all set! 🌟 ===
📌 Next step: Run `home serve` to start the development server.
🎈 Happy coding! 🎈
And then you can run it with home serve
:
~/bearcove/home-from-scratch
❯ home serve
Reading config from env (HOMECONF_ prefix) and ./home.json
Absolute config path: /Users/amos/bearcove/home-from-scratch/home.json
Resolved base_dir for tenant home-from-scratch: /Users/amos/bearcove/home-from-scratch
INFO mod_revision::impls::make: Processed 4 events in 181.208µs (4 add actions)
INFO mod_revision::impls::load: Built 1/1 pages in 1.096ms
INFO mod_cub::impls: Will serve rev_01JQGSK1PKMS2NY92C8J9B6EA3 (loaded in 42ns)
INFO mod_revision::impls::watch: [home-from-scratch] Watching /Users/amos/bearcove/home-from-scratch/content
INFO mod_cub::impls: 🦊 http://home-from-scratch.snug.blog:1111
WARN mod_cub::impls::cub_req: No tenant found for domain cdn.home.bearcove.eu.snug.blog
INFO mod_mom::impls::db::migrations: Applying migration "m0001_initial"
INFO mod_mom::impls::db::migrations: Applying migration "m0003_patreon_credentials"
INFO mod_mom::impls::db::migrations: Applying migration "m0004_github_credentials"
INFO mod_mom::impls::db::migrations: Applying migration "m0005_create_sponsor_table"
INFO mod_mom::impls::db::migrations: Applying migration "m0006_create_revisions_table"
INFO mod_mom::impls::db::migrations: Applying migration "m0007_create_objectstore_entries_table"
INFO mod_mom::impls::db::migrations: Applying migration "m0008_objectstore_entries_rename"
INFO mod_mom::impls: No revisions found in database
INFO mod_mom::impls: 🐻 mom is now serving on 127.0.0.1:49941 💅
WARN mod_cub::impls::cub_req: No tenant found for domain home.bearcove.eu.snug.blog
INFO mod_cub::impls: GET /internal-api/ws -> 400 (took 647.708µs)
WARN mod_cub::impls::cub_req: No tenant found for domain cdn.home.bearcove.eu.snug.blog
WARN mod_cub::impls::cub_req: No tenant found for domain cdn.home.bearcove.eu.snug.blog
^C WARN mod_mom::impls::endpoints: Received SIGINT
WARN mod_mom::impls::endpoints: Exiting immediately
WARN mod_cub::impls::graceful_shutdown: Received SIGINT
WARN mod_cub::impls::graceful_shutdown: Exiting immediately
If you then open http://localhost:1111, you’ll see something like this:
And if you click home-from-scratch
, you’ll be redirected to
http://home-from-scratch.snug.blog:1111, showing this: