Skip to content

Commit

Permalink
Use relative paths for assets
Browse files Browse the repository at this point in the history
Sites generated in subdirectories will properly reference external assets.
  • Loading branch information
pusewicz committed Feb 14, 2022
1 parent ab4424a commit e02989b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
- run: gem install statique:0.1.0
- run: gem install statique:0.1.1
- run: cd docs && statique build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
Expand Down
2 changes: 1 addition & 1 deletion lib/statique/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class App < Roda
if Statique.paths.assets.exist?
css_files = Statique.paths.assets.join("css").glob("*.{css,scss}")
js_files = Statique.paths.assets.join("js").glob("*.js")
plugin :assets, css: css_files.map { _1.basename.to_s }, js: js_files.map { _1.basename.to_s }, public: Statique.paths.destination, precompiled: Statique.paths.destination.join("assets/manifest.json")
plugin :assets, css: css_files.map { _1.basename.to_s }, js: js_files.map { _1.basename.to_s }, public: Statique.paths.destination, precompiled: Statique.paths.destination.join("assets/manifest.json"), relative_paths: true
plugin :assets_preloading

Statique.mode.build do
Expand Down
2 changes: 1 addition & 1 deletion lib/statique/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

class Statique
VERSION = "0.1.0"
VERSION = "0.1.1"
end

0 comments on commit e02989b

Please sign in to comment.