Search code examples
jekyllblogsgithub-pages

How can I tell Jekyll to use a subdirectory for article links?


I have a Jekyll blog with the usual directory structure, i.e. a _posts subdirectory containing the posts. The blog is currently accessible by appending /blog to the domain root URL (that is, https://bbs-software.com/blog). I would like the article URL's to include the blog subdirectory as well, but they currently do not. I am hosting the blog on Github, and the repo is publicly accessible at https://github.com/keithrbennett/keithrbennett.github.io. I have a forward set up to forward /blog to /. I may want to put something other than my blog at the root of this domain, so I'd like all blog URL's to use the blog subdirectory. How can I accomplish this?


Solution

  • You can do it by creating a /blog/_posts folder, as explained on this article: https://miklb.com/blog/2016/04/26/organizing-jekyll-posts/