I did set frontMatter.preview.host to http://localhost:1313. Tried restarting whole system, not only VS Code, but no change. Tried in 2 different OSs (Win, Linux - Ubuntu) still no change.
I have also added my content folder by right clicking -> add folder. So the dashboard is appearing correctly. Only this preview option is not.
I did set `frontMatter.preview.host` to `http://localhost:1313`. Tried restarting whole system, not only VS Code, but no change. Tried in 2 different OSs (Win, Linux - Ubuntu) still no change.

I have also added my content folder by right clicking -> add folder. So the dashboard is appearing correctly. Only this preview option is not.

_Originally posted by @sid-r-singh in https://github.com/estruyf/vscode-front-matter/discussions/165#discussioncomment-1565018_
<!-- github-sync-id:1042051008 -->
Oh, I just noticed, you should first open one of your pages. Once you opened a page, you should see the preview button show up.
Oh, I just noticed, you should first open one of your pages. Once you opened a page, you should see the preview button show up.
<!-- github-comment-id:957326456 -->
Just in case, I have added the button on the panel to its base view. Which means that it will show up once the setting is present. Currently available in the beta version of the extension.
Just in case, I have added the button on the panel to its base view. Which means that it will show up once the setting is present. Currently available in the beta version of the extension.
<!-- github-comment-id:957333966 -->
> Oh, I just noticed, you should first open one of your pages. Once you opened a page, you should see the preview button show up.
I tried that already. Let me post a video of what I am doing. The video starts right from the time I open VS Code.
https://user-images.githubusercontent.com/68782815/139837509-d2c0557c-7901-4a96-98ab-5455f8f9de22.mp4
<!-- github-comment-id:957344324 -->
Just in case, I have added the button on the panel to its base view. Which means that it will show up once the setting is present. Currently available in the beta version of the extension.
How do I install the beta version ?
> Just in case, I have added the button on the panel to its base view. Which means that it will show up once the setting is present. Currently available in the beta version of the extension.
How do I install the beta version ?
<!-- github-comment-id:957350735 -->
Oh 🤦♂️ - it the slug of your article, as there is none defined in your front matter of the content, it will not show the button. I'll implement the logic for this.
Oh 🤦♂️ - it the slug of your article, as there is none defined in your front matter of the content, it will not show the button. I'll implement the logic for this.
<!-- github-comment-id:957393479 -->
Logic has been implemented into the beta.
It will get the slug from the following things:
1. Slug in the front matter
2. The filename, if it's not `index.md`
3. The folder name
<!-- github-comment-id:957494889 -->
Wow that was quite fast! Preview button is appearing now but another small problem cropped up. All my markdown files are within content/blog folder. Accordingly, the preview URL should be http://localhost:1313/blog/slug. But the blog part is missing in the preview URL.
So, folder name is captured correctly. Only the registered folder name is missing.
You might wonder whether I have registered my blog folder or not. I have done it. The proof lies in my frontmatter.json, which is:
Additional info: here is how my content is organized. If the URL in production is example.com/blog/slug then the corresponding .md file lives at \content\blog\slug\index.md.
Wow that was quite fast! Preview button is appearing now but another small problem cropped up. All my markdown files are within `content/blog` folder. Accordingly, the preview URL should be `http://localhost:1313/blog/slug`. But the `blog` part is missing in the preview URL.

So, folder name is captured correctly. Only the registered folder name is missing.
You might wonder whether I have registered my `blog` folder or not. I have done it. The proof lies in my `frontmatter.json`, which is:
```
{
"$schema": "https://frontmatter.codes/frontmatter.schema.json",
"frontMatter.framework.id": "hugo",
"frontMatter.content.publicFolder": "static",
"frontMatter.content.pageFolders": [
{
"title": "blog",
"path": "c:/Users/SIDHARTH R/Documents/blog-new/content/blog"
}
]
}
```
**_Additional info:_** here is how my content is organized. If the URL in production is `example.com/blog/slug` then the corresponding `.md` file lives at `\content\blog\slug\index.md`.
<!-- github-comment-id:957604599 -->
As all SSGs and sites are different, this pathname setting is used for it. Now that there is the frontMatter.content.pageFolders setting, it can be good to extend it with a custom pathname as well.
You will need to specify one last thing, the preview pathname: https://frontmatter.codes/docs/settings#frontmatter.preview.pathname
So in your case, you'll need to add:
```
{
"frontMatter.preview.pathName": "'blog/'"
}
```
As all SSGs and sites are different, this pathname setting is used for it. Now that there is the `frontMatter.content.pageFolders` setting, it can be good to extend it with a custom pathname as well.
<!-- github-comment-id:957842640 -->
That worked like a charm 🎉✨🤩. Thanks a lot for helping me out. I'm happy that I contributed to the project in some way 😄.
That worked like a charm 🎉✨🤩. Thanks a lot for helping me out. I'm happy that I contributed to the project in some way 😄.
<!-- github-comment-id:957968807 -->
FYI: the preview path can now also be defined per content type: https://beta.frontmatter.codes/docs/content-types#preview-path
<!-- github-comment-id:958924997 -->
Thanks a ton for mentioning that. This is exactly what I was about to try out today. I was planning to add a content/snippets folder apart from the content/blog which I have now. In this case the URL needs to be http://localhost:1313/snippets/slug.
I was thinking whether it will be possible to achieve this or not & here you have already shipped this new feature. 🥳
Thanks a ton for mentioning that. This is exactly what I was about to try out today. I was planning to add a `content/snippets` folder apart from the `content/blog` which I have now. In this case the URL needs to be ` http://localhost:1313/snippets/slug`.
I was thinking whether it will be possible to achieve this or not & here you have already shipped this new feature. 🥳
<!-- github-comment-id:958944441 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
I did set
frontMatter.preview.hosttohttp://localhost:1313. Tried restarting whole system, not only VS Code, but no change. Tried in 2 different OSs (Win, Linux - Ubuntu) still no change.I have also added my content folder by right clicking -> add folder. So the dashboard is appearing correctly. Only this preview option is not.
Originally posted by @sid-r-singh in https://github.com/estruyf/vscode-front-matter/discussions/165#discussioncomment-1565018
Oh, I just noticed, you should first open one of your pages. Once you opened a page, you should see the preview button show up.
Just in case, I have added the button on the panel to its base view. Which means that it will show up once the setting is present. Currently available in the beta version of the extension.
I tried that already. Let me post a video of what I am doing. The video starts right from the time I open VS Code.
https://user-images.githubusercontent.com/68782815/139837509-d2c0557c-7901-4a96-98ab-5455f8f9de22.mp4
How do I install the beta version ?
You can install it via the following steps: https://beta.frontmatter.codes/docs/getting-started#beta-version
Oh 🤦♂️ - it the slug of your article, as there is none defined in your front matter of the content, it will not show the button. I'll implement the logic for this.
Logic has been implemented into the beta.
It will get the slug from the following things:
index.mdWow that was quite fast! Preview button is appearing now but another small problem cropped up. All my markdown files are within
content/blogfolder. Accordingly, the preview URL should behttp://localhost:1313/blog/slug. But theblogpart is missing in the preview URL.So, folder name is captured correctly. Only the registered folder name is missing.
You might wonder whether I have registered my
blogfolder or not. I have done it. The proof lies in myfrontmatter.json, which is:Additional info: here is how my content is organized. If the URL in production is
example.com/blog/slugthen the corresponding.mdfile lives at\content\blog\slug\index.md.You will need to specify one last thing, the preview pathname: https://frontmatter.codes/docs/settings#frontmatter.preview.pathname
So in your case, you'll need to add:
As all SSGs and sites are different, this pathname setting is used for it. Now that there is the
frontMatter.content.pageFolderssetting, it can be good to extend it with a custom pathname as well.That worked like a charm 🎉✨🤩. Thanks a lot for helping me out. I'm happy that I contributed to the project in some way 😄.
Thank you @sid-r-singh! Already using the extension and providing feedback is a great contribution! 🙏
FYI: the preview path can now also be defined per content type: https://beta.frontmatter.codes/docs/content-types#preview-path
Thanks a ton for mentioning that. This is exactly what I was about to try out today. I was planning to add a
content/snippetsfolder apart from thecontent/blogwhich I have now. In this case the URL needs to behttp://localhost:1313/snippets/slug.I was thinking whether it will be possible to achieve this or not & here you have already shipped this new feature. 🥳
@sid-r-singh this is now released in the main version.