Reputation: 7961
I am very new to Jekyll and I am failing to find configuration to change the following:
I built a basic Jekyll site using jekyll new .
and ran jekyll serve
to learn and built a layout using Jekyll. The basic test site gives me the following URL for posts: /jekyll/update/2016/01/30/welcome-to-jekyll.html
. Is the URL like that because I am running jekyll serve
and not jekyll build
? I want to remove the the jekyll/update from the URL path, so my final URLs for posts look like the following: /2016/01/30/welcome-to-jekyll.html
.
I want my pages to be stored in a separate directory _pages
instead of the root directory. How can I do that?
Is there way to prepend a path to files loaded from a specific directory? For example, I want to make a /_projects directory. Then add files with the following permalinks: /prj-test1, /prj-test2, /prj-test3. When compiled, I want to get the following URLs: /projects/prj-test1, /projects/prj-test2, /projects/prj-test3, respectively. Is this possible?
Upvotes: 5
Views: 3898
Reputation: 2113
Yes, everything you asked is possible.
Take a look at these examples, you might want to choose one of them. But to do as you asked, you'll need to change the permalink to /:year/:month/:day/:title.html
. To do that, add this line to your _config.yml
file:
permalink: /:year/:month/:day/:title.html
It depends on the structure you want to achieve. You can use collections or simply create pages inside a folder called pages
(without the underscore).
Yes. You can do that via collections, for example.
I recommend you to take a look at some templates, so you can see how the code works in different ways:
Try some Jekyll Themes here and here. Download them and study their structures.
If you want to go deep, take a look how Jekyll build its own website.
Hope to have helped!
Upvotes: 14