Skip to content

Commit 74673e3

Browse files
authored
Merge pull request #182 from posit-dev/docs-information-on-site-url
docs: provide guidance on site_url setting
2 parents 3981373 + 6f5ea9d commit 74673e3

3 files changed

Lines changed: 67 additions & 5 deletions

File tree

great_docs/config.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@
2828
"pypi": True,
2929
# GitHub integration
3030
"repo": None, # GitHub repository URL override (e.g., "https://github.com/owner/repo")
31-
# Site URL for subdirectory deployments (sets website.site-url in _quarto.yml)
32-
# e.g., "http://myserver:3838/data-team/mypackage/"
31+
# Site URL: the canonical address of the deployed documentation site.
32+
# Used for skills page install commands, .well-known/ discovery, sitemaps,
33+
# and subdirectory deployments. Also sets website.site-url in _quarto.yml.
3334
"site_url": None,
3435
"github_style": "widget", # "widget" (shows stars) or "icon"
3536
# Source link configuration

great_docs/core.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8707,6 +8707,13 @@ def _generate_minimal_config(
87078707
# To show the text title alongside the logo, add: show_title: true
87088708
{authors_section}
87098709
{funding_yaml}
8710+
# Site URL
8711+
# --------
8712+
# Canonical address of the deployed documentation site.
8713+
# Required for subdirectory deployments, skills page install commands,
8714+
# .well-known/ discovery, and sitemaps.
8715+
# site_url: "https://your-org.github.io/your-package/"
8716+
87108717
{site_yaml}
87118718
# Jupyter Kernel
87128719
# --------------
@@ -8924,10 +8931,17 @@ def _generate_config_with_reference(
89248931
lines.append(f" - {name}")
89258932
has_prev_section = True
89268933

8927-
# Add trailing sections for site settings (default templates)
8934+
# Add trailing sections for site URL and site settings (default templates)
89288935
lines.extend(
89298936
[
89308937
"",
8938+
"# Site URL",
8939+
"# --------",
8940+
"# Canonical address of the deployed documentation site.",
8941+
"# Required for subdirectory deployments, skills page install commands,",
8942+
"# .well-known/ discovery, and sitemaps.",
8943+
'# site_url: "https://your-org.github.io/your-package/"',
8944+
"",
89318945
]
89328946
)
89338947
lines.extend(site_yaml.rstrip("\n").splitlines())

user_guide/05-configuration.qmd

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,52 @@ pypi: "https://packages.example.com/simple/my-package"
368368
When `pypi` is `true` (the default), the link is auto-generated as
369369
`https://pypi.org/project/{package_name}/`.
370370

371+
## Site URL
372+
373+
Set `site_url` to the canonical URL where your documentation site is (or will be) hosted.
374+
This value is used in several places:
375+
376+
- **Skills page** install instructions (e.g., `npx skills add <url>`)
377+
- **`.well-known/` discovery** endpoints for agent skills
378+
- **Quarto's `website.site-url`** (canonical links, sitemaps)
379+
- **Subdirectory deployments** where the site lives at a path other than `/`
380+
(e.g., `https://internal.example.com/docs/mypackage/`)
381+
382+
Without it, the Skills page renders literal `<site-url>` placeholders instead of working
383+
install commands, and subdirectory-hosted sites will have broken asset paths.
384+
385+
```{.yaml filename="great-docs.yml"}
386+
# Site URL: the canonical address of the deployed documentation site.
387+
# Used for skills page install commands, .well-known/ discovery, and sitemaps.
388+
site_url: "https://your-org.github.io/your-package/"
389+
```
390+
391+
Alternatively, you can set a `Documentation` entry in `pyproject.toml`:
392+
393+
```{.toml filename="pyproject.toml"}
394+
[project.urls]
395+
Documentation = "https://your-org.github.io/your-package/"
396+
```
397+
398+
Great Docs checks these sources in order:
399+
400+
1. `site_url` in `great-docs.yml`
401+
2. `Documentation` URL in `[project.urls]` (pyproject.toml)
402+
3. `website.site-url` already present in `_quarto.yml`
403+
404+
If none are found, the build emits a warning:
405+
406+
```
407+
⚠ No site URL found — skills page will show <site-url> placeholders.
408+
Set site_url in great-docs.yml or add a Documentation URL to
409+
[project.urls] in pyproject.toml.
410+
```
411+
412+
::: {.callout-tip}
413+
Set `site_url` even before your site is deployed. Once the site goes live at that address, all
414+
generated install commands will already be correct.
415+
:::
416+
371417
## Sidebar Filter
372418

373419
The API reference sidebar includes a search filter for large APIs. Configure it:
@@ -858,8 +904,9 @@ exclude:
858904
repo: https://github.com/your-org/your-package # Override auto-detect
859905
github_style: widget
860906
861-
# Site URL (for subdirectory deployments)
862-
# site_url: "https://internal.example.com/docs/mypackage/"
907+
# Site URL — canonical address of the deployed documentation site.
908+
# Used for skills page install commands, .well-known/ discovery, and sitemaps.
909+
# site_url: "https://your-org.github.io/your-package/"
863910
864911
# Source Links
865912
source:

0 commit comments

Comments
 (0)