Skip to content

Commit

Permalink
fix broken icons urls
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarotero committed Nov 7, 2024
1 parent 87581ac commit 5f8cf69
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 54 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/),
and this project try to adheres to [Semantic Versioning](https://semver.org/).
Go to the `v1` branch to see the changelog of Lume 1.

## [2.4.1] - Unreleased
### Fixed
- `icons` plugin: The URL returned must start with `/`.

## [2.4.0] - 2024-11-06
### Added
- New plugin: `check_urls` to detect broken links [#675].
Expand Down Expand Up @@ -584,6 +588,7 @@ Go to the `v1` branch to see the changelog of Lume 1.
[#685]: https://github.com/lumeland/lume/issues/685
[#686]: https://github.com/lumeland/lume/issues/686

[2.4.1]: https://github.com/lumeland/lume/compare/v2.4.0...HEAD
[2.4.0]: https://github.com/lumeland/lume/compare/v2.3.3...v2.4.0
[2.3.3]: https://github.com/lumeland/lume/compare/v2.3.2...v2.3.3
[2.3.2]: https://github.com/lumeland/lume/compare/v2.3.1...v2.3.2
Expand Down
4 changes: 2 additions & 2 deletions plugins/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface Options {
}

export const defaults: Options = {
folder: "icons",
folder: "/icons",
catalogs,
};

Expand Down Expand Up @@ -57,7 +57,7 @@ function iconPath(
variant?: Variant,
): string {
const file = `${catalog.id}/${name}${variant ? `-${variant.id}` : ""}.svg`;
return posix.join(folder, file);
return posix.join("/", folder, file);
}

function getNameAndVariant(
Expand Down
104 changes: 52 additions & 52 deletions tests/__snapshots__/icons.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -607,32 +607,32 @@ snapshot[`icons plugin 3`] = `
<title>Document</title>
</head>
<body>
<img src="icons/phosphor/acorn-bold.svg">
<img src="icons/phosphor/acorn-bold.svg">
<img src="icons/phosphor/acorn-bold.svg">
<img src="icons/simpleicons/facebook.svg">
<img src="icons/heroicons/face-smile-outline.svg">
<img src="icons/material/10k-filled.svg">
<img src="icons/material-100/10k-outlined.svg">
<img src="icons/material-200/10k-outlined.svg">
<img src="icons/material-300/10k-outlined.svg">
<img src="icons/material-400/10k-outlined.svg">
<img src="icons/material-500/10k-outlined.svg">
<img src="icons/material-600/10k-outlined.svg">
<img src="icons/material-700/10k-outlined.svg">
<img src="icons/lucide/alarm-clock.svg">
<img src="icons/tabler/alien-filled.svg">
<img src="icons/mingcute/arrow/arrows_left_fill.svg">
<img src="icons/remix/arrows/arrow-up-fill.svg">
<img src="icons/bootstrap/0-circle.svg">
<img src="icons/myna/a-arrow-down-regular.svg">
<img src="icons/iconoir/check-regular.svg">
<img src="icons/sargam/add-duotone.svg">
<img src="icons/boxicons/sushi-regular.svg">
<img src="icons/ant/account-book-filled.svg">
<img src="icons/fluent/access_time_20-outlined.svg">
<img src="icons/octicons/comment-24.svg">
<img src="icons/openmoji/E046-color.svg">
<img src="/icons/phosphor/acorn-bold.svg">
<img src="/icons/phosphor/acorn-bold.svg">
<img src="/icons/phosphor/acorn-bold.svg">
<img src="/icons/simpleicons/facebook.svg">
<img src="/icons/heroicons/face-smile-outline.svg">
<img src="/icons/material/10k-filled.svg">
<img src="/icons/material-100/10k-outlined.svg">
<img src="/icons/material-200/10k-outlined.svg">
<img src="/icons/material-300/10k-outlined.svg">
<img src="/icons/material-400/10k-outlined.svg">
<img src="/icons/material-500/10k-outlined.svg">
<img src="/icons/material-600/10k-outlined.svg">
<img src="/icons/material-700/10k-outlined.svg">
<img src="/icons/lucide/alarm-clock.svg">
<img src="/icons/tabler/alien-filled.svg">
<img src="/icons/mingcute/arrow/arrows_left_fill.svg">
<img src="/icons/remix/arrows/arrow-up-fill.svg">
<img src="/icons/bootstrap/0-circle.svg">
<img src="/icons/myna/a-arrow-down-regular.svg">
<img src="/icons/iconoir/check-regular.svg">
<img src="/icons/sargam/add-duotone.svg">
<img src="/icons/boxicons/sushi-regular.svg">
<img src="/icons/ant/account-book-filled.svg">
<img src="/icons/fluent/access_time_20-outlined.svg">
<img src="/icons/octicons/comment-24.svg">
<img src="/icons/openmoji/E046-color.svg">
</body>
</html>',
data: {
Expand All @@ -645,32 +645,32 @@ snapshot[`icons plugin 3`] = `
<title>Document</title>
</head>
<body>
<img src="icons/phosphor/acorn-bold.svg">
<img src="icons/phosphor/acorn-bold.svg">
<img src="icons/phosphor/acorn-bold.svg">
<img src="icons/simpleicons/facebook.svg">
<img src="icons/heroicons/face-smile-outline.svg">
<img src="icons/material/10k-filled.svg">
<img src="icons/material-100/10k-outlined.svg">
<img src="icons/material-200/10k-outlined.svg">
<img src="icons/material-300/10k-outlined.svg">
<img src="icons/material-400/10k-outlined.svg">
<img src="icons/material-500/10k-outlined.svg">
<img src="icons/material-600/10k-outlined.svg">
<img src="icons/material-700/10k-outlined.svg">
<img src="icons/lucide/alarm-clock.svg">
<img src="icons/tabler/alien-filled.svg">
<img src="icons/mingcute/arrow/arrows_left_fill.svg">
<img src="icons/remix/arrows/arrow-up-fill.svg">
<img src="icons/bootstrap/0-circle.svg">
<img src="icons/myna/a-arrow-down-regular.svg">
<img src="icons/iconoir/check-regular.svg">
<img src="icons/sargam/add-duotone.svg">
<img src="icons/boxicons/sushi-regular.svg">
<img src="icons/ant/account-book-filled.svg">
<img src="icons/fluent/access_time_20-outlined.svg">
<img src="icons/octicons/comment-24.svg">
<img src="icons/openmoji/E046-color.svg">
<img src="/icons/phosphor/acorn-bold.svg">
<img src="/icons/phosphor/acorn-bold.svg">
<img src="/icons/phosphor/acorn-bold.svg">
<img src="/icons/simpleicons/facebook.svg">
<img src="/icons/heroicons/face-smile-outline.svg">
<img src="/icons/material/10k-filled.svg">
<img src="/icons/material-100/10k-outlined.svg">
<img src="/icons/material-200/10k-outlined.svg">
<img src="/icons/material-300/10k-outlined.svg">
<img src="/icons/material-400/10k-outlined.svg">
<img src="/icons/material-500/10k-outlined.svg">
<img src="/icons/material-600/10k-outlined.svg">
<img src="/icons/material-700/10k-outlined.svg">
<img src="/icons/lucide/alarm-clock.svg">
<img src="/icons/tabler/alien-filled.svg">
<img src="/icons/mingcute/arrow/arrows_left_fill.svg">
<img src="/icons/remix/arrows/arrow-up-fill.svg">
<img src="/icons/bootstrap/0-circle.svg">
<img src="/icons/myna/a-arrow-down-regular.svg">
<img src="/icons/iconoir/check-regular.svg">
<img src="/icons/sargam/add-duotone.svg">
<img src="/icons/boxicons/sushi-regular.svg">
<img src="/icons/ant/account-book-filled.svg">
<img src="/icons/fluent/access_time_20-outlined.svg">
<img src="/icons/octicons/comment-24.svg">
<img src="/icons/openmoji/E046-color.svg">
</body>
</html>',
content: '<!DOCTYPE html>
Expand Down

0 comments on commit 5f8cf69

Please sign in to comment.