Octopress, by default, generates static websites with a /blog prefix attached
to categories, archives and post URLs. This is particularly annoying when the
blog is hosted at blog.yourdomain.tld and have funny URLs like
blog.yourdomain.tld/blog/archives.
To get rid of this, I’ve created a clone of the classic Octopress theme with the necessary changes. It also renames Blog to Home in the navigation bar.
To install and use octopress-classic-no-blog theme:
1 2 3 | |
Changes are also required in _config.yml. permalink, category_dir,
pagination_dir properties have to be modified to remove the blog prefix
1 2 3 4 5 6 7 8 | |
After installing the theme and fixing _config.yml, generate the blog.
1
| |
DIY for other themes
To achieve this for other themes, the following modifications should suffice. [Assumption: The theme is already installed and you are familiar with diffs]
1
| |
Move archives folder from source/blog to source/.
1
| |
Edit source/_includes/custom/navigation.html to fix navigation URLs.
1 2 3 4 | |
Edit source/index.html to fix the Archives page URL.
1 2 | |
A theme in the .themes folder can be modified similarly, but will have to be
reinstalled with the rake install['theme-name'] command afterwards.