revela.website
This website (revela.website) is built with Revela itself. Here's a detailed walkthrough of how we customized the default Lumina theme.
Project Structure
revela-website/
├── project.json # Project configuration
├── site.json # Site metadata + custom stylesheets
├── source/
│ ├── _index.revela # Homepage (template = "home")
│ ├── _static/ # Static files (favicon, CNAME, logo)
│ ├── about/ # About page
│ └── docs/ # Documentation pages
└── themes/
└── Lumina/ # Theme overrides (not a full copy!)
├── Assets/
│ └── website.css
├── Body/
│ ├── home.revela
│ └── docs.revela
└── Partials/
└── HeaderNavigation.revela
Key principle: Only override what you need. The base Lumina theme provides everything else.
Custom Assets
site.json
Register project-owned CSS and JavaScript files in site.json:
{
"title": "Revela",
"stylesheets": [
"website.css",
{
"path": "prism.css",
"scope": ["docs"]
}
],
"scripts": [
{
"path": "prism.js",
"scope": ["docs"]
}
]
}
The files live in themes/Lumina/Assets/. A string entry is shorthand for an asset that
loads on every page. Use an object to restrict an asset to one or more scopes.
| Scope | Matches |
|---|---|
index |
Root page without an explicit template |
gallery |
Gallery page without an explicit template |
home, page, docs |
The exact template value |
photo |
Canonical photo pages |
lightbox |
Pages whose resolved photo viewer is lightbox |
statistics, calendar |
Plugin templates such as statistics/overview or calendar/page |
all |
Every page |
An object without scope is equivalent to scope: ["all"]. Assets that exist in the
local Assets/ directory but are not declared in site.json are copied to _assets, but
are not linked or executed automatically. This keeps ownership explicit and prevents an
unrelated page from loading project-specific CSS or JavaScript.
Theme and extension packages use the same path + scope declarations in their
manifest.json. Plugin template prefixes remain isolated: an asset scoped to statistics
does not load on calendar, docs, or photo pages.
Accent Color
The base theme uses CSS custom properties. Override them in your stylesheet:
:root {
--accent-hsl: 263deg 70% 70%;
--accent-light-hsl: 263deg 70% 80%;
}
Background Gradient
Add a subtle gradient inspired by the logo:
body {
background-image: radial-gradient(
ellipse 100% 60% at 50% -10%,
hsl(220deg 50% 30% / 0.25) 0%,
hsl(280deg 60% 40% / 0.15) 40%,
hsl(340deg 70% 50% / 0.08) 70%,
transparent 100%
);
background-attachment: fixed;
}
Header Blur Effect
Frosted glass effect for the sticky header:
header {
background-color: hsl(var(--color-background-hsl) / 0.3);
-webkit-backdrop-filter: saturate(180%) blur(2rem);
backdrop-filter: saturate(180%) blur(2rem);
}
Transparent Footer
Remove the footer background so the gradient shows through:
footer {
background: unset;
outline: unset;
}
Body Templates
Homepage (home.revela)
Create themes/Lumina/Body/home.revela for a custom hero section. No classes needed, since CSS targets elements via main > section:
<section>
<img src="{{ basepath }}revela.svg" alt="Revela" />
<h1>{{ gallery.title ?? site.title }}</h1>
<p>{{ gallery.description ?? site.description }}</p>
</section>
{{~ if gallery.body ~}}
<article>
{{ gallery.body }}
</article>
{{~ end ~}}
Use it in your page with template = "home" in the frontmatter.
Documentation (docs.revela)
For pages with sidebar navigation, create themes/Lumina/Body/docs.revela. The <aside> and <article> are direct children of <main>, so CSS detects the layout via main:has(> aside). The recursive render_docs_items function lists every level of the docs tree, so pages nested three folders deep (like Guide → Source Structure → Static Files) appear in the sidebar too:
{{~ func render_docs_items(items) ~}}
<ul>
{{~ for doc in items ~}}
{{~ doc_link = page_url(doc) ~}}
<li>
{{~ if doc_link ~}}
<a href="{{ html_escape doc_link }}"{{ if doc.current }} aria-current="page"{{ end }}>{{ html_escape doc.text }}</a>
{{~ else ~}}
<span>{{ html_escape doc.text }}</span>
{{~ end ~}}
{{~ if doc.children.size > 0; render_docs_items doc.children; end ~}}
</li>
{{~ end ~}}
</ul>
{{~ end ~}}
<aside>
<nav aria-label="Docs">
{{~ for item in nav_items ~}}
{{~ if item.active; render_docs_items item.children; end ~}}
{{~ end ~}}
</nav>
</aside>
<article>
<h1>{{ html_escape gallery.title }}</h1>
{{ gallery.body }}
</article>
Extending Partials
Adding a GitHub Icon
Instead of copying the entire Layout, override just the HeaderNavigation partial.
Create themes/Lumina/Partials/HeaderNavigation.revela:
{{~ func render_pinned(items) ~}}
{{~ for item in items ~}}
{{~ if item.pinned ~}}
<a href="{{ html_escape (page_url item) }}"{{ if item.current }} aria-current="page"{{ end }}>{{ html_escape item.text }}</a>
{{~ end ~}}
{{~ if item.children ~}}
{{~ render_pinned item.children ~}}
{{~ end ~}}
{{~ end ~}}
{{~ end ~}}
{{~ render_pinned nav_items ~}}
<a href="https://github.com/Spectara/Revela" title="View on GitHub">
<svg viewBox="0 0 16 16" width="20" height="20" fill="currentColor">
<path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59..."></path>
</svg>
</a>
The SVG uses fill="currentColor" to match the text color automatically. No class needed, since CSS targets the last link in header nav:
header {
& nav a:last-child {
opacity: 0.7;
transition: opacity var(--animation-time);
svg { vertical-align: middle; }
&:hover { opacity: 1; }
}
}
Static Files
Place files in source/_static/ to copy them to the output root:
source/_static/
├── favicon/ # Favicon files
│ ├── favicon.ico
│ └── favicon.svg
├── CNAME # GitHub Pages custom domain
├── .nojekyll # Disable Jekyll processing
├── robots.txt # Search engine directives
└── revela.png # Logo for hero section
View the Source
The complete source code for this website is available on GitHub:
Feel free to use it as a starting point for your own customizations!