Mounted Path (mounted_path
)
Maps a mounted countent path from repository-relative to site-relative.
Specify the repository-relative path to mounted content in the Source
property
and the site-relative path in the target
property.
When building the URL for the “Edit this page” links, any content file that has a prefix
matching a target
value is munged to replace that path prefix with the one
defined in source
.
JSON Schema
Definition
{
"$id": "https://platen.io/schemas/platen/site/repository/mounted_path/schema.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Maps a mounted content path from repository-relative to site-relative.\n\nhttps://platen.io/schemas/platen/site/repository/mounted_path/",
"properties": {
"source": {
"description": "Specifies the path to the file or folder relative to the repository root.\n\nhttps://platen.io/schemas/platen/site/repository/mounted_path/#source",
"title": "Repository-Relative Path",
"type": "string"
},
"target": {
"description": "Specifies the path to the file or folder relative to the content directory.\n\nhttps://platen.io/schemas/platen/site/repository/mounted_path/#target",
"title": "Site-Relative Path",
"type": "string"
}
},
"required": [
"source",
"target"
],
"title": "Mounted Path",
"type": "object"
}
Required Properties
Repository-Relative Path (source
)
Specifies the path to the file or folder relative to the content directory. Use this value to define the replacement prefix for this mounted content.
There are three options for replacing the prefix:
- Set this value to the repository-relative path to the file or folder for this mounted content. Use this option when the mounted content is in the same repository as the site.
- Set this value to the base URL for this content’s editing path in the repository it’s hosted in. Use this option when the mounted content is in a different repository from the site.
- Set this value to
IGNORE!!
to skip rendering the “Edit this page” link at all. Use this option when you’re including content but don’t want to include editing information about it.
Mapping Content From the Same Repository #
Given the following site configuration for a site whose repository is hosted at
https://github.com/myOrg/myProjects
:
module:
imports:
- path: github.com/myOrg/myProjects/SuperNeat
mounts:
- source: docs
target: content/reference/super-neat
All of the content in ./SuperNeat/docs
(relative to the repository root) is added to the
Hugo’s virtual filesystem in content/reference/super-neat
. When Platen processes the file
defined at ./SuperNeat/docs/about.md
, Hugo notes that the file’s path is
reference/super-neat/about.md
instead, because of the virtual filesystem.
Unless otherwise told, Platen would then build the “Edit this page” URL to be:
https://github.com/myOrg/myProjects/edit/main/content/reference/super-neat/about.md
instead of the correct:
https://github.com/myOrg/myProjects/edit/main/SuperNeat/docs/about.md
To ensure platen maps the mounted content correctly, you would specify this value as
SuperNeat/docs
and set target
to reference/super-neat
.
Mapping Content From Another Repository #
Given the following site configuration for a site whose repository is hosted at
https://github.com/myOrg/website
:
module:
imports:
- path: github.com/myOrg/myProjects/SuperNeat
mounts:
- source: docs
target: content/reference/super-neat
All of the content in the ./SuperNeat/docs
folder of the myOrg/myProjects
GitHub
repository is added to the Hugo’s virtual filesystem in content/reference/super-neat
. When
Platen processes the file defined as the about.md
file in that folder, Hugo notes that the
file’s path is reference/super-neat/about.md
instead, because of the virtual filesystem.
Unless otherwise told, Platen would then build the “Edit this page” URL to be:
https://github.com/myOrg/website/edit/main/content/reference/super-neat/about.md
instead of the correct:
https://github.com/myOrg/myProjects/edit/main/SuperNeat/docs/about.md
To ensure platen maps the mounted content correctly, you would specify this value as
https://github.com/myOrg/myProjects/edit/main/SuperNeat/docs
and set target
to
reference/super-neat
.
Ignoring Mounted Content #
Specifies the path to the file or folder relative to the content directory. Use this value to define the prefix to match for this mounted content.
For example, given the following site configuration:
module:
imports:
- path: github.com/myOrg/myProjects/SuperNeat
mounts:
- source: docs
target: content/reference/super-neat
All of the content in ./SuperNeat/docs
(relative to the repository root) is added to the
Hugo’s virtual filesystem in content/reference/super-neat
. When Platen processes the file
defined at ./SuperNeat/docs/about.md
, Hugo notes that the file’s path is
reference/super-neat/about.md
instead, because of the virtual filesystem.
Unless otherwise told, Platen would then build the “Edit this page” URL to be:
https://github.com/myOrg/myProjects/edit/main/content/reference/super-neat/about.md
To ensure platen doesn’t render an “Edit this page” link for this content, you would specify this value as
IGNORE!!
and set target
to reference/super-neat
.
Site-Relative Path (target
)
Specifies the path to the file or folder relative to the content directory. Use this value to define the prefix to match for this mounted content.
For example, given the following site configuration:
module:
imports:
- path: github.com/myOrg/myProjects/SuperNeat
mounts:
- source: docs
target: content/reference/super-neat
All of the content in ./SuperNeat/docs
(relative to the repository root) is added to the
Hugo’s virtual filesystem in content/reference/super-neat
. When Platen processes the file
defined at ./SuperNeat/docs/about.md
, Hugo notes that the file’s path is
reference/super-neat/about.md
instead, because of the virtual filesystem.
Unless otherwise told, Platen would then build the “Edit this page” URL to be:
https://github.com/myOrg/myProjects/edit/main/content/reference/super-neat/about.md
instead of the correct:
https://github.com/myOrg/myProjects/edit/main/SuperNeat/docs/about.md
To ensure platen maps the mounted content correctly, you would specify this value as
reference/super-neat
and set source
to SuperNeat/docs
.