Hugo only uses the Gregorian calendar because of the use of the Google language. And Hugo does not support Plugin. Is it possible to automatically convert html files to Persian calendar using npm packages like this https://github.com/jalaali/jalaali-js when outputting from Hugo? Or tell me if you have a good solution.
Asked
Active
Viewed 94 times
1 Answers
0
From what I, by the "persian calendar" you mean, the months/lunar cycle in the persian calendar including the day and month names, correct?
This is what I believe you will have to do to get this to work.
- As you can see, Hugo uses the GoLang date-time system: https://gohugo.io/functions/format/#gos-layout-string
- which is here: https://golang.org/pkg/time/#ANSIC
- It doesn't seem this has a native Lunar calendar system (I call this Lunar calendar because I'm not used to the Persian calendar, but my own cultures, which is Lunar and different than the European system).
- But, this can be possibly added: https://pkg.go.dev/github.com/yaa110/go-persian-calendar
But, as this could be QUITE some work, it could be much simpler if you say EXACTLY what you are trying to do... other than (automatically convert html files to persian calendar).
The answer to that is, sure. Just Grep the string...
But I don't think that's what you are really looking for.
Best of luck!

Rogelio
- 910
- 5
- 14