Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 28 additions & 14 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ concurrency:
env:
# The Accent CMS release the site is built with. Bump deliberately, after
# a local build with the new version.
ACCENT_VERSION: v0.25.1
ACCENT_VERSION: v0.26.0
# The installer that fetches and verifies that release (crates.io crate
# `accent`, binary `accentup`). The cache key below changes with it.
ACCENTUP_VERSION: "0.1.3"
SITE_URL: https://zoosky.github.io/driller

jobs:
Expand All @@ -55,29 +58,40 @@ jobs:
steps:
- uses: actions/checkout@v4

# The official installer downloads the release archive, checks its
# SHA-256 against the signed checksums file, and verifies that
# signature with the release key. With the require-verify flag a
# missing checksum, signature, or gpg fails the install instead of
# warning, which is what an unattended build wants.
# accentup downloads the release archive and verifies it in-process:
# the release signing key is compiled in, the signature check on the
# checksums file and the SHA-256 check of the archive run inside the
# binary, and there is no way to skip either. The job depends neither
# on the runner shipping gpg nor on an unpinned install script. It is
# built from crates.io with --locked at a pinned version and cached by
# that version, so only the first run pays for the compile.
- name: Restore accentup
id: accentup
uses: actions/cache@v4
with:
path: ~/.cargo/bin/accentup
key: accentup-${{ env.ACCENTUP_VERSION }}-${{ runner.os }}-${{ runner.arch }}

- name: Build accentup from crates.io
if: steps.accentup.outputs.cache-hit != 'true'
run: cargo install accent --locked --version "$ACCENTUP_VERSION"

- name: Install Accent CMS
run: |
curl -fsSL https://raw.githubusercontent.com/AccentCMS/accent/main/install.sh \
| ACCENT_VERSION="$ACCENT_VERSION" ACCENT_INSTALL_REQUIRE_VERIFY=1 sh
accentup install --version "$ACCENT_VERSION" --dir "$HOME/.local/bin"
echo "$HOME/.local/bin" >> "$GITHUB_PATH"

# The path component of --base-url makes every internal URL carry the
# /driller prefix the project site is served under. --strict-links
# fails the build on any internal link whose target is missing from
# the output, which covers links into the mounted repository files as
# well as the site's own pages.
# /driller prefix the project site is served under. The build fails on
# any internal link whose target is missing from the output, which
# covers links into the mounted repository files as well as the site's
# own pages.
- name: Build
run: |
accent --version
accent build --config site/config.yaml --clean \
--output "$GITHUB_WORKSPACE/dist" \
--base-url "$SITE_URL" \
--strict-links
--base-url "$SITE_URL"
test -f "$GITHUB_WORKSPACE/dist/index.html"
test -f "$GITHUB_WORKSPACE/dist/404.html"

Expand Down
4 changes: 2 additions & 2 deletions site/content/default.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ cargo install driller
driller run http://localhost:9000/api/users --stats
```

[button primary href="/docs/getting-started"]Get started[/button]
[button href="https://github.com/zoosky/driller"]Source on GitHub[/button]
{% button variant="primary" href="/docs/getting-started" %}Get started{% /button %}
{% button href="https://github.com/zoosky/driller" %}Source on GitHub{% /button %}

---section: features---

Expand Down
10 changes: 5 additions & 5 deletions site/themes/driller/assets/css/_dark-mode.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,26 @@
--color-nav-pill-hover-bg: #E5E5E5;
--color-nav-pill-active-bg: rgba(5, 150, 105, 0.08);

// Alert light overrides
.alert-info {
// Callout light overrides
.callout-info {
border-left-color: #059669;
background: #ecfdf5;
color: #065f46;
}

.alert-warning {
.callout-warning {
border-left-color: #d97706;
background: #fffbeb;
color: #92400e;
}

.alert-success {
.callout-success {
border-left-color: #059669;
background: #ecfdf5;
color: #065f46;
}

.alert-danger {
.callout-danger {
border-left-color: #dc2626;
background: #fef2f2;
color: #991b1b;
Expand Down
5 changes: 2 additions & 3 deletions site/themes/driller/assets/css/_landing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@
border: 1px solid var(--color-border);
}

.landing-hero .btn,
.landing-hero .sc-button {
.landing-hero .btn {
margin: 0.25rem;
}

Expand Down Expand Up @@ -145,7 +144,7 @@
}

.landing-section a,
.landing-cta a:not(.btn):not(.sc-button),
.landing-cta a:not(.btn),
.landing-features a {
color: var(--color-link);
}
Expand Down
6 changes: 6 additions & 0 deletions site/themes/driller/assets/css/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ footer {
.footer-sep {
color: var(--color-border-strong);
}

// Accent CMS version and commit the site was built with.
.footer-build {
font-family: var(--font-mono);
font-size: 0.72rem;
}
}

// Responsive: stack header nav at narrow widths
Expand Down
34 changes: 17 additions & 17 deletions site/themes/driller/assets/css/_shortcodes.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// Alert and button shortcode styles.
/// Callout and button component styles.

// Alert base
.alert {
// Callout base
.callout {
padding: 0.75rem 1.25rem;
border-left: 4px solid var(--color-border-strong);
border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
Expand All @@ -13,34 +13,37 @@
}
}

.alert-info {
.callout-title {
font-weight: 600;
margin-bottom: 0.25rem;
}

.callout-info {
border-left-color: #34d399;
background: rgba(16, 185, 129, 0.08);
color: #6ee7b7;
}

.alert-warning {
.callout-warning {
border-left-color: #fbbf24;
background: rgba(251, 191, 36, 0.08);
color: #fcd34d;
}

.alert-success {
.callout-success {
border-left-color: #10b981;
background: rgba(16, 185, 129, 0.08);
color: #6ee7b7;
}

.alert-danger {
.callout-danger {
border-left-color: #f87171;
background: rgba(248, 113, 113, 0.08);
color: #fca5a5;
}

// Button base. The built-in [button] shortcode emits .sc-button classes;
// the .btn aliases stay for hand-written anchors in page content.
.btn,
.sc-button {
// Button base, emitted by the button component.
.btn {
display: inline-block;
padding: 0.5rem 1.25rem;
border-radius: var(--radius-md);
Expand All @@ -52,8 +55,7 @@
transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-default,
.sc-button--default {
.btn-default {
background: var(--color-bg-subtle);
color: var(--color-text);
border-color: var(--color-border-strong);
Expand All @@ -64,8 +66,7 @@
}
}

.btn-primary,
.sc-button--primary {
.btn-primary {
background: var(--color-link);
color: #0A0A0A;

Expand All @@ -74,8 +75,7 @@
}
}

.btn-secondary,
.sc-button--secondary {
.btn-secondary {
background: var(--color-bg-muted);
color: var(--color-text);
border-color: var(--color-border-strong);
Expand Down
7 changes: 7 additions & 0 deletions site/themes/driller/shortcodes/accordion.html.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{#- The accordion. The manifest declares `body: markdown`, so the body arrives
between blank lines and renders as markdown inside the element.
`data-canonical` and `data-part` are the markup contract every conforming
theme's accordion carries. -#}
<details class="accordion" data-canonical="accordion"{% if attrs.open %} open{% endif %}><summary data-part="summary">{{ attrs.summary | default("Details") }}</summary>
{{ body }}
</details>
23 changes: 23 additions & 0 deletions site/themes/driller/shortcodes/accordion.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Component manifest for the accordion, one of the canonical components.
#
# A section that stays collapsed behind its summary line until the reader
# opens it: a plain `<details>`/`<summary>` pair. Every conforming theme
# implements `accordion` with the `summary` and `open` attributes.
name: accordion
description: A collapsible section behind a summary line.
params:
- name: summary
type: string
required: false
description: The always-visible line that opens and closes the section. Defaults to "Details".
- name: open
type: boolean
required: false
description: Start expanded.
body: markdown
# `[accordion "Show me"]` wrote the summary as a bare word. `[details]` was this
# theme's accordion before the canonical names, and still migrates here.
migrate:
positional: [summary]
from:
- name: details
4 changes: 0 additions & 4 deletions site/themes/driller/shortcodes/alert.html.jinja

This file was deleted.

8 changes: 8 additions & 0 deletions site/themes/driller/shortcodes/breadcrumb.html.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{#- The breadcrumb. The body is the trail as the author wrote it, in Markdown.
The manifest declares `body: markdown`, so the body arrives between blank
lines: the `nav` raw-HTML block closes before it and the links render. The
class is the layout trail's, so both look alike. `data-canonical` is the
markup contract every conforming theme's breadcrumb carries. -#}
<nav class="breadcrumbs" aria-label="Breadcrumb" data-canonical="breadcrumb">
{{ body }}
</nav>
10 changes: 10 additions & 0 deletions site/themes/driller/shortcodes/breadcrumb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Component manifest for the breadcrumb, one of the canonical components.
#
# A trail of links an author writes, for a page whose position the site's own
# hierarchy does not describe. The layout's trail comes from
# `breadcrumbs.html.jinja`; this renders the same markup from content. Every
# conforming theme implements `breadcrumb`, which takes no attributes.
name: breadcrumb
description: A trail of links leading to the current page, written in Markdown.
params: []
body: markdown
12 changes: 12 additions & 0 deletions site/themes/driller/shortcodes/button.html.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{#- A call to action, styled as a button rather than a link.

`href` goes through `url()` so the link carries the deployment prefix on a
sub-path install, and so the slash stays literal: an autoescaped
`{{ attrs.href }}` emits `&#x2f;`, which is a valid link but a second
spelling for the base-path rewriter to know about.

`data-canonical` is the markup contract every conforming theme's button
carries.
-#}
{%- set variant = attrs.variant | default("default") -%}
<a href="{{ url(attrs.href | default("#")) }}" class="btn btn-{{ variant }}" data-canonical="button">{{ body }}</a>
26 changes: 26 additions & 0 deletions site/themes/driller/shortcodes/button.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Component manifest for the button component.
name: button
description: A call-to-action link styled as a button.
params:
- name: variant
type: enum
values: [default, primary, secondary]
required: false
description: Which button style to use. Defaults to default.
- name: href
type: reference
required: true
description: Where the button links to.
# The body is the button's label. Spliced flush, it shares the line with the
# `<a>` that opens it, so no raw HTML block starts and inline markdown in the
# label renders; blank lines around it would turn the label into a paragraph
# inside the link.
body: inline
# A button is written in a sentence as often as on a line of its own, and
# `{% button %}Label{% /button %}` on one line is an inline placement. An
# inline component is legitimate in both positions; a block one is reported
# as misplaced when written in a line.
inline: true
# `[button primary href="/signup"]` wrote the variant as a bare word.
migrate:
positional: [variant]
27 changes: 27 additions & 0 deletions site/themes/driller/shortcodes/callout.html.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{#- The callout, one of the canonical components.

`role="complementary"` and `aria-label` are the accessibility contract: the
box is an aside about the surrounding prose, and a screen reader announces
it by its title. The title is repeated as visible text because the label is
not rendered.

`data-canonical` and `data-part` are the markup contract: the landmarks
every conforming theme's callout carries, whatever its classes.

The manifest declares `body: markdown`, so the body arrives between blank
lines: the raw-HTML block the opening element starts closes before the
body, and the body reaches the markdown parser whole. Keep the closing tag
in column 0 -- after a blank line, an indented `</div>` is an indented
code block.
-#}
{%- set type = attrs.type | default("info") -%}
{%- set title = attrs.title | default(type | capitalize) -%}
{%- if attrs.collapsible -%}
<details class="callout callout-{{ type }}" role="complementary" aria-label="{{ title }}" data-canonical="callout"><summary class="callout-title" data-part="title">{{ title }}</summary>
{{ body }}
</details>
{%- else -%}
<div class="callout callout-{{ type }}" role="complementary" aria-label="{{ title }}" data-canonical="callout"><p class="callout-title" data-part="title">{{ title }}</p>
{{ body }}
</div>
{%- endif -%}
40 changes: 40 additions & 0 deletions site/themes/driller/shortcodes/callout.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Component manifest for the callout, one of the canonical components.
#
# A callout sets a passage apart as a note, a warning, or another kind of
# notice. Every conforming theme implements `callout` with the `type`, `title`
# and `collapsible` attributes, so content written with it renders under any of
# them. The type name reaches the class attribute, so a theme styles
# `callout-prereq` without this file learning what "prereq" means.
name: callout
description: A titled box that sets a passage apart as a note, a warning, or another kind of notice.
params:
- name: type
type: string
required: false
description: >-
The kind of notice. Every conforming theme styles `info`, `success`,
`warning` and `danger`. Reaches the `callout-<type>` class and, when no
title is given, supplies the title in capitalised form. Defaults to
`info`.
- name: title
type: string
required: false
description: >-
The heading and the accessible label. Defaults to the capitalised type.
- name: collapsible
type: boolean
required: false
description: >-
Render as a `<details>`/`<summary>` disclosure instead of a `<div>`, so
the box starts closed.
body: markdown
# `[callout warning]` wrote the type as a bare word. `[alert]` and `[infobox]`
# were this theme's callouts before the canonical names; content still written
# with them migrates here, and alert's `variant` becomes `type`.
migrate:
positional: [type]
from:
- name: alert
rename:
variant: type
- name: infobox
Loading
Loading