From 622d36084a2a03b9d27c939f5a11b2f8871f4aa3 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Fri, 13 May 2022 05:17:58 +0200 Subject: posts: separate include for post header --- _includes/jekyll-theme/posts/feed.html | 16 +--------------- _includes/jekyll-theme/posts/header.html | 32 ++++++++++++++++++++++++++++++++ _layouts/post.html | 16 +--------------- 3 files changed, 34 insertions(+), 30 deletions(-) create mode 100644 _includes/jekyll-theme/posts/header.html 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 %} -
-

{{ post.title }}

- -
+ {% include jekyll-theme/posts/header.html feed=true %}
{{ post.excerpt | markdownify }}
{% 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 @@ +
+ {% assign h = 'h1' %} + {% if include.feed %} + {% assign h = 'h3' %} + {% else %} + {% assign post = page %} + {% endif %} + <{{ h }}>{{ post.title }} + +
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 --- -
-

{{ page.title }}

- -
+{% include jekyll-theme/posts/header.html %} {{ content }} -- cgit v1.2.3