Closed grahampcharles closed 7 months ago
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:
frontMatter.preview.pathName
settingThank 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?).
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.
I see! Thank you for your response.
@grahampcharles we can keep the issue open, as this is a good enhancement for one of the upcoming version
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
frontMatter.preview.host
setting does not work in the manner that it is documented on this page. If I set that value tohttp://localhost:1313
as instructed (this is a hugo site), the preview attempts to loadhttp://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