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.32k stars 25.47k forks source link

How to modify archive-single.html to add more links to each item and format them correctly #492

Closed alexlenail closed 8 years ago

alexlenail commented 8 years ago

I'm looking for a way to show a collection on an archive page, and include more information about each member of the collection on that page. This means I need to edit archive-single.html. Markdownify is not acting the way I suppose I would expect it to.

Here's a member of my collection:


---
title: "Network Modeling of Heterogeneous Diseases"
authors: "Ernest Fraenkel and Martina Koeva"
links:
  - "[Encyclopedia of Cell Biology 2016; doi: 10.1016/B978-0-12-394447-4.40032-5](http://www.sciencedirect.com/science/article/pii/B9780123944474400325)"

---

Here's what it comes out to:

screen shot 2016-08-29 at 4 05 51 pm

Here's my code:

{% for link in post.links %}
      <p class="archive__item-excerpt" itemprop="links">{{ link | markdownify | strip_html }}</p>
{% endfor %}

I was hoping markdownify would be magic for me, but it wasn't. I see further above, you have:

{% if post.link %}
        <a href="{{ post.link }}">{{ title }}</a> <a href="{{ base_path }}{{ post.url }}" rel="permalink"><i class="fa fa-link" aria-hidden="true" title="permalink"></i><span class="sr-only">Permalink</span></a>
{% else %}

But since all my links are in the format:

links: 
  - [words](url)

I don't know that I can separate out "words" and "url" in the html template. I was hoping there was another way.

alexlenail commented 8 years ago

Actually getting rid of the strip_html solved this -- sorry for raising the issue!