org-page icon indicating copy to clipboard operation
org-page copied to clipboard

Change default category "Blog" title ?

Open kevinkwl opened this issue 8 years ago • 10 comments

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

kevinkwl avatar Oct 28 '16 00:10 kevinkwl

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.

sillykelvin avatar Oct 28 '16 02:10 sillykelvin

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?

nasseralkmim avatar Mar 02 '17 14:03 nasseralkmim

Try add the following option in your org file:

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

sillykelvin avatar Mar 03 '17 02:03 sillykelvin

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?

nasseralkmim avatar Mar 03 '17 14:03 nasseralkmim

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

sillykelvin avatar Mar 06 '17 03:03 sillykelvin

The newest commit has fixed this problem, happy hacking!

sillykelvin avatar Mar 06 '17 03:03 sillykelvin

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.

nasseralkmim avatar Mar 06 '17 12:03 nasseralkmim

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

sillykelvin avatar Mar 07 '17 02:03 sillykelvin

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.

nasseralkmim avatar Mar 07 '17 10:03 nasseralkmim

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.

sillykelvin avatar Mar 10 '17 10:03 sillykelvin