Skip to content

Commit 293073c

Browse files
Merge pull request #5 from harrison-broadbent/v1.4
v1.4 — RSS feeds & updates
2 parents e1d8838 + ac99eb5 commit 293073c

File tree

10 files changed

+194
-446
lines changed

10 files changed

+194
-446
lines changed

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.3.0
1+
3.2.2

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ruby 3.2.2

Gemfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ source "https://rubygems.org"
22

33
# Standard Middleman Gems:
44
#
5-
gem "middleman", "~> 4.5"
5+
gem "middleman", "~> 4.6"
66
gem "middleman-autoprefixer", "~> 3.0"
77
gem "middleman-blog", "~> 4.0.3" # blog support
88
gem "middleman-livereload" # live dev reloading
@@ -17,6 +17,6 @@ gem "nokogiri" # blog post summaries
1717
# Misc gems (from Middleman):
1818
#
1919
gem "builder" # supports .builder.xml for sitemap
20-
gem "terser", "~> 1.1" # minifies .js files
21-
gem "tzinfo-data", platforms: [:mswin, :mingw, :jruby, :x64_mingw]
20+
gem "terser", "~> 1.2" # minifies .js files
21+
gem "tzinfo-data"
2222
gem "wdm", "~> 0.1", platforms: [:mswin, :mingw, :x64_mingw]

Gemfile.lock

Lines changed: 91 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,110 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
activesupport (7.0.8.4)
5-
concurrent-ruby (~> 1.0, >= 1.0.2)
4+
activesupport (8.0.2)
5+
base64
6+
benchmark (>= 0.3)
7+
bigdecimal
8+
concurrent-ruby (~> 1.0, >= 1.3.1)
9+
connection_pool (>= 2.2.5)
10+
drb
611
i18n (>= 1.6, < 2)
12+
logger (>= 1.4.2)
713
minitest (>= 5.1)
8-
tzinfo (~> 2.0)
14+
securerandom (>= 0.3)
15+
tzinfo (~> 2.0, >= 2.0.5)
16+
uri (>= 0.13.1)
917
addressable (2.8.7)
1018
public_suffix (>= 2.0.2, < 7.0)
11-
autoprefixer-rails (10.4.19.0)
19+
autoprefixer-rails (10.4.21.0)
1220
execjs (~> 2)
13-
backports (3.25.0)
21+
base64 (0.2.0)
22+
benchmark (0.4.0)
23+
bigdecimal (3.1.9)
1424
builder (3.3.0)
1525
coffee-script (2.4.1)
1626
coffee-script-source
1727
execjs
1828
coffee-script-source (1.12.2)
19-
concurrent-ruby (1.3.4)
20-
contracts (0.16.1)
21-
dotenv (3.1.2)
29+
concurrent-ruby (1.3.5)
30+
connection_pool (2.5.1)
31+
contracts (0.17.2)
32+
dotenv (3.1.8)
33+
drb (2.2.1)
2234
em-websocket (0.5.3)
2335
eventmachine (>= 0.12.9)
2436
http_parser.rb (~> 0)
25-
erubis (2.7.0)
37+
erubi (1.13.1)
2638
eventmachine (1.2.7)
27-
execjs (2.9.1)
39+
execjs (2.10.0)
2840
fast_blank (1.0.1)
29-
fastimage (2.3.1)
30-
ffi (1.17.0)
31-
ffi (1.17.0-arm64-darwin)
41+
fastimage (2.4.0)
42+
ffi (1.17.2-aarch64-linux-gnu)
43+
ffi (1.17.2-aarch64-linux-musl)
44+
ffi (1.17.2-arm-linux-gnu)
45+
ffi (1.17.2-arm-linux-musl)
46+
ffi (1.17.2-arm64-darwin)
47+
ffi (1.17.2-x86_64-darwin)
48+
ffi (1.17.2-x86_64-linux-gnu)
49+
ffi (1.17.2-x86_64-linux-musl)
3250
haml (6.3.0)
3351
temple (>= 0.8.2)
3452
thor
3553
tilt
3654
hamster (3.0.0)
3755
concurrent-ruby (~> 1.0)
38-
hashie (3.6.0)
56+
hashie (5.0.0)
3957
http_parser.rb (0.8.0)
40-
i18n (1.6.0)
58+
i18n (1.14.7)
4159
concurrent-ruby (~> 1.0)
42-
kramdown (2.4.0)
43-
rexml
60+
kramdown (2.5.1)
61+
rexml (>= 3.3.9)
4462
kramdown-parser-gfm (1.1.0)
4563
kramdown (~> 2.0)
4664
listen (3.9.0)
4765
rb-fsevent (~> 0.10, >= 0.10.3)
4866
rb-inotify (~> 0.9, >= 0.9.10)
67+
logger (1.7.0)
4968
memoist (0.16.2)
50-
middleman (4.5.1)
51-
coffee-script (~> 2.2)
52-
haml (>= 4.0.5)
53-
kramdown (>= 2.3.0)
54-
middleman-cli (= 4.5.1)
55-
middleman-core (= 4.5.1)
69+
middleman (4.6.0)
70+
middleman-cli (= 4.6.0)
71+
middleman-core (= 4.6.0)
5672
middleman-autoprefixer (3.0.0)
5773
autoprefixer-rails (~> 10.0)
5874
middleman-core (>= 4.0.0)
5975
middleman-blog (4.0.3)
6076
addressable (~> 2.3)
6177
middleman-core (>= 4.0.0)
6278
tzinfo (>= 0.3.0)
63-
middleman-cli (4.5.1)
79+
middleman-cli (4.6.0)
6480
thor (>= 0.17.0, < 1.3.0)
65-
middleman-core (4.5.1)
66-
activesupport (>= 6.1, < 7.1)
81+
middleman-core (4.6.0)
82+
activesupport (>= 6.1)
6783
addressable (~> 2.4)
68-
backports (~> 3.6)
6984
bundler (~> 2.0)
70-
contracts (~> 0.13, < 0.17)
85+
coffee-script (~> 2.2)
86+
contracts
7187
dotenv
72-
erubis
88+
erubi
7389
execjs (~> 2.0)
7490
fast_blank
7591
fastimage (~> 2.0)
92+
haml (>= 4.0.5)
7693
hamster (~> 3.0)
77-
hashie (~> 3.4)
78-
i18n (~> 1.6.0)
94+
hashie (>= 3.4, < 6.0)
95+
i18n (>= 1.6, < 1.15)
96+
kramdown (~> 2.4)
7997
listen (~> 3.0)
8098
memoist (~> 0.14)
8199
padrino-helpers (~> 0.15.0)
82100
parallel
83-
rack (>= 1.4.5, < 3)
101+
rack (>= 3)
102+
rackup
84103
sassc (~> 2.0)
85104
servolux
86-
tilt (~> 2.0.9)
105+
tilt (~> 2.2)
87106
toml
88-
uglifier (~> 3.0)
107+
uglifier (>= 3, < 5)
89108
webrick
90109
middleman-livereload (3.4.7)
91110
em-websocket (~> 0.5.1)
@@ -94,63 +113,83 @@ GEM
94113
middleman-syntax (3.4.0)
95114
middleman-core (>= 3.2)
96115
rouge (~> 3.2)
97-
mini_portile2 (2.8.7)
98-
minitest (5.25.1)
99-
nokogiri (1.16.7)
100-
mini_portile2 (~> 2.8.2)
116+
minitest (5.25.5)
117+
nokogiri (1.18.7-aarch64-linux-gnu)
118+
racc (~> 1.4)
119+
nokogiri (1.18.7-aarch64-linux-musl)
120+
racc (~> 1.4)
121+
nokogiri (1.18.7-arm-linux-gnu)
122+
racc (~> 1.4)
123+
nokogiri (1.18.7-arm-linux-musl)
124+
racc (~> 1.4)
125+
nokogiri (1.18.7-arm64-darwin)
126+
racc (~> 1.4)
127+
nokogiri (1.18.7-x86_64-darwin)
128+
racc (~> 1.4)
129+
nokogiri (1.18.7-x86_64-linux-gnu)
101130
racc (~> 1.4)
102-
nokogiri (1.16.7-arm64-darwin)
131+
nokogiri (1.18.7-x86_64-linux-musl)
103132
racc (~> 1.4)
104133
padrino-helpers (0.15.3)
105134
i18n (>= 0.6.7, < 2)
106135
padrino-support (= 0.15.3)
107136
tilt (>= 1.4.1, < 3)
108137
padrino-support (0.15.3)
109-
parallel (1.26.3)
138+
parallel (1.27.0)
110139
parslet (2.0.0)
111140
public_suffix (6.0.1)
112141
racc (1.8.1)
113-
rack (2.2.9)
142+
rack (3.1.13)
114143
rack-livereload (0.3.17)
115144
rack
145+
rackup (2.2.1)
146+
rack (>= 3)
116147
rb-fsevent (0.11.2)
117148
rb-inotify (0.11.1)
118149
ffi (~> 1.0)
119-
rexml (3.3.5)
120-
strscan
150+
rexml (3.4.1)
121151
rouge (3.30.0)
122152
sassc (2.4.0)
123153
ffi (~> 1.9)
154+
securerandom (0.4.1)
124155
servolux (0.13.0)
125-
strscan (3.1.0)
126156
temple (0.10.3)
127-
terser (1.2.3)
157+
terser (1.2.5)
128158
execjs (>= 0.3.0, < 3)
129159
thor (1.2.2)
130-
tilt (2.0.11)
160+
tilt (2.6.0)
131161
toml (0.3.0)
132162
parslet (>= 1.8.0, < 3.0.0)
133163
tzinfo (2.0.6)
134164
concurrent-ruby (~> 1.0)
135-
uglifier (3.2.0)
165+
tzinfo-data (1.2025.2)
166+
tzinfo (>= 1.0.0)
167+
uglifier (4.2.1)
136168
execjs (>= 0.3.0, < 3)
137-
webrick (1.8.1)
169+
uri (1.0.3)
170+
webrick (1.9.1)
138171

139172
PLATFORMS
140-
arm64-darwin-22
141-
ruby
173+
aarch64-linux-gnu
174+
aarch64-linux-musl
175+
arm-linux-gnu
176+
arm-linux-musl
177+
arm64-darwin
178+
x86_64-darwin
179+
x86_64-linux-gnu
180+
x86_64-linux-musl
142181

143182
DEPENDENCIES
144183
builder
145184
kramdown
146185
kramdown-parser-gfm
147-
middleman (~> 4.5)
186+
middleman (~> 4.6)
148187
middleman-autoprefixer (~> 3.0)
149188
middleman-blog (~> 4.0.3)
150189
middleman-livereload
151190
middleman-syntax (~> 3.4.0)
152191
nokogiri
153-
terser (~> 1.1)
192+
terser (~> 1.2)
154193
tzinfo-data
155194
wdm (~> 0.1)
156195

README.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Ruby Middleman Tailwind Starter Blog
1+
# Ruby, Middleman & Tailwind Starter Blog template
2+
3+
Live demo: [Ruby, Middleman & Tailwind starter blog](https://ruby-middleman-tailwind-starter-blog.pages.dev)
24

35
A Middleman blog template configured with TailwindCSS, markdown parsing, code highlighting, a sitemap.xml and more. It perfect for lightweight blogging or a personal website. Ruby knowledge is helpful, but not necessary.
46

@@ -15,8 +17,6 @@ A Middleman blog template configured with TailwindCSS, markdown parsing, code hi
1517
- Perfect 100/100 PageSpeed score (near perfect for mobile)
1618
- Github Action for image compression (see `compress_images.yml`).
1719

18-
Visit the [live template demo](https://ruby-middleman-tailwind-starter-bl-harrison-broadbents-projects.vercel.app/) for a preview of how it looks (although of course, you can customize it yourself).
19-
2020
I've used [Middleman](https://middlemanapp.com/) for years to build my [personal website](https://harrisonbroadbent.com/about), and this template consolidates everything I've learned.
2121

2222
## Getting started
@@ -26,19 +26,22 @@ Before you get started, make sure you've got Ruby installed. Currently, this tem
2626
Clone this template, then install the required packages and start the server:
2727

2828
```sh
29-
# install packages
30-
bundle # Ruby
31-
npm install # JS (only for TailwindCSS)
29+
# install packages (ruby packages + Tailwind CSS javascript package)
30+
bundle
31+
npm install
3232

3333
# start dev server
3434
bin/dev
3535
```
3636

3737
## Deploying
3838

39-
This template is easy to deploy. Any static site host should work; I've included the Netlify + Vercel "Deploy" buttons below.
39+
This template is easy to deploy. Any static site host should work; I've included the Cloudflare, Netlify & Vercel "Deploy" buttons below.
40+
41+
| | |
42+
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
43+
| Cloudflare | [![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/harrison-broadbent/ruby-middleman-tailwind-starter-blog) |
44+
| Netlify | [![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/harrison-broadbent/ruby-middleman-tailwind-starter-blog) |
45+
| Vercel | [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fharrison-broadbent%2Fruby-middleman-tailwind-starter-blog) |
4046

41-
| | |
42-
| ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
43-
| Netlify | [![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/harrison-broadbent/ruby-middleman-tailwind-starter-blog) |
44-
| Vercel | [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fharrison-broadbent%2Fruby-middleman-tailwind-starter-blog) |
47+
> Note: These days I use Cloudflare for all my hosting and I can heartily recommend them. I [switched from Cloudflare to Netlify](https://harrisonbroadbent.com/blog/goodbye-netlify-hello-cloudflare/) a while ago and haven't looked back.

config.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# Template config
22
#
3-
set :site_url, "https://ruby-middleman-tailwind-starter-blog.netlify.app/" # for sitemap.xml.builder
4-
set :site_title, "Ruby+Middleman+Tailwind Starter Kit" # site title for <title> meta tag
3+
set :site_url, "https://ruby-middleman-tailwind-starter-blog.pages.dev" # for sitemap.xml.builder
4+
set :site_title, "Ruby, Middleman & Tailwind Starter Kit" # site title for <title> meta tag
55
set :trailing_slash, false # turn site.com/home/ -> site.com/home
66

77
# Extensions
88
#
99
activate :livereload # live-reloading in dev
1010
activate :directory_indexes # for pretty URLs
11+
activate :asset_hash # hash assets for better caching
1112
activate :autoprefixer do |prefix|
1213
prefix.browsers = "last 2 versions"
1314
end

source/blog/other_template_features.html.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ server: middleman server
2626
css: npx @tailwindcss/cli -i ./source/stylesheets/main.css -o ./source/stylesheets/tailwind.css --watch
2727
```
2828

29-
## TailwindCSS
29+
## Tailwind CSS v4.1
3030

3131
[TailwindCSS](https://tailwindcss.com/) is included in this template natively. You'll need `nodejs` / `npx` available to install and run it locally.
3232

33-
Within `tailwind.config.js` I've configured TailwindCSS with the correct `content:` paths to parse the files in this template. I've also included the `typography` plugin for rendering markdown (once parsed into HTML via kramdown) using the `prose` class in the `markdown_layout.erb`.
33+
With Tailwind v4, we simply run Tailwind from the command line in the `Procfile.dev`, and it automatically rebuilds the stylesheet when anything changes.
34+
35+
Tailwind CSS includes the `typography` plugin for rendering markdown (once parsed into HTML via kramdown) using the `prose` class in the `markdown_layout.erb`.
3436

3537
```erb
3638
<%# layouts/markdown_layout.erb %>
@@ -59,7 +61,7 @@ Everything should just work. When you save a file locally, the Middleman develop
5961

6062
The `directory_indexes` extension is used for [pretty URLs](https://middlemanapp.com/advanced/pretty-urls/). With this activated, the URL paths Middleman generates look like `/blog` and `/about`, rather than `/blog.html` and `/about.html`.
6163

62-
## Sitemaps
64+
## Sitemap & RSS feed
6365

6466
I've included a sitemap at `source/sitemap.xml.builder`. This uses the `builder` gem to automatically generate a sitemap for your site:
6567

@@ -76,3 +78,23 @@ end
7678
```
7779

7880
Make sure you update `site_url` to match the production URL of your website. You can preview your sitemap at `localhost:4567/sitemap.xml`.
81+
82+
A similar file exists for your RSS feed, located in `source/feed.xml.builder`. It builds a valid RSS feed and renders it at `/feed.xml`.
83+
84+
```ruby
85+
86+
posts = blog.articles.sort_by(&:date).reverse
87+
88+
xml.instruct! :xml, version: "1.0", encoding: "utf-8"
89+
xml.rss version: "2.0" do
90+
xml.channel do
91+
...
92+
93+
posts.each do |post|
94+
...
95+
end
96+
end
97+
end
98+
```
99+
100+
> If you interested in the `builder` gem and creating this RSS feed, I've written more about it here — [Add an RSS feed to your Middleman blog (harrisonbroadbent.com)](https://harrisonbroadbent.com/blog/middleman-rss-feed/)

0 commit comments

Comments
 (0)