Skip to content

Commit f49cf7f

Browse files
authored
Finalize explanation of how to config doc-rooted sites (#2587)
1 parent 500ee23 commit f49cf7f

File tree

5 files changed

+32
-18
lines changed

5 files changed

+32
-18
lines changed

docsy.dev/config/_default/params.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
tdVersion:
1010
latest: &tdLatestVers v0.14.3
1111
dev: &tdDevVers v0.14.4-dev
12-
buildId: &tdBuildId 023-over-main-3bcb7385
12+
buildId: &tdBuildId 024-over-main-500ee239
1313

1414
version: *tdDevVers
1515
version_menu: *tdDevVers

docsy.dev/config/doc-rooted/params.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
tdVersion:
44
latest: &tdLatestVers v0.14.3
55
dev: &tdDevVers v0.14.4-dev
6-
buildId: &tdBuildId 023-over-main-3bcb7385
6+
buildId: &tdBuildId 024-over-main-500ee239
77

88
version: &tdDocRootedVers Doc-rooted of Next
99
version_menu: *tdLatestVers

docsy.dev/config/production/params.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
tdVersion:
44
latest: &tdLatestVers v0.14.3
55
dev: &tdDevVers v0.14.4-dev
6-
buildId: &tdBuildId 023-over-main-3bcb7385
6+
buildId: &tdBuildId 024-over-main-500ee239
77

88
version: *tdLatestVers
99
version_menu: *tdLatestVers

docsy.dev/content/en/docs/content/adding-content.md

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ about how to add content and use each of Docsy's templates.
136136

137137
## Doc-rooted sites <a id="alternative-site-structure"></a>
138138

139+
{{%_param BADGE EXPERIMENTAL info %}}
140+
139141
Docsy supports documentation-first websites through a **doc-rooted** site
140142
structure, where:
141143

@@ -147,7 +149,7 @@ structure, where:
147149
As a consequence, the `docs` section landing page becomes the site home page. A
148150
doc-rooted site has the following benefits:
149151

150-
- Produces cleaner, documentation-focused URLs (no `/docs/` prefix).
152+
- Produces simpler, documentation-focused URLs (no `/docs/` prefix).
151153
- Avoids the need to create a custom home page using [blocks][] shortcodes or
152154
HTML.
153155

@@ -162,25 +164,37 @@ permalinks:
162164
docs: /:sections[1:]
163165
```
164166
165-
> [!CAUTION]
166-
>
167-
> Check for root-level URL path conflicts between doc and non-doc sections or
168-
> pages (for example, `/blog/` and `/community/`). If conflicts exist, rename
169-
> the conflicting non-doc paths or keep docs under `/docs/`.
167+
Because the docs section landing page now serves as the home page, you need to
168+
add extra configuration to avoid "Duplicate target paths" warnings and avoid
169+
render conflicts with the site-root index file.
170+
171+
Add the following front matter to each site root index file (one per language in
172+
multilingual sites):
173+
174+
```yaml
175+
build: { render: link }
176+
```
170177
171178
For an example of a doc-rooted variant of this site, see the [Doc-rooted
172179
example][] variant.
173180
174181
[Doc-rooted example]: https://doc-rooted--docsydocs.netlify.app
175182
176-
> [!NOTE] Legacy _docs-only_ setup
177-
>
178-
> Earlier versions of this page described a docs-only configuration that used a
179-
> front matter `cascade` to set page `type` values.
180-
>
181-
> That approach is no longer supported and can produce incorrect behavior. If
182-
> you are migrating from that setup, remove the `cascade` rule and configure
183-
> doc-rooted permalinks as described above.
183+
### Check for path conflicts
184+
185+
If your doc-rooted site has non-docs pages (such as blog or community pages),
186+
check for possible root-level path conflicts between docs and non-docs pages. To
187+
have Hugo report duplicate path warnings when building your site, use the
188+
`--printPathWarnings` flag.
189+
190+
### Legacy _docs-only_ setup
191+
192+
Earlier versions of this page described a docs-only configuration that used a
193+
front matter `cascade` to set page `type` values.
194+
195+
That approach is no longer supported and can produce incorrect behavior. If you
196+
are migrating from that setup, remove the old `cascade` entries and use the
197+
configuration described earlier in this section.
184198

185199
## Page front matter
186200

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "docsy",
3-
"version": "0.14.4-dev+023-over-main-3bcb7385",
3+
"version": "0.14.4-dev+024-over-main-500ee239",
44
"repository": "github:google/docsy",
55
"homepage": "https://www.docsy.dev",
66
"license": "Apache-2.0",

0 commit comments

Comments
 (0)