Skip to content

Commit e22175b

Browse files
weltekialexellis
authored andcommitted
Auto generate blog rollup
Set rollup to true in a post front matter to include it the the recent publications section in the home page. The last 3 most recent posts with this value set will get displayed there. The optional category field can be set and will be displayed above the post. Signed-off-by: Han Verstraete (OpenFaaS Ltd) <[email protected]>
1 parent 30e6435 commit e22175b

7 files changed

+90
-158
lines changed

Diff for: _includes/rollup.html

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<!-- This example requires Tailwind CSS v2.0+ -->
2+
<div class="bg-white pt-16 pb-20 px-4 sm:px-6 lg:pt-24 lg:pb-28 lg:px-8">
3+
<div
4+
class="relative max-w-lg mx-auto divide-y-2 divide-gray-200 lg:max-w-7xl"
5+
>
6+
<div>
7+
<h2
8+
class="text-3xl tracking-tight font-extrabold text-gray-900 sm:text-4xl"
9+
>
10+
Recent publications
11+
</h2>
12+
<p class="mt-3 text-xl text-gray-500 sm:mt-4">
13+
Read tutorials, watch videos and catch up on new features from the
14+
inlets community.
15+
</p>
16+
</div>
17+
18+
<div
19+
class="mt-12 mb-5 grid gap-16 pt-12 lg:grid-cols-3 lg:gap-x-5 lg:gap-y-12"
20+
>
21+
{% assign rollup_posts = site.posts | where_exp: "post", "post.rollup == true" | sort: 'date' | reverse | slice: 0, 3 %}
22+
{% if rollup_posts.size > 0 %}
23+
{% for post in rollup_posts %}
24+
<div>
25+
{% if post.category %}
26+
<div>
27+
<div class="inline-block">
28+
<span
29+
class="inline-flex items-center px-3 py-0.5 rounded-full text-sm font-medium bg-pink-100 text-pink-800"
30+
>
31+
{{ post.category | capitalize_first }}
32+
</span>
33+
</div>
34+
</div>
35+
{% endif %}
36+
<a href="{{ site.base_url }}{{ post.url }}" class="block mt-4">
37+
<p class="text-xl font-semibold text-gray-900">{{ post.title }}</p>
38+
<p class="mt-3 text-base text-gray-500">{{ post.description }}</p>
39+
</a>
40+
<div class="mt-6 flex items-center">
41+
{% if post.author %}
42+
<div class="flex-shrink-0">
43+
<img
44+
class="h-10 w-10 rounded-full"
45+
src="/images/{{ post.author_img }}.jpg"
46+
alt="{{ post.author }}"
47+
alt=""
48+
/>
49+
</div>
50+
{% endif %}
51+
52+
<div class="ml-3">
53+
<p class="text-sm font-medium text-gray-900">{{ post.author }}</p>
54+
<div class="flex space-x-1 text-sm text-gray-500">
55+
<time datetime="2020-03-16"> {{ post.date | date: "%B %e, %Y" }} </time>
56+
</div>
57+
</div>
58+
</div>
59+
</div>
60+
{% endfor %}
61+
{% endif %}
62+
</div>
63+
64+
<div class="pt-5 text-sm">
65+
<a
66+
href="/blog/"
67+
class="font-medium text-indigo-600 hover:text-indigo-500"
68+
>
69+
Read more on the blog <span aria-hidden="true">&rarr;</span></a
70+
>
71+
</div>
72+
</div>
73+
</div>

Diff for: _includes/tutorials.html

-157
This file was deleted.

Diff for: _plugins/capitalize_filter.rb

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module Jekyll
2+
module CapitalizeFilter
3+
def capitalize_first(input)
4+
input.capitalize
5+
end
6+
end
7+
end
8+
9+
Liquid::Template.register_filter(Jekyll::CapitalizeFilter)
10+

Diff for: blog/_posts/2024-09-02-highly-available-tunnels.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ title: Create Highly Available Tunnels With A Load Balancer
44
description: Learn how to create a highly available inlets tunnel with a load balancer, and Proxy Protocol support, to get source IP addresses.
55
author: Alex Ellis
66
tags: ha architecture reference load-balancer
7+
category: tutorial
8+
rollup: true
79
author_img: alex
810
image: /images/2024-09-ha-tunnels/background.png
911
date: 2024-09-02

Diff for: blog/_posts/2024-10-08-real-client-ips-ingress-nginx-caddy-traefik.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ title: Get Real Client IPs with Ingress Nginx, Caddy or Traefik
44
description: Whether you're running a reverse proxy directly on a host, or an Ingress Controller in Kubernetes, you can get the real client IP with inlets.
55
author: Alex Ellis
66
tags: load-balancer ingress-controller reverse-proxy proxy-protocol
7+
category: tutorial
8+
rollup: true
79
author_img: alex
810
image: /images/2024-10-real-ips/background.png
911
date: 2024-10-08

Diff for: blog/_posts/2024-10-17-ssh-with-inlets-cloud.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ title: SSH Into Any Private Host With Inlets Cloud
44
description: Inlets Cloud is a SaaS hosted version of inlets that can give you SSH access to any host on your network.
55
author: Alex Ellis
66
tags: ssh remoteaccess inletscloud support
7+
category: tutorial
8+
rollup: true
79
author_img: alex
810
image: /images/2024-10-inlets-cloud-ssh/background.jpg
911
date: 2024-10-17

Diff for: index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
---
44
{% include hero.html %}
55
<div style="padding-bottom: 20px;"></div>
6-
{% include tutorials.html %}
6+
{% include rollup.html %}
77
<div style="padding-bottom: 20px;"></div>
88
{% include features.html %}
99
<div style="padding-bottom: 20px;"></div>

0 commit comments

Comments
 (0)