frontMatter.preview.host Feedback #202

Closed
opened 2026-10-05 02:33:06 +02:00 by adam · 6 comments
Owner

The frontMatter.preview.host setting does not work in the manner that it is documented on this page. If I set that value to http://localhost:1313 as instructed (this is a hugo site), the preview attempts to load http://localhost:1313/pagename and gets a 404. Hugo's default permalink is /:section/:title/, though, which of course can be overridden in the configuration. Front Matter appears not to take that into account.

I have verified that the page does actually load at localhost:1313/section/pagename.


Document Details

⚠ Do not edit this section

The `frontMatter.preview.host` setting does not work in the manner that it is documented on this page. If I set that value to `http://localhost:1313` as instructed (this is a hugo site), the preview attempts to load `http://localhost:1313/pagename` and gets a 404. Hugo's default permalink is `/:section/:title/`, though, which of course can be overridden in the configuration. Front Matter appears not to take that into account. I have verified that the page does actually load at `localhost:1313/section/pagename`. --- #### Document Details ⚠ *Do not edit this section* * ID: site-preview * URL: https://frontmatter.codes/docs/site-preview * Content Source: /content/docs/site-preview.md <!-- github-sync-id:1140487201 -->
adam closed this issue 2026-10-05 02:33:06 +02:00
Author
Owner

Thanks @grahampcharles, that setting is to specify the base host location, if you want to further configure the sections/paths, you can check the following part of the documentation: https://frontmatter.codes/docs/content-types#preview-path

There are actually two other options to specify the path for your content:

  1. Via the content type
  2. Via the frontMatter.preview.pathName setting
Thanks @grahampcharles, that setting is to specify the base host location, if you want to further configure the sections/paths, you can check the following part of the documentation: https://frontmatter.codes/docs/content-types#preview-path There are actually two other options to specify the path for your content: 1. Via the content type 2. Via the `frontMatter.preview.pathName` setting <!-- github-comment-id:1042112301 -->
Author
Owner

Thank you! That part of the documentation does not indicate how to use the equivalent of :section or :slug in the preview.pathName setting.

Since hugo already has a permalink setting, I'm curious as to why FM doesn't just use that? A separate previewPath setting seems duplicative (or maybe I'm missing something?).

Thank you! That part of the documentation does not indicate how to use the equivalent of :section or :slug in the `preview.pathName` setting. Since hugo already has a `permalink` setting, I'm curious as to why FM doesn't just use that? A separate `previewPath` setting seems duplicative (or maybe I'm missing something?). <!-- github-comment-id:1063242605 -->
Author
Owner

FM is intended to work on any SSG, but it makes sense as well to retrieve settings from the SSG. Why FM doesn't use it yet? Just because you are the first that mentions it, so it would be a good enhancement to FM to be more SSG aware.

FM is intended to work on any SSG, but it makes sense as well to retrieve settings from the SSG. Why FM doesn't use it yet? Just because you are the first that mentions it, so it would be a good enhancement to FM to be more SSG aware. <!-- github-comment-id:1063274275 -->
Author
Owner

I see! Thank you for your response.

I see! Thank you for your response. <!-- github-comment-id:1063319403 -->
Author
Owner

@grahampcharles we can keep the issue open, as this is a good enhancement for one of the upcoming version

@grahampcharles we can keep the issue open, as this is a good enhancement for one of the upcoming version <!-- github-comment-id:1063320820 -->
Author
Owner

The CMS now has more capabilities to use front matter values in order for previews, and they can be defined on global, page folder, and content type levels.

The CMS now has more capabilities to use front matter values in order for previews, and they can be defined on global, page folder, and content type levels. <!-- github-comment-id:2004413423 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/vscode-front-matter#202