Skip to content
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
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ GEM
public_suffix (>= 2.0.2, < 7.0)
amazing_print (1.8.1)
base64 (0.3.0)
benchmark (0.4.1)
benchmark (0.5.0)
bigdecimal (3.3.1)
bridgetown (2.0.3)
bridgetown-builder (= 2.0.3)
Expand Down Expand Up @@ -95,7 +95,7 @@ GEM
pp (>= 0.6.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
json (2.15.1)
json (2.15.2)
kramdown (2.5.1)
rexml (>= 3.3.9)
kramdown-parser-gfm (1.1.0)
Expand Down
2 changes: 1 addition & 1 deletion src/_components/navigation.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<%== nav_link title: "CSS (Beta)", href: "/css/" %>
<%== nav_link title: "JavaScript / TypeScript", href: "/js/" %>
<%== nav_link title: "Images", href: "/images/" %>
<%== nav_link title: "Static Files", href: "/static/" %>
<%== nav_link title: "Static Files", href: "/assets/" %>
<%== nav_link title: "Build a Pipeline", href: "/build-pipeline/" %>
</ul>
</li>
Expand Down
45 changes: 45 additions & 0 deletions src/assets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
layout: default
title: faucet-pipeline-assets
---

The configuration is an array of folders or single files you want to copy. Each
entry of the array is an object with two keys: `source` is the source folder,
and `target` is the target folder.

The resulting configuration might look something like this:

```js
export const assets = [{
source: "./images",
target: "./public/images"
}, {
source: "./fonts",
target: "./public/fonts"
}];
```

If you only want to copy _some_ of the files, you can select them using a
`filter` function. That function will be called for every file, with its path
relative to `source`. Only files passing the test implemented by that function –
i.e. those for which the function returns `true` – will be copied.

In this example, we only copy `.ttf` fonts and omit images from the `templates`
directory:

```js
export const assets = [{
source: "./fonts",
target: "./public/fonts",
filter: file => file.endsWith(".ttf")
}, {
source: "./images",
target: "./public/images",
filter: file => !file.startsWith("templates/")
}];
```

## faucet-pipeline-static

The previous version of faucet-pipeline-assets was called
`faucet-pipeline-static`. [You can find the documentation for it here](/static).
11 changes: 0 additions & 11 deletions src/css.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,6 @@ title: faucet-pipeline-css

faucet-pipeline-css offers bundling for files written in CSS.

**Note that this module is in beta**

To enable this **beta module** you need to add the following lines to your
faucet.config.js:

```js
export const plugins = [
require("faucet-pipeline-css")
];
```

The configuration is an array of bundles you want to create. Each entry of the
array is an object with two keys: `source` is the file that should be
compiled, and `target` is the file that should be created (the path is, of
Expand Down
2 changes: 1 addition & 1 deletion src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const js = [{
Fingerprinting arbitrary files, like fonts and images:

```javascript
export const static = [{
export const assets = [{
source: "./assets",
target: "./dist/assets"
}];
Expand Down
55 changes: 32 additions & 23 deletions src/static.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,25 @@ layout: default
title: faucet-pipeline-static
---

**Note:** This is a previous version of faucet-pipeline-assets that does not work
with projects using ESM. Please use [faucet-pipeline-assets](/assets) instead.

The configuration is an array of folders or single files you want to copy. Each
entry of the array is an object with two keys: `source` is the source folder,
and `target` is the target folder.

The resulting configuration might look something like this:

```js
export const static = [{
source: "./images",
target: "./public/images"
}, {
source: "./fonts",
target: "./public/fonts"
}];
module.exports = {
static: [{
source: "./images",
target: "./public/images"
}, {
source: "./fonts",
target: "./public/fonts"
}]
};
```

If you only want to copy _some_ of the files, you can select them using a
Expand All @@ -28,15 +33,17 @@ In this example, we only copy `.ttf` fonts and omit images from the `templates`
directory:

```js
export const static = [{
source: "./fonts",
target: "./public/fonts",
filter: file => file.endsWith(".ttf")
}, {
source: "./images",
target: "./public/images",
filter: file => !file.startsWith("templates/")
}];
module.exports = {
static: [{
source: "./fonts",
target: "./public/fonts",
filter: file => file.endsWith(".ttf")
}, {
source: "./images",
target: "./public/images",
filter: file => !file.startsWith("templates/")
}]
}
```

## Compact
Expand All @@ -57,11 +64,13 @@ If you prefer to compact your images on your own, you could for example use
JPGs:

```js
export const static = [{
source: "./src",
target: "./dist",
compact: {
jpg: require("imagemin-mozjpeg")({ quality: 80 })
}
}];
module.exports = {
static: [{
source: "./src",
target: "./dist",
compact: {
jpg: require("imagemin-mozjpeg")({ quality: 80 })
}
}]
};
```