emacsorphanage / org-page

[INACTIVE] A static site generator based on Emacs and org mode.
673 stars 99 forks source link

Need a way to change category name (I18N) #163

Closed ghost closed 8 years ago

ghost commented 8 years ago

I'm about to start a personal French blog. I need to be able to change category name to use the French translation. For example, I should use "Blogue" instead of "Blog" in French. And I have a category with an accent in the name.

A suggestion may be to add a ":label" option to op/category-config-alist. If it's not provided, use the default behavior.

sillykelvin commented 8 years ago

org-page takes folder names in source branch as categories, so you can just put "Blogue" folder there, and use the following configuration:

(setq op/category-config-alist
      '(("Blogue"    ;; <----- use your own category name here
         :show-meta t
         :show-comment t
         :uri-generator op/generate-uri
         :uri-template "/blog/%y/%m/%d/%t/"
         :sort-by :date
         :category-index t)
        [other categories here]
))
ghost commented 8 years ago

I tried it, but the "Blog" category seems to be hardcoded somewhere. It's always displayed. If I remove the "blog" folder, the op/do-publication-and-preview-site fails with this error :

apply: Setting current directory: no such file or directory, ~/org/website/stephanearguin.com/blog/

I'm working on a fix to add an optional :label property to op/category-config-alist (if you want, I'll create a PR). In addition to previous issue, one of the main reason is accentuated characters we have in French (and other languages). Using accent in a folder name is bad and a recipe for disaster. :)

Here an example:

(setq op/category-config-alist
      '(("reference"
         :label "Référence"  ;; <-- In French, accents are required
         :show-meta t 
...))
sillykelvin commented 8 years ago

Yeah, Hard coded things would always be evil...