Skip to content

Commit

Permalink
fix to copy uswds css files to /assets/css/ on build
Browse files Browse the repository at this point in the history
  • Loading branch information
claytonjbarnette committed Dec 9, 2024
1 parent 48bd1c1 commit 17d983e
Show file tree
Hide file tree
Showing 8 changed files with 179 additions and 314 deletions.
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ GEM
tzinfo-data (1.2023.3)
tzinfo (>= 1.0.0)
unicode-display_width (1.8.0)
wdm (0.1.1)
webrick (1.8.2)
yell (2.2.2)

Expand All @@ -114,6 +115,7 @@ DEPENDENCIES
jekyll-seo-tag
jekyll-sitemap
tzinfo-data
wdm (~> 0.1.0)
webrick

BUNDLED WITH
Expand Down
7 changes: 7 additions & 0 deletions _plugins/asset-helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ def self.process(site, payload)
FileUtils.cp_r('node_modules/@uswds/uswds/dist/js/', 'assets/', verbose: true)
FileUtils.cp_r('node_modules/@uswds/uswds/dist/img/', 'assets/', verbose: true)
FileUtils.cp_r('node_modules/@uswds/uswds/dist/fonts/', 'assets/', verbose: true)
# The below Ruby code copies individual files from the node package to the assets folder /assets/css/.
# The FileUtils.copy method copies individual uswds files to the site's existing /assets/css/ folder.
# This prevents overwriting the /assets/css/ folder that contains other files needed by the site
# to run and display properly. Do not change the function below to use the FileUtils.cp_r function(unless you know what you are doing).
FileUtils.copy('node_modules/@uswds/uswds/dist/css/uswds.css', 'assets/css/', verbose: true)
FileUtils.copy('node_modules/@uswds/uswds/dist/css/uswds.min.css', 'assets/css/', verbose: true)
FileUtils.copy('node_modules/@uswds/uswds/dist/css/uswds.min.css.map', 'assets/css/', verbose: true)
@processed = true
end
end
Expand Down
11 changes: 1 addition & 10 deletions assets/img/checkbox-indeterminate-alt.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 1 addition & 10 deletions assets/img/checkbox-indeterminate.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
429 changes: 152 additions & 277 deletions assets/js/uswds.js

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions assets/js/uswds.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/uswds.min.js.map

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 17d983e

Please sign in to comment.