Skip to content

Commit 0b8eb51

Browse files
authored
Merge pull request #56 from rubyuy/fix/jekyll-build
2 parents 98d1a2b + baee339 commit 0b8eb51

File tree

5 files changed

+25
-5
lines changed

5 files changed

+25
-5
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ jobs:
1818
uses: ruby/setup-ruby@v1
1919
with:
2020
bundler-cache: true
21-
env:
22-
JEKYLL_ENV: production
2321

2422
- name: Build the website
2523
run: bundle exec jekyll build
24+
env:
25+
JEKYLL_ENV: production
2626

2727
- name: Publish
2828
uses: cloudflare/pages-action@1

_includes/head.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
88
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300&display=swap" rel="stylesheet">
99
<link href="https://fonts.googleapis.com/css2?family=DM+Sans&family=Syncopate:wght@700&display=swap" rel="stylesheet">
10-
<link type="text/css" rel="stylesheet" href="/application.css"/>
10+
1111
<script async src="https://analytics.umami.is/script.js" data-website-id="209b35e2-b972-4bf5-8a88-09cedbc740f8" data-domains="ruby.uy"></script>
12-
<link rel="stylesheet" href="/assets/css/styles.css">
12+
<link rel="stylesheet" href="{{ "styles" | css }}">
1313
</head>

_plugins/filters.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
require 'digest'
2+
3+
module Filters
4+
def buster(filename)
5+
filepath = File.join(@context.registers[:site].dest, filename)
6+
7+
Digest::SHA256
8+
.file(filepath)
9+
.then { |sha| sha.hexdigest }
10+
.then { |digest| "#{filename}?#{digest}" }
11+
rescue Errno::ENOENT
12+
filename
13+
end
14+
15+
def css(filename)
16+
buster("/assets/css/#{filename}.css")
17+
end
18+
end
19+
20+
Liquid::Template.register_filter(Filters)
File renamed without changes.

assets/css/styles.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
---
22
---
3-
@import 'topbar';
3+
@import 'application', 'topbar';

0 commit comments

Comments
 (0)