Skip to content

Commit 8ac34bc

Browse files
authored
Add blog achive page (#391)
This PR create blog achive page. --------- Signed-off-by: Shizuo Fujita <[email protected]>
1 parent bf7fd2a commit 8ac34bc

File tree

5 files changed

+66
-7
lines changed

5 files changed

+66
-7
lines changed

app.rb

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
require 'yaml'
66
require 'redcarpet'
77
require 'slugify'
8+
require 'date'
89

910
# Settings
1011
set :app_file, __FILE__
@@ -105,6 +106,27 @@
105106
},
106107
}
107108

109+
def blog_posts_all
110+
Dir.glob(File.join(settings.root, "content/blog/*.md"))
111+
.sort
112+
.reverse
113+
.filter_map do |path|
114+
if m = path.match(%r{/content/blog/(\d{4})(\d{2})(\d{2})_(.+)\.md$})
115+
y, mo, d, article = m.captures
116+
title = begin
117+
first = File.open(path, &:readline)
118+
first.sub(/^#\s*/, '').strip
119+
end
120+
{
121+
date: Date.new(y.to_i, mo.to_i, d.to_i),
122+
url: "/blog/#{article}",
123+
title: title,
124+
}
125+
end
126+
end
127+
end
128+
129+
108130
N_RECENT_POSTS=10
109131

110132
#
@@ -264,6 +286,15 @@
264286
erb :rss, :layout => false
265287
end
266288

289+
get '/blog/archive' do
290+
redirect '/blog/archive/', 301
291+
end
292+
293+
get '/blog/archive/' do
294+
erb :blog_archive, locals: { posts: blog_posts_all }
295+
end
296+
297+
267298
get '/newsletter' do
268299
@title = "Sign up for Fluentd Newsletter"
269300
erb :newsletter_signup, :layout => :minimal_layout

content/blog/20210504_fluentcon-recap.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
## FluentCon 2021 Recap & Updates
1+
# FluentCon 2021 Recap & Updates
22

33
We’ve just had a series of amazing sessions from leaders and friends in the Fluentd & Fluent Bit community from Chronosphere, Calyptia, Nieman and Marcus, Cisco, Microsoft, Amazon, SAP, Zendesk and many community members & attendees from all over the world. There were variety of use cases, production challenges and solutions, performance optimization with great benchmark results at scale. Hope you enjoyed the conference and here are some notes for your review.
44

5-
### 1st FluentCon co-located with KubeCon
5+
## 1st FluentCon co-located with KubeCon
66

77
1st FluentCon, co-located with KubeCon Europe, had a variety of topics covered starting from Fluentd & Fluent Bit updates including native metrics support and followed by great talks.
88

9-
### Observability for operation at scale
9+
## Observability for operation at scale
1010
We really felt the vendor neutral observability is getting more momentum and exciting activities in "Tracing", "Metrics" and "Logs" are coming together to bring the operation at scale to the next level.
1111

12-
### Fluentd and Fluent Bit Updates
12+
## Fluentd and Fluent Bit Updates
1313
1. **Fluentd turns 10 in June!** Happy 10th birthday!
1414
2. Fluent Bit is being deployed **over 2 million times a day**.
1515
3. **Conrainer deployments** are **10x higher** than package deployments.
1616
4. New release of **Fluent Bit 1.7** and **Fluentd 1.12**
1717
- Fluent Bit multi-workers, new SSL library, and improved I/O disk performance (**Available now!**)
1818

19-
### More Transparency, Accessibility and Neutrality for Observability
19+
## More Transparency, Accessibility and Neutrality for Observability
2020
1. New ways to engage the community with [**https://discuss.fluentd.org**][1]
2121

2222
[1]: https://discuss.fluentd.org
@@ -27,11 +27,11 @@ We really felt the vendor neutral observability is getting more momentum and exc
2727
- Stream Processor support to Extract Metrics from Log data (Coming soon)
2828
- Support for Open Telemetry Protocol (OLTP) (Coming later this year.)
2929

30-
### Simpler Plugin Development
30+
## Simpler Plugin Development
3131
1. New **WebAssembly** integration with Fluent Bit (Coming later this year.)
3232
2. Write plugins the language you want. Keep the blazing fast performance.
3333

34-
### Thanks to the foundation and conference speakers and sponsors
34+
## Thanks to the foundation and conference speakers and sponsors
3535
We would like to thank Cloud Native Computing Foundation and conference oganizer team for all the community effort making people meet and discuss in this challenging moment. We also thank all the amazing speakers and sponsors to support the 1st FluentCon.
3636
Here is the list of speakers and sponsors.
3737

views/blog.erb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@
5656
</ul>
5757
</div>
5858
-->
59+
<hr>
60+
<div class="blog-archive">
61+
<a href="/blog/archive/" class="archive-link">View Full Archive</a>
62+
</div>
63+
5964
<!--End Pagination-->
6065
</div>
6166
<!-- End Left Sidebar -->
@@ -96,6 +101,9 @@
96101
<% @recent_articles.each { |a| %>
97102
<p><%= a[:date] %>: <a href="/blog/<%= a[:url] %>"><%= a[:title] %></a></p>
98103
<% } %>
104+
<div class="blog-archive">
105+
<a href="/blog/archive/" class="archive-link">View Full Archive</a>
106+
</div>
99107
</div>
100108
<!-- End Posts -->
101109

views/blog_archive.erb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!--=== Breadcrumbs ===-->
2+
<div class="breadcrumbs margin-bottom-40">
3+
<div class="container">
4+
<h1 class="pull-left">Blog archive</h1>
5+
<ul class="pull-right breadcrumb">
6+
<li><a href="/">Home</a></li>
7+
<li class="active">Blog archive</li>
8+
</ul>
9+
</div><!--/container-->
10+
</div><!--/breadcrumbs-->
11+
<!--=== End Breadcrumbs ===-->
12+
13+
<div class="container">
14+
<% posts.each do |p| %>
15+
<p><%= p[:date].strftime("%Y-%m-%d") %>: <a href="<%= p[:url] %>"><%= p[:title] %></a></p>
16+
<% end %>
17+
</div>

views/blog_single.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@
9797
<% @recent_articles.each { |a| %>
9898
<p><%= a[:date] %>: <a href="/blog/<%= a[:url] %>"><%= a[:title] %></a></p>
9999
<% } %>
100+
<div class="blog-archive">
101+
<a href="/blog/archive/" class="archive-link">View Full Archive</a>
102+
</div>
100103
</div>
101104
<!-- End Posts -->
102105

0 commit comments

Comments
 (0)