Permalink
The resolved canonical public URL for a note. It is the single source of truth for links, feeds, sitemaps, and metadata, and it comes from location resolution rather than being recomputed from the slug.
Resolution order
- Core resolves a default location from the logical path.
- Plugin location hooks may adjust it, for example to add a folder prefix or a locale.
- The result is stored on the entry as its permalink.
Permalink type and usage
The permalink is typed as string on ContentManifestEntry (packages/core/src/types/content_manifest.ts) and stored as part of the ContentPublicLocation (packages/core/src/types/content_manifest.ts). It is the single source of truth for links, feeds, sitemaps, and metadata.
Key aspects:
- Resolution: Generated during location resolution via
ContentLocationResolver(packages/core/src/content/content_location.ts), which may call pluginresolveContentLocationshooks - Stability: Once set, the permalink should not be recomputed from the slug or file path
- Read, do not rebuild: Links, feeds, sitemaps, and metadata should read the permalink from the resolved entry. Rebuilding a URL from the slug or the file path skips redirects and localization and can produce a 404
Example permalink values:
// Default: "/notes/hello/"
// With folder prefix: "/blog/notes/hello/"
// With locale: "/ja/notes/hello/"
Example correct usage in a template:
<a href={entry.permalink}>Link to entry</a>
// โ Do not: <a href={buildUrlFromSlug(entry.slug)}>