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

fix(@galactiks/astro-integration): add assets and public symlinks to … #237

Merged
merged 1 commit into from
Oct 15, 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
5 changes: 5 additions & 0 deletions .changeset/wicked-lemons-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@galactiks/astro-integration': patch
---

fix assets symlinks
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions examples/contentlayer/content/articles/en/article.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ dateModified: 1970-01-01
datePublished: 1970-01-01
keywords:
- keyword
image:
name: Galactiks Icon
contentUrl: /assets/galactiks-icon.png
---

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Expand Down
3 changes: 3 additions & 0 deletions examples/contentlayer/content/articles/fr/article.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ dateModified: 1970-01-01
datePublished: 1970-01-01
keywords:
- mot-clé
image:
name: Galactiks Icon
contentUrl: /assets/galactiks-icon.png
---

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Expand Down
5 changes: 4 additions & 1 deletion packages/adapters/astro/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const symlinkDir = (targetPath: string, path: string) =>
.filter((filename) => !filename.startsWith('.'))
.map((filename) => [join(targetPath, filename), join(path, filename)])
.filter(([target]) => !existsSync(target))
.forEach(([target, path]) => symlinkSync(target, path));
.forEach(([target, path]) => symlinkSync(path, target));

const removeDirSymbolicLinks = (path: string) =>
readdirSync(path)
Expand Down Expand Up @@ -76,6 +76,9 @@ export default function createPlugin(_: GalactiksOptions): AstroIntegration {
},
});

removeDirSymbolicLinks(assetsPath);
removeDirSymbolicLinks(publicPath);

symlinkDir(assetsPath, galactiksConfigContentAssets);
symlinkDir(publicPath, galactiksConfigContentPublic);

Expand Down
Loading