Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap-expo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@gmail.com>2021-01-30 17:41:24 +0300
committerXhmikosR <xhmikosr@gmail.com>2021-07-19 21:47:19 +0300
commit098b9c06f6578de2c4135565516b5c9d3f57013d (patch)
treeae1199ecd4051a94274cde4d3f9206bd95fb0bd0
parent5c92863170616f446124eabee6fc8346b3dc4e44 (diff)
Move entry code to an includedev-2
-rw-r--r--src/_includes/entry-image.html4
-rw-r--r--src/_includes/entry.html17
-rw-r--r--src/_layouts/post.html10
-rw-r--r--src/index.html10
4 files changed, 19 insertions, 22 deletions
diff --git a/src/_includes/entry-image.html b/src/_includes/entry-image.html
deleted file mode 100644
index 372602a..0000000
--- a/src/_includes/entry-image.html
+++ /dev/null
@@ -1,4 +0,0 @@
-{% assign slug = post.slug | default: page.slug | slugify -%}
-{%- assign default_post_image = "/assets/img/screenshots/" | append: slug | append: ".jpg" -%}
-{%- assign post_image = post.image | default: page.image | default: default_post_image -%}
-<img src="{{ post_image | absolute_url }}" alt="">
diff --git a/src/_includes/entry.html b/src/_includes/entry.html
new file mode 100644
index 0000000..2556836
--- /dev/null
+++ b/src/_includes/entry.html
@@ -0,0 +1,17 @@
+{% comment -%}
+ Accepts one param, "context" which can be `post` or `page`
+{%- endcomment-%}
+
+{% assign slug = include.context.slug | slugify -%}
+{%- assign default_post_image = "/assets/img/screenshots/" | append: slug | append: ".jpg" -%}
+{%- assign post_image = include.context.image | default: default_post_image -%}
+
+<a class="entry-thumb" href="{{ include.context.source }}" title="Visit {{ include.context.title }}" rel="noopener" target="_blank">
+ <img src="{{ post_image | absolute_url }}" alt="">
+</a>
+<div class="entry-content">
+ <h2 class="entry-title">
+ <a href="{{ include.context.url }}">{{ include.context.title }}</a>
+ </h2>
+ <p class="entry-date">{{ include.context.date | date: "%B %-d, %Y" }}</p>
+</div>
diff --git a/src/_layouts/post.html b/src/_layouts/post.html
index 86393f0..1df6909 100644
--- a/src/_layouts/post.html
+++ b/src/_layouts/post.html
@@ -19,15 +19,7 @@
<div class="listing">
<div class="entry">
- <a class="entry-thumb" href="{{ page.source }}" title="Visit {{ page.title }}">
- {% include entry-image.html %}
- </a>
- <div class="entry-content">
- <h2 class="entry-title">
- <a href="{{ page.url }}">{{ page.title }}</a>
- </h2>
- <p class="entry-date">{{ page.date | date: "%B %-d %Y" }}</p>
- </div>
+ {% include entry.html context=page %}
<div class="related">
<h3 class="related-title">More from the Expo</h3>
diff --git a/src/index.html b/src/index.html
index 02904e6..1d0b83c 100644
--- a/src/index.html
+++ b/src/index.html
@@ -54,15 +54,7 @@ redirect_from:
{% for post in paginator.posts %}
<div class="entry">
- <a class="entry-thumb" href="{{ post.source }}" title="Visit {{ post.title }}" rel="noopener" target="_blank">
- {% include entry-image.html %}
- </a>
- <div class="entry-content">
- <h2 class="entry-title">
- <a href="{{ post.url }}">{{ post.title }}</a>
- </h2>
- <p class="entry-date">{{ post.date | date: "%B %-d, %Y" }}</p>
- </div>
+ {% include entry.html context=post %}
</div>
{% endfor %}