-
-
Notifications
You must be signed in to change notification settings - Fork 78
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: Enumerate indices as filePrefix
#844
Comments
@wottpal In issue #841, there is an example of including the above prefix by a custom placeholder. Now, I'm thinking of making it part of the CMS, but I am not sure about the format. For the
The placeholder structure could look as follows:
What do you think? |
Hey @estruyf, thanks for the addition & script in #841 - Just back to work today and I'll give it a try soon :)
I think this looks fantastic and could be really useful for everyone. One question though, what does the |
Welcome back!
It might not be required, but in some cases, other files are in the folder where you want to create your content. Just thinking about those cases where you want to make sure the index is based on the content files, and not the unrelated ones. Another way is to make the assumption there are only content files. |
In the latest beta, the new placeholder is available and you can use it as follows:
I have updated the name and its settings to make it clearer and easier to use. |
Hey @estruyf, just tested the Beta and it works amazing so far. Just with one quirk: All counts are one off (+1) and I was able to figure out that this is related to invisible I would suggest either:
|
Thanks, @wottpal, for verifying. I changed the logic slightly to exclude the hidden files and verify files against the |
This functionality is now part of the |
When creating new content, it's currently possible to prepend the current date & year via the
filePrefix
attribute.As we enumerate our files in subdirectories with indices (instead of dates) I would highly appreciate seeing this being automated via Frontmatter CMS.
Idea:
filePrefix
format:0000-
where the amount of0
s determines the index string-length (left-padded with0
s).000${i+1}-
.The text was updated successfully, but these errors were encountered: