Skip to content

Commit 5fe37e3

Browse files
committed
Initial website.
0 parents  commit 5fe37e3

34 files changed

Lines changed: 1657 additions & 0 deletions
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: pages
16+
cancel-in-progress: true
17+
18+
env:
19+
BUNDLE_WITH: maintenance
20+
21+
jobs:
22+
generate:
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- uses: actions/checkout@v6
27+
28+
- uses: ruby/setup-ruby@v1
29+
with:
30+
ruby-version: ruby
31+
bundler-cache: true
32+
33+
- name: Generate static site
34+
timeout-minutes: 5
35+
run: bundle exec rackula generate --config config.ru --public public --output-path tmp/static --force
36+
37+
- name: Upload documentation artifact
38+
uses: actions/upload-pages-artifact@v4
39+
with:
40+
path: tmp/static
41+
42+
deploy:
43+
runs-on: ubuntu-latest
44+
45+
environment:
46+
name: github-pages
47+
url: ${{ steps.deployment.outputs.page_url }}
48+
49+
needs: generate
50+
51+
steps:
52+
- name: Deploy to GitHub Pages
53+
id: deployment
54+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Development specific:
2+
/.bundle
3+
4+
# Temporary data should not be added to the repository:
5+
/tmp
6+
7+
# Node modules are 3rd party dependencies which can be fetched easily:
8+
/node_modules
9+
10+
# This file should only ever exist on production, and may contain sensitive information:
11+
/config/environment.yaml
12+
13+
# Ignore resized gallery photos:
14+
/public/_gallery

Guardfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# frozen_string_literal: true
2+
3+
group :development do
4+
guard :falcon, port: 9292 do
5+
watch("Gemfile.lock")
6+
watch("gems.locked")
7+
watch("config.ru")
8+
watch(%r{^config|lib|pages/.*})
9+
10+
notification :off
11+
end
12+
end

bake.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# frozen_string_literal: true
2+
3+
# Released under the MIT License.
4+
# Copyright, 2020-2025, by Samuel Williams.
5+
6+
def deploy
7+
# This task is typiclly run after the site is updated but before the server is restarted.
8+
end
9+
10+
# Restart the application server.
11+
def restart
12+
call "falcon:supervisor:restart"
13+
end
14+
15+
# Start the development server.
16+
def default
17+
call "utopia:development"
18+
end

config.ru

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/usr/bin/env rackup
2+
# frozen_string_literal: true
3+
4+
require_relative "config/environment"
5+
6+
self.freeze_app
7+
8+
if UTOPIA.production?
9+
# Handle exceptions in production with a error page and send an email notification:
10+
use Utopia::Exceptions::Handler
11+
use Utopia::Exceptions::Mailer
12+
else
13+
# We want to propate exceptions up when running tests:
14+
use Rack::ShowExceptions unless UTOPIA.testing?
15+
end
16+
17+
# Serve static files from "public" directory:
18+
use Utopia::Static, root: "public"
19+
20+
use Utopia::Redirection::Rewrite, {
21+
"/" => "/welcome/index"
22+
}
23+
24+
use Utopia::Redirection::DirectoryIndex
25+
26+
use Utopia::Redirection::Errors, {
27+
404 => "/errors/file-not-found"
28+
}
29+
30+
require "utopia/localization"
31+
use Utopia::Localization,
32+
default_locale: "en",
33+
locales: ["en", "de", "ja", "zh"]
34+
35+
require "utopia/session"
36+
use Utopia::Session,
37+
expires_after: 3600 * 24,
38+
secret: UTOPIA.secret_for(:session),
39+
secure: true
40+
41+
use Utopia::Controller
42+
43+
# Serve static files from "pages" directory:
44+
use Utopia::Static
45+
46+
# Serve dynamic content:
47+
use Utopia::Content
48+
49+
run lambda {|env| [404, {}, []]}

config/development.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
UTOPIA_SESSION_SECRET: adc5aafc7cc348b07e3fbb4a1678b21ee9ad5268946fc64ee7734c0736ac8c7d5b045a3f76fec875

config/environment.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# frozen_string_literal: true
2+
3+
# Released under the MIT License.
4+
# Copyright, 2016-2025, by Samuel Williams.
5+
6+
require "bundler/setup"
7+
Bundler.setup
8+
9+
require "utopia/setup"
10+
UTOPIA ||= Utopia.setup

config/readme.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Utopia Config
2+
3+
This directory contains `environment.rb` which is used to initialize the running environment for tasks and servers.
4+
5+
## Setting Environment Variables
6+
7+
If you wish to set environment variables on a per-deployment basis, you can do so by creating an `config/environment.yaml` and populating it with key-value pairs.

config/sus.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# frozen_string_literal: true
2+
3+
# Released under the MIT License.
4+
# Copyright, 2017-2025, by Samuel Williams.
5+
6+
require "variant"
7+
Variant.force!(:testing)
8+
9+
require "covered/sus"
10+
include Covered::Sus

config/testing.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
UTOPIA_SESSION_SECRET: dccce67d45e0fa37271d859bd2f9d29546eb7f658698524b9f15bc799d0e8b5b07ad17c36e7261e0

0 commit comments

Comments
 (0)