From 566a4418f168784bf70ec6cf0013db65965dde00 Mon Sep 17 00:00:00 2001 From: Kyle Gordy Date: Mon, 2 Dec 2019 12:34:59 -0500 Subject: [PATCH] Split post list item into an include to keeps things DRY --- _includes/featured-post-hero.html | 29 +++++------------------------ _includes/post-list-item.html | 23 +++++++++++++++++++++++ blog/index.html | 24 +----------------------- 3 files changed, 29 insertions(+), 47 deletions(-) create mode 100644 _includes/post-list-item.html diff --git a/_includes/featured-post-hero.html b/_includes/featured-post-hero.html index 1f56b65..f09234d 100644 --- a/_includes/featured-post-hero.html +++ b/_includes/featured-post-hero.html @@ -58,31 +58,12 @@

Featured Series

diff --git a/_includes/post-list-item.html b/_includes/post-list-item.html new file mode 100644 index 0000000..be5498a --- /dev/null +++ b/_includes/post-list-item.html @@ -0,0 +1,23 @@ +
  • + + +

    + + {{ post.title | escape }} + +

    + + + + Author: + {%- if site.data.authors[post.author] -%} + {{ site.data.authors[post.author].name}} + {%- else -%} + {{ post.author }} + {%- endif -%} + + +
  • diff --git a/blog/index.html b/blog/index.html index 5064ca2..61eb1a1 100644 --- a/blog/index.html +++ b/blog/index.html @@ -19,29 +19,7 @@ title: Blog {%- for post in paginator.posts -%} -
  • - - -

    - - {{ post.title | escape }} - -

    - - - - Author: - {%- if site.data.authors[post.author] -%} - {{ site.data.authors[post.author].name}} - {%- else -%} - {{ post.author }} - {%- endif -%} - - -
  • + {% include post-list-item.html %} {%- endfor -%}