-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Option to set a own date format separate from the locale #82
Comments
I guess it is. Maybe it's what happens when a plugin organically grows quite a bit.. I would probably design it differently if I would re-write it from scratch now.
It makes sense, so let's design it :) The format can be the format for The format would apply to We could add a another type, name it That way, we can also make the I am also planning on adding support for overriding settings on a per-page basis, using YAML frontmatter, to support use-cases like #73. You should then be able to override Thoughts? |
That sounds good. I would be fine with a |
Because then you can do this: plugins:
- git-revision-date-localized:
type: timeago
custom_format: "%Y" And on a specific, individual page, choose to change the type: ---
git-revision-date-localized--type: custom
---
# My page I'll pick this up next time I find a chunk of time to work on the plugin :) |
Well... In that case could you just provide the custom date directly to the front matter for the same effect I would say. |
I'm not sure if that actually works? I have this PR from Dependabot open that updates the plugin: And I also updated the configuration within that branch itself: Yet, when I check the preview of the PR, is the date not updated and still shows in the format Example page (Date at the bottom): https://www.andre601.ch/blog/posts/2020/12-20-in-defense-of-spigotmc/ I also cleared the cache on netlify to make sure it's not an issue caused by that... |
Cool setup! Looks really good. I cloned your repo, checked out the branch and previewed it locally: That's the So I'm not sure what's going on tbh. I don't have any experience with netlify. I would guess indeed some kind of caching going on.. |
Did you manage to fix it? Does it work for you locally as well? |
Was indeed a caching issue. |
It is surprising that there isn't a setting to set your own date format to use.
The only current way is to use the
locale
option which has unwanted side effects such as altering the displayed name of the month.The reason why there should be such an option is the simple fact, that not everyone is actually using the same format for a date commonly used in that language.
As an example am I using English as my site's primary language, while using the german date format (
01. January 2022
) over the English one (January 01, 2022
).This causes an issue where the plugin is using the English format while I would like to use the german one instead. The issue here is that changing the locale to
de
would changeJanuary
toJanuar
which is in conflict with my site's main language.I would really appreciate it if such a setting could be added.
The text was updated successfully, but these errors were encountered: