mmistakes / minimal-mistakes

:triangular_ruler: Jekyll theme for building a personal site, blog, project documentation, or portfolio.
https://mmistakes.github.io/minimal-mistakes/
MIT License
12.43k stars 25.63k forks source link

Disabling Recent Posts feature #1740

Closed RafaelCartenet closed 6 years ago

RafaelCartenet commented 6 years ago

Good evening, I am completely in love with this jekyll template, it's pretty simple but quite efficient. I would actually like to use it without the post pages, indeed i'd rather have my about page as the default page when reaching out my website. I guess it's about changing the default page to about rather than recent posts. I have been searching a lot but can't find anything about this feature. Is it possible? My site : https://rafaelcartenet.github.io

Thanks in advance

mmistakes commented 6 years ago

Yes it's possible. Remove index.html or index.md in the root of your repo. Move your about page .md file to the root, rename it to index.md and it will become your home page.

mmistakes commented 6 years ago

This isn't a feature of the theme, it is a basic feature of Jekyll. It converts Markdown files into .html files. If you want a home page it needs to be named index.md or index.html and be in the root.

Or you can add something like permalink: / if you'd prefer to keep your pages in _pages/about.md. Read up on how Jekyll's permalink feature works to learn more about overriding them.

RafaelCartenet commented 6 years ago

Thanks a lot for your fast reply. Unfortunately I couldn't make it work. I moved the file to the root, renamed it to index.md and it didn't work, https://rafaelcartenet.github.io would give me 404, tried to rename it as index.html, didn't work either.

Regarding your second option, i tried changing my index.html file to:

---
layout: home
author_profile: true
permanentlink: /_pages/about.md
---

but it didn't work, got 404 again.

Is it maybe related to the layout option? it seems like the _layouts/home.html is the default page html :

---
layout: archive
---

<h3 class="archive__subtitle">{{ site.data.ui-text[site.locale].recent_posts | default: "Recent Posts" }}</h3>

{% for post in paginator.posts %}
  {% include archive-single.html %}
{% endfor %}

{% include paginator.html %}

I am not sure I really understand what's going on hehe

mmistakes commented 6 years ago

You have a public repo? I can only guess what you may have setup incorrectly and how to fix it.

RE: the second option, you got some of that wrong. I was guessing your About page was something like _pages/about.md. Which if that was the case you'd set it's permalink to permalink: /.

permanentlink: /_pages/about.md would have no affect as it isn't even close to something Jekyll uses. All permalink does is change the output path of the .html file. It's useful if you store your "page" files in different folders and want them to output elsewhere.

RE: the layout. You want to use layout: single if you're trying to make your about page the home. Using layout: home gives you the recent posts layout, which isn't what you want. layout: archive also won't give you what you want.

Whatever is wrong, it's something straightforward and easy to fix, but I need to see your files to have any clue what's going on.

RafaelCartenet commented 6 years ago

I made it ! https://rafaelcartenet.github.io It was indeed pretty straightforward, I was not completely aware of the structure, it was about the layout: home indeed. layout: single fixed the issue. Now I have a beautiful default page. Thanks a lot for your time and efficiency, great job again for the template !

fsalmasri commented 5 years ago

I changed config file to

# Defaults
defaults:
  # _posts
  - scope:
      path: ""
      type: pages #posts
    values:
      layout: single
      author_profile: true
      # read_time: true
      # comments: # true
      # share: true
      # related: true

and index.html to

---
<!-- layout: home -->
author_profile: true
permanentlink: /_pages/about.md
---

and I added about.md in _pages

---
title:  "Welcome to Jekyll!"
---

# Welcome

Recent posts disappeared when I committed layout: home but I can't see about.md content in the page.