diff options
-rw-r--r-- | _includes/jekyll-theme/posts/feed.html | 16 | ||||
-rw-r--r-- | _includes/jekyll-theme/posts/header.html | 32 | ||||
-rw-r--r-- | _layouts/post.html | 16 |
3 files changed, 34 insertions, 30 deletions
diff --git a/_includes/jekyll-theme/posts/feed.html b/_includes/jekyll-theme/posts/feed.html index 5bcf14d..629e4ee 100644 --- a/_includes/jekyll-theme/posts/feed.html +++ b/_includes/jekyll-theme/posts/feed.html @@ -3,21 +3,7 @@ {% else %} {% for post in paginator.posts %} <a href="{{ post.url | relative_url }}" class="feed-entry"> - <div class="post-header"> - <h3>{{ post.title }}</h3> - <div class="post-date"> - <p class="text-muted"> - {%- comment -%} - Collapse the Liquid whitespace here, so that no extra spaces - between <span>s are introduced. - {%- endcomment -%} - {%- if post.category -%} - <span class="glyphicon glyphicon-folder-open"></span> <span class="category">{{ post.category }}</span> - {%- endif -%} - <span class="glyphicon glyphicon-time"></span> {{ post.date | date: '%-d %b %Y' }} - </p> - </div> - </div> + {% include jekyll-theme/posts/header.html feed=true %} <div class="text-muted">{{ post.excerpt | markdownify }}</div> </a> {% endfor %} diff --git a/_includes/jekyll-theme/posts/header.html b/_includes/jekyll-theme/posts/header.html new file mode 100644 index 0000000..cadbb95 --- /dev/null +++ b/_includes/jekyll-theme/posts/header.html @@ -0,0 +1,32 @@ +<div class="post-header"> + {% assign h = 'h1' %} + {% if include.feed %} + {% assign h = 'h3' %} + {% else %} + {% assign post = page %} + {% endif %} + <{{ h }}>{{ post.title }}</{{ h }}> + <div class="post-date"> + <p class="text-muted"> + {%- comment -%} + Collapse the Liquid whitespace here, so that no extra spaces + between <span>s are introduced. + {%- endcomment -%} + {%- if post.category -%} + <span class="glyphicon glyphicon-folder-open"></span> + {%- if include.feed -%} + <span class="category"> + {%- else -%} + <a class="category" href="{{ '/' | relative_url }}{{ post.category | slugify: 'pretty' }}/"> + {%- endif -%} + {{ post.category }} + {%- if include.feed -%} + </span> + {%- else -%} + </a> + {%- endif -%} + {%- endif -%} + <span class="glyphicon glyphicon-time"></span> {{ post.date | date: '%-d %b %Y' }} + </p> + </div> +</div> diff --git a/_layouts/post.html b/_layouts/post.html index 92fa965..12eade5 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -1,19 +1,5 @@ --- layout: default --- -<div class="post-header"> - <h1>{{ page.title }}</h1> - <div class="post-date"> - <p class="text-muted"> - {%- comment -%} - Collapse the Liquid whitespace here, so that no extra spaces - between <span>s are introduced. - {%- endcomment -%} - {%- if page.category -%} - <span class="glyphicon glyphicon-folder-open"></span> <a class="category" href="{{ '/' | relative_url }}{{ page.category | slugify: 'pretty' }}/">{{ page.category }}</a> - {%- endif -%} - <span class="glyphicon glyphicon-time"></span> {{ page.date | date: '%-d %b %Y' }} - </p> - </div> -</div> +{% include jekyll-theme/posts/header.html %} {{ content }} |