Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update USWDS version #135

Merged
merged 7 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = function (config) {

// for #80 (update site favicon)
// copy files from `_img/favicon/` to `_site/`
config.addPassthroughCopy({ "_img/favicon/favicon.ico": "/assets/favicon.ico" });
config.addPassthroughCopy({ "_img/favicon/": "/assets/" });

// Copy USWDS init JS so we can load it in HEAD to prevent banner flashing
config.addPassthroughCopy({'./node_modules/@uswds/uswds/dist/js/uswds-init.js': 'assets/js/uswds-init.js'});
Expand Down
Binary file added _img/hero.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed _img/hero.png
Binary file not shown.
16 changes: 10 additions & 6 deletions config/buildAssets.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ async function createAssetPaths() {
}

const assetPath = path.join(__dirname, '../_site/assets');
const assetDirs = await fs.readdir(assetPath);
let assetDirs = await fs.readdir(assetPath, {withFileTypes: true})
assetDirs = assetDirs.filter(item => item.isDirectory())
.map(item => item.name);
const assetsFiles = await Promise.all(
assetDirs.map(async (dir) => {
const files = await fs.readdir(
Expand Down Expand Up @@ -41,11 +43,13 @@ esbuild
outdir: '_site/assets',
format: 'iife',
loader: {
'.png': 'dataurl',
'.svg': 'dataurl',
'.ttf': 'dataurl',
'.woff': 'dataurl',
'.woff2': 'dataurl',
'.png': 'file',
'.jpg': 'file',
'.jpeg': 'file',
'.svg': 'file',
'.ttf': 'file',
'.woff': 'file',
'.woff2': 'file',
},
minify: process.env.ELEVENTY_ENV === 'production',
sourcemap: process.env.ELEVENTY_ENV !== 'production',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"start-server-and-test": "^2.0.3"
},
"dependencies": {
"@uswds/uswds": "3.0.2",
"@uswds/uswds": "3.8.1",
"netlify-cms": "^2.10.187"
}
}
Loading