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.48k stars 25.74k forks source link

Archive page subtitles be surrounded by <code> mistakenly #415

Closed hijiangtao closed 8 years ago

hijiangtao commented 8 years ago

I used the latest release version to generate my blog, and use year-archive.html in your repo's gh-pages branch to generate my /archive page. It is supposed that the subtitle of year, such as 2016 should be like the appearance in your website archive by year, but when I jekyll s it locally, it is surrounded by <code> tag mistakenly. And the only thing I did is rename the year-archive.html to year-archive.md, I am wondering if there is some modifications in the latest release version that influence the generation of this page. I also tried tag-archive.html and category-archive.html in _pages folder, but it runs normally without the <code> tag surrounded. Picture shows below.

image

Best.

mmistakes commented 8 years ago

What's going on is when you changed the page from .html to.md it's telling Jekyll to process the page as Markdown.

Since there is an indent around the subtitle line it's being converted into a <code> block. If you remove the indents it should process correctly.

{% include base_path %}
{% capture written_year %}'None'{% endcapture %}
{% for post in site.posts %}
{% capture year %}{{ post.date | date: '%Y' }}{% endcapture %}
{% if year != written_year %}
<h2 id="{{ year | slugify }}" class="archive__subtitle">{{ year }}</h2>
{% capture written_year %}{{ year }}{% endcapture %}
{% endif %}
{% include archive-single.html %}
{% endfor %}