Skip to content

Commit 10ab194

Browse files
Merge pull request #540 from SpineEventEngine/docs-dependencies
Load license information from `docs/dependencies` directories
2 parents f9dde8f + 6f0c277 commit 10ab194

16 files changed

Lines changed: 236 additions & 771 deletions

File tree

.github/workflows/gh-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- staging
88

99
env:
10-
HUGO_VERSION: 0.150.0
10+
HUGO_VERSION: 0.161.1
1111

1212
jobs:
1313
deploy:

.github/workflows/proof-links.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Proof Links
22
on: [pull_request, workflow_dispatch]
33

44
env:
5-
HUGO_VERSION: 0.147.8
5+
HUGO_VERSION: 0.161.1
66
LYCHEE_RELEASE: "lychee-v0.15.1-x86_64-unknown-linux-gnu.tar.gz"
77
LYCHEE_VERSION_TAG: "v0.15.1"
88

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,6 @@ gcs-auth-key.json
7373
# org.gradle.java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/
7474
# -------
7575
gradle.properties
76+
77+
/.sass-cache/
78+
/buildSrc/.kotlin/

CLAUDE.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Repository purpose
6+
7+
This repo holds the [spine.io](https://spine.io) site. It is published to GitHub Pages via the
8+
`gh-pages.yml` workflow on every push to `master` or `staging`.
9+
10+
The repo is "two-headed":
11+
- A **Hugo** site rooted in `site/`.
12+
- A thin **Gradle** wrapper at the root, which only exists to expose Hugo/Lychee commands as
13+
Gradle tasks (and to participate in the larger Spine composite build via `buildAll`).
14+
15+
There is no application code here other than Hugo templates and a small amount of JS/SCSS under
16+
`site/assets/`.
17+
18+
## Common commands
19+
20+
Run these from the repo root unless noted.
21+
22+
| Task | Command |
23+
|---|---|
24+
| Run site locally (Hugo dev server on `:1313`) | `./gradlew :runSite` or `cd site && hugo server` |
25+
| Build the site (no server) | `./gradlew :buildSite` or `cd site && hugo` |
26+
| Check broken links (Lychee) | `./gradlew :checkLinks` — requires the dev server running on `:1313` |
27+
| Install Node deps (PostCSS pipeline) | `cd site && npm install` |
28+
| Update documentation module | `cd site && hugo mod get -u github.com/SpineEventEngine/documentation/docs` |
29+
| Update site-commons theme | `cd site && hugo mod get -u github.com/SpineEventEngine/site-commons` |
30+
| Update all Hugo modules | `cd site && hugo mod get -u ./...` |
31+
| Clear Hugo module cache (on module errors) | `cd site && hugo mod clean --all` |
32+
33+
Prerequisites: JDK 8 (x86_64), Go 1.12+, Node 18+, Hugo Extended **v0.150.0 or higher**.
34+
35+
The `_script/hugo-serve`, `_script/hugo-build`, and `_script/proof-links` shell scripts are what
36+
the Gradle tasks invoke. They `cd site` and source `~/.bash_profile`/`~/.bashrc` so Gradle's
37+
non-interactive shell still sees the user's Hugo/Go install.
38+
39+
## Architecture
40+
41+
### Hugo modules: where the content actually lives
42+
43+
Most of the site's content is **not in this repo**. `site/config/_default/hugo.toml` imports two
44+
Hugo modules (pinned in `site/go.mod`):
45+
46+
- `github.com/SpineEventEngine/documentation/docs` — all `/docs/...` pages. Edit there, not here.
47+
- `github.com/SpineEventEngine/site-commons` — shared theme: partials, shortcodes
48+
(`cloakemail`, `note-block`, code blocks, anchor icons, snackbars), email data, repository data.
49+
50+
When something on the rendered site (especially under `/docs`) isn't where you expect, check
51+
those two upstream repos before searching this one. The `AUTHORING.md` and the site-commons
52+
`_reference/` directory document the available shortcodes.
53+
54+
The documentation side-navigation lives in the `documentation` repo at
55+
`docs/data/docs/<version_id>/sidenav.yml` (or per-module). Prev/Next buttons are generated from it.
56+
57+
### Code samples
58+
59+
`_code/examples/` contains **git submodules** pointing to `spine-examples/*` repos (hello, airport,
60+
blog, kanban, todo-list). The `embed-code` tool referenced in `README.md` / `_code/EMBEDDING.md`
61+
is **not used in this repo** — it only runs in the `documentation` repo. Don't try to wire it up
62+
here.
63+
64+
### Local content in this repo
65+
66+
`site/content/` holds the pages that are *not* documentation:
67+
landing (`_index.md`, `hero.json`, `features.json`, `step-*.md`), `about`, `blog`,
68+
`getting-help` (with `services.json` / `support-section.json`), `checkout` / `checkout-completed`,
69+
`faq`, `oss-licenses`, `privacy`, `release-notes`.
70+
71+
`site/layouts/` overrides theme templates for these sections plus `_default`, `_partials`,
72+
`_shortcodes`, and `index.html`. Main navigation data is in `site/data/navbar.yml`; the layout
73+
template is `site/layouts/_partials/components/navbar/navigation.html`.
74+
75+
### Payments / checkout
76+
77+
The `getting-help` page sells products and uses a real (staging in dev) payment flow. Config in
78+
`site/config/_default/hugo.toml` under `[params.payment]` points the dev environment at the
79+
staging Paygate. Test cards: LHV sandbox (see `README.md`). Do not change `paygateURL` /
80+
`consentURL` casually — they are environment-aware.
81+
82+
### Markdown is rendered with `unsafe = true`
83+
84+
Hugo's Goldmark is configured with `unsafe = true` and block attributes enabled
85+
(`site/config/_default/hugo.toml`), so raw HTML inside Markdown is allowed and `{.class}`
86+
attribute syntax works. This is intentional — many pages embed HTML directly.
87+
88+
## Authoring conventions (from AUTHORING.md)
89+
90+
These are enforced by reviewers and by the Lychee link check; follow them:
91+
92+
- **Internal links must not start with `/`.** Use `docs/introduction/`, not `/docs/introduction/`.
93+
- **Internal links must end with `/`** to avoid redirect hops.
94+
- For URLs that depend on the current docs version or external repos, use the variable forms:
95+
`{{% version %}}` and `{{% get-site-data "repositories.<key>" %}}` (key resolves against
96+
`site-commons/data/repositories.yml`).
97+
- In layout partials (HTML), build URLs via Hugo: `{{ \`docs/...\` | relURL }}`.
98+
- Image size hints: append `#medium` or `#small` to the image path.
99+
- Use the `cloakemail` shortcode for any email/phone — never inline them.
100+
101+
Lychee excludes live in `lychee.toml`. The GitHub Actions check is `.github/workflows/proof-links.yml`.
102+
103+
## When updating Hugo modules
104+
105+
After `hugo mod get -u ...`, commit both `site/go.mod` and `site/go.sum`. The convention is to
106+
**prune `go.sum` down to the two required entries per module** so the file doesn't accumulate
107+
old versions.

build.gradle.kts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* Copyright 2025, TeamDev. All rights reserved.
2+
* Copyright 2026, TeamDev. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Redistribution and use in source and/or binary forms, with or without
1111
* modification, must retain the above copyright notice and the following
@@ -27,21 +27,26 @@
2727
/**
2828
* Builds and runs the site locally.
2929
*/
30-
task<Exec>("runSite") {
30+
tasks.register<Exec>("runSite") {
31+
description = "Builds and runs the site locally." +
32+
" The server is available at http://localhost:1313/ or other port."
3133
commandLine("./_script/hugo-serve")
3234
}
3335

3436
/**
3537
* Builds the site without starting the server.
3638
*/
37-
task<Exec>("buildSite") {
39+
tasks.register<Exec>("buildSite") {
40+
description = "Builds the site without starting the server." +
41+
" The generated files are located in the `public` directory."
3842
commandLine("./_script/hugo-build")
3943
}
4044

4145
/**
4246
* Verifies that the external links used by the site are available.
4347
*/
44-
task<Exec>("checkLinks") {
48+
tasks.register<Exec>("checkLinks") {
49+
description = "Verifies that the external links used by the site are available."
4550
commandLine("./_script/proof-links")
4651
}
4752

@@ -54,5 +59,7 @@ task<Exec>("checkLinks") {
5459
* @see https://docs.gradle.org/current/userguide/composite_builds.html
5560
*/
5661
tasks.register("buildAll") {
62+
description = "Builds all included projects via depending on the top-level" +
63+
" \"buildAll\" tasks declared in these projects."
5764
dependsOn(gradle.includedBuilds.map { it.task(":buildAll") })
5865
}

buildSrc/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ plugins {
3030

3131
repositories {
3232
mavenLocal()
33-
jcenter()
33+
mavenCentral()
3434
}
3535

3636
val jacksonVersion = "2.11.0"

buildSrc/src/main/kotlin/io/spine/gradle/internal/CheckVersionIncrement.kt

Lines changed: 0 additions & 121 deletions
This file was deleted.

0 commit comments

Comments
 (0)