12

How can I change the default starting page? Currently, index.html is always the index of posts.

I like to show the content of my current /about page on index.html and like to have an /articles link to the index of posts instead.

Is copy pasting /about/index.html's content into /index.html the only solution?

2 Answers 2

13

This not really a Jekyll problem, it's more an Information Architecture one.

Your page hierachy is like this :

|-index.html
|-articles.html
|-...

Just add the content you want in index.html or index.md, if you want to write it in markdown.

Create an article.html or md page and just copy the actual content of index.html in it.

Finally if you want to reach your articles page at /articles/, just add permalink: articles/ in the front matter. Otherwise, by default it will be reached at articles.html.

2
  • Great, that one helped :)! Jul 1, 2015 at 21:33
  • @Christopher How could it possibly help?
    – kludg
    Sep 17, 2020 at 12:01
4

You can use gem 'jekyll-redirect-from' in jekyll to set different homepage than index.html and also customize output URL of any xxxx.html.

Add this line to your project's Gemfile:

gem 'jekyll-redirect-from'

And then execute in terminal:

bundle

Once it's installed into your environment, add it to your _config.yml:

plugins:
  - jekyll-redirect-from

Now, To set about.html as homepage: Add it at start of about.html:

---
permalink: /
redirect_from:
  - /about
---

As a result, www.website.com/about will redirect to www.website.com and content of about.html will be shown.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.