Skip to content

Commit beb4625

Browse files
committed
Update March writing.
1 parent 87d59dd commit beb4625

File tree

10 files changed

+503
-251
lines changed

10 files changed

+503
-251
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v4
12+
- uses: ruby/setup-ruby@v1
13+
with:
14+
ruby-version: '3.4'
1215
- run: ruby generate.rb
1316
- run: mv .gitignore.build .gitignore
1417
- uses: JamesIves/github-pages-deploy-action@v4

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## start "dev server"
44

55
```
6-
npx --yes chokidar-cli "**/*.{erb,json,md,rb}" -c "ruby generate.rb"
6+
npx --yes chokidar-cli "**/*.{erb,json,md,rb,ebr}" -c "ruby generate.rb"
77
```
88

99
## build

_post.html.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
<span class="avatar-text-group">
77
By
88
<img
9-
id="avatar-photo"
10-
src="<%= @writing[:author_avatar_url] %>"
11-
/>
12-
<%= @writing[:author] %><%= @writing[:released_at] %><%= @writing[:place] %>
9+
id="avatar-photo"
10+
src="<%= @writing[:author_avatar_url] %>"
11+
/>
12+
<a href="<%= @writing[:author_url] %>" target="_blank"><%= @writing[:author] %></a><%= @writing[:released_at] %><%= @writing[:place] %>
1313
</span>
1414
</p>
1515
</header>

css/writings.css

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
--line-height-base: 1.5;
4848
--gap-base: 1.25rem;
49-
--gap-large: 3.125rem;
49+
--gap-large: 1.125rem;
5050
}
5151

5252
* {
@@ -55,7 +55,7 @@
5555

5656
body {
5757
font-family: var(--font-base);
58-
font-size: 1.125rem;
58+
font-size: 1.3rem;
5959
color: var(--color-text);
6060
background: var(--color-bg);
6161
line-height: 1.5;
@@ -136,7 +136,7 @@ pre {
136136
color: hsl(0, 0%, 40%);
137137
}
138138

139-
.post-meta img {
139+
.post-meta img, img.avatar {
140140
width: 1.5em;
141141
height: 1.5em;
142142
border-radius: 50%;
@@ -145,6 +145,11 @@ pre {
145145
box-shadow: 0 0 0 2px black;
146146
}
147147

148+
img.avatar {
149+
position: relative;
150+
top: 8px;
151+
}
152+
148153
.avatar-text-group {
149154
display: inline-flex;
150155
align-items: center;
@@ -231,3 +236,24 @@ pre {
231236
color: hsl(0, 0%, 40%);
232237
font-size: var(--font-size-meta);
233238
}
239+
240+
hr {
241+
display: flex;
242+
align-items: center;
243+
justify-content: center;
244+
border: 0;
245+
}
246+
hr:before {
247+
content: "";
248+
background: transparent url("../assets/img/divider.svg") no-repeat center;
249+
width: 10.4rem;
250+
height: 2.8rem;
251+
}
252+
253+
ul {
254+
list-style: none; /* hide default bullets */
255+
padding-left: 1.2em; /* space for the arrow */
256+
}
257+
ul li::marker {
258+
content: "→ ";
259+
}

generate.rb

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
require 'bundler/inline'
22

3-
gemfile do
3+
gemfile(true) do
4+
source 'https://rubygems.org'
5+
46
gem "json"
57
gem "erb"
68
gem "kramdown"
9+
gem "nokogiri"
710
end
811

912
require 'json'
1013
require 'erb'
1114
require 'date'
1215
require 'fileutils'
1316
require 'kramdown'
17+
require 'nokogiri'
1418

1519
# Load writings.json
1620
writings_data = JSON.parse(File.read('writings.json'))
@@ -27,6 +31,7 @@
2731
slug: w['slug'],
2832
published_at: w['published_at'],
2933
author: w['author'],
34+
author_url: w['author_url'],
3035
author_avatar_url: w['author_avatar_url'],
3136
place: w['place']
3237
}
@@ -59,6 +64,17 @@
5964
# Now inject post content into layout
6065
full_html = ERB.new(layout_template).result(binding)
6166

67+
# Outside links to new window
68+
full_html = Nokogiri::HTML.fragment(full_html).tap do |doc|
69+
doc.css('a').each do |node|
70+
node['href'] ||= '#'
71+
# Add attributes to external links only:
72+
if node['href'] =~ %r{\A(?:\w+:)?//}
73+
node['target'] = '_blank'
74+
node['rel'] = 'nofollow noopener'
75+
end
76+
end
77+
end.to_html
6278
# Write to file
6379
File.write("writings/#{w[:slug]}.html", full_html)
6480
puts "Generated writings/#{w[:slug]}.html"

md/popular-gems-1.md

Lines changed: 147 additions & 47 deletions
Large diffs are not rendered by default.

writings.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ <h1>Latest writings</h1>
6666
<ul class="post-list">
6767

6868
<li>
69-
<a href="writings/popular-gems-1.html">Helping Popular RubyGems Stay Healthy</a>
70-
<time datetime="2025-06-15">June 15, 2025</time>
69+
<a href="writings/2025-08-we-love-ruby-march-2025.html">We ❤️ Ruby — March 2025: Our First Deep Dive into the RubyGems.org Ecosystem</a>
70+
<time datetime="2025-08-11">August 11, 2025</time>
7171
</li>
7272

7373
</ul>

writings.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
[
22
{
33
"source": "md/popular-gems-1.md",
4-
"title": "Helping Popular RubyGems Stay Healthy",
5-
"published_at": "15.6.2025",
6-
"slug": "popular-gems-1",
4+
"title": "We ❤️ Ruby — March 2025: Our First Deep Dive into the RubyGems.org Ecosystem",
5+
"published_at": "11.8.2025",
6+
"slug": "2025-08-we-love-ruby-march-2025",
77
"author": "simi",
88
"author_avatar_url": "https://avatars.githubusercontent.com/u/193936?v=4",
9+
"author_url": "https://github.com/simi",
910
"place": "Praha, Žižkov"
1011
}
1112
]

writings/2025-08-we-love-ruby-march-2025.html

Lines changed: 296 additions & 0 deletions
Large diffs are not rendered by default.

writings/popular-gems-1.html

Lines changed: 0 additions & 190 deletions
This file was deleted.

0 commit comments

Comments
 (0)