emacsorphanage / org-page

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

Change default category "Blog" title ? #202

Open kevinkwl opened 7 years ago

kevinkwl commented 7 years ago

Can I use another name like "Post" as the title for that category?

sillykelvin commented 7 years ago

Sorry, "blog" is a default category cannot be removed, the uri cannot be changed, however, you can define a :label in op/category-config-alist to change the name shown on pages. See function op/get-category-name and variable op/category-config-alist for detail.

nasseralkmim commented 7 years ago

Kelvinh, I changed the label but the url still shows blog. Is there a way to change this behavior so the url is formed with the label variable?

sillykelvin commented 7 years ago

Try add the following option in your org file:

#+URI: /the/url/you/wanted/here

nasseralkmim commented 7 years ago

the url of individual posts are correct. But the url in the navigation bar is using the category name (blog) instead of the label (notes).

I think it is related with the variable: category-uri. Is it getting the name 'blog' or the assigned label?

sillykelvin commented 7 years ago

Yes, it's rendered by category-uri, only the shown name is controlled by assigned label, the uri is not.

sillykelvin commented 7 years ago

The newest commit has fixed this problem, happy hacking!

nasseralkmim commented 7 years ago

That's great, thank you. edit: kelvinh, I just tried here. It seem that something broke (not working as expected). I think it is better to revert that commit. The variable op/category-ignore-list can be used to ignore the blog category? so I can create a new one with similar behavior but different name.

sillykelvin commented 7 years ago

What is broken? the ignore list cannot ignore the blog category, as it's one of the default categories.

nasseralkmim commented 7 years ago

It seems that a category with a different label produce a new folder with the label name without a index.html, and since the url is generated by a folder with a index.html you don't get the list of entries in the category.

It's better to keep the way it was, the label only change the name displayed, not the url.

sillykelvin commented 7 years ago

Yes, you are right, the commit has been reverted. There is another dirty way to achieve this: edit the template nav.mustache, put the things you wanted there directly.