-
-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement: Parameter support for defining paths #425
Comments
Been learning HEXO for the last 15 months and now building my blog... Looking to automate some of my workflows and FrontMatter looks promising. However, a few issues make it more painful than I have time to fix.
|
Thanks @lorezyra for your feedback.
You can do this by setting the |
Also, I have a folder structure for my categories. I might have a post 3 folders (categories) deep. Those categories are a part of the path. For example: |
Is this what I should be looking for? |
@lorezyra, these placeholders are used when you are creating content. In your case, you want to let Front Matter know how it needs to show your page in the preview. This can only be done with the BTW: how is your article's front matter structured? When you say: "3 folders (categories) deep", how do you set it in the page? |
Here's a sample of my front-matter: ---
title: 20 powerful visuals about psychology & Life
tags:
- Psychology
categories:
- Life_生活
sticky: 999
comments: true
lang: en
type: HEXO/post
toc: true
tocOpen: true
indexing: true
display_tag_onHome: true
recommendedSection: false
donate: true
geolocation: Chiba, Japan
mathjax: false
share: false
copyright: true
copyLicense: false
copyLicenseURL: false
copyLicenseDesc: false
sourceUrl: false
sourceAuthor: false
sourceAuthorImg: false
sourcePublishDate: false
img: /2022/0926/Life_生活/20-powerful-visuals-about-psychology-life/AdobeStock_267678616_Maslows-needs-pyramid.svg
openGraph_img: /2022/0926/Life_生活/20-powerful-visuals-about-psychology-life/AdobeStock_267678616_Maslows-needs-pyramid.png
readTime: false
wordCount: false
date: 2022-09-26 21:55:14
updated: 2022-09-26 21:55:14
excerpt: Deconstruct complex ideas and long-form articles into simple, and thought-provoking visuals.
--- Categories are automatically generated from my folder's tree structure. For example, the post categories:
- Work
- Programming
- JS
- ExtJS |
Ok, so the path for your file is not generated by any metadata in the file, as you create it in the folder. |
I'm interested in this too. I follow the next structure for my articles:
Right now, I'm unable to use Front Matter to create new content or the preview functionality. |
Good news @AlbertoFdzM and @lorezyra, I started working on this enhancement. In version {
"frontMatter.content.pageFolders": [ {
"title": "Content by month",
"filePrefix": null,
"path": "[[workspace]]/content-folder/{{year}}/{{month}}"
}
]
} This creates the content as follows: |
It supports at the moment the following placeholders: https://frontmatter.codes/docs/content-creation/placeholders#placeholders Feel free to test it out in the latest beta. PS: This is not yet working on the preview path, this is the next step. |
Good news, preview paths now also support placeholders, but there is even more! There are two new types introduced for previews:
Here is an example: "frontMatter.content.pageFolders": [ {
"title": "Content by month",
"filePrefix": null,
"previewPath": "/{{fm.type}}/{{pathToken.3}}/{{pathToken.4}}",
"path": "[[workspace]]/content-folder/{{year}}/{{month}}",
"contentTypes": ["post"]
}
]
} In my case, the above will generate a file in the Here is an example of defining it on the content type (preferred): {
"frontMatter.taxonomy.contentTypes": [
{
"name": "post",
"previewPath": "/{{fm.type}}/{{pathToken.3}}/{{pathToken.4}}",
"pageBundle": false,
"fields": []
}
]
} |
Feedback from Twitter: https://twitter.com/LoreZyra/status/1574625380580802560
Enhancements
The text was updated successfully, but these errors were encountered: