Skip to content

Commit

Permalink
Review 'Reuse directories of content' (#756)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdbaldry authored Jun 26, 2024
1 parent d43388f commit c89ae0d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions docs/sources/write/reuse-content/reuse-directories/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,32 @@ keywords:
- shared content
- Hugo
menuTitle: Reuse directories of content
review_date: "2024-03-14"
review_date: "2024-06-26"
title: Reuse directories of content with Hugo mounts
---

# Reuse directories of content with Hugo mounts

{{< admonition type="note" >}}
The following task can only be performed by a Grafana Labs employee.
Only a Grafana Labs employee can perform the following task.
{{< /admonition >}}

Before Hugo performs a build, _Hugo mounts_ mount a source directory at a destination directory.
Use Hugo mounts to reuse a whole directory of content in another part of the published technical documentation.
Before Hugo performs a build, it reads the [_Hugo module mounts_](https://gohugo.io/hugo-modules/configuration/#module-configuration-mounts) configuration to construct a virtual filesystem.
Each mount mounts a source directory at a destination directory within that filesystem.
You can use Hugo mounts to reuse a whole directory of content in another part of the published technical documentation.

## Before you begin

- Identify a directory of content that you want to reuse.
- Identify any pages to exclude.
Typically, excluded pages don't make sense in the context of the target directory.
Typically, excluded pages are ones that don't make sense in the context of the target directory.

{{< admonition type="warning" >}}
Pages in the directory might have relative links to other pages that would be broken by their exclusion.

If the excluded page is replaced by another in the target directory, relative links continue to work.

Otherwise, the broken relative links should be made absolute.
That way, they always refer to the page in the source directory.
Otherwise, you should make the links absolute so that they always refer to the page in the source directory.
{{< /admonition >}}

## Steps
Expand All @@ -50,7 +50,7 @@ To reuse a shared directory:
Similarly, the target directory has the path prefix `content/docs`.
For the destination URL `https://grafana.com/docs/target-directory/`, the path is `content/docs/target-directory`.

1. For every page in the source directory, set the canonical URL using the `canonical` front matter, to the currently published open source page URL.
1. For every page in the source directory, set the canonical URL using the `canonical` front matter, to the published open source page URL.

The `canonical` front matter indicates the preferred URL for duplicate or very similar pages.
For more information, refer to [Canonical](https://grafana.com/docs/writers-toolkit/write/front-matter/#canonical).
Expand All @@ -61,7 +61,7 @@ To reuse a shared directory:

Append the mount to the `docs.manual_mount` key in the YAML configuration.

For example, mount the source `content/docs/source-directory` at `content/docs/target-directory` and exclude the root `_index.md` file:
For example, mount the source `content/docs/source-directory` at `content/docs/target-directory` and exclude the `content/docs/source-directory/_index.md` file:

```yaml
- source: content/docs/source-directory
Expand Down

0 comments on commit c89ae0d

Please sign in to comment.