sveltekit-data-plugin 1.4.1 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/plugin.js CHANGED
@@ -130,8 +130,12 @@
130
130
  var _a;
131
131
  if (/\.(md)$/.test(id)) {
132
132
  const base2 = path.resolve(((_a = opts.vite_config) == null ? void 0 : _a.root) ?? "", opts.base);
133
+ const relativeFolder = id.replace(`/${path.basename(id)}`, "");
133
134
  const d = fm(src);
134
- const attributes = await convert(opts, d.attributes, { base: base2 });
135
+ const attributes = await convert(opts, d.attributes, {
136
+ base: base2,
137
+ relative: relativeFolder
138
+ });
135
139
  return `
136
140
  ${Object.entries(attributes).map(([key, value]) => `export const ${key} = ${JSON.stringify(value)};`).join("\n")}
137
141
  export const body = ${JSON.stringify(d.body)};`;
package/dist/plugin.mjs CHANGED
@@ -129,8 +129,12 @@ function importDataPlugin(imagetools_plugin, { base = "./src/data" } = {}) {
129
129
  var _a;
130
130
  if (/\.(md)$/.test(id)) {
131
131
  const base2 = path.resolve(((_a = opts.vite_config) == null ? void 0 : _a.root) ?? "", opts.base);
132
+ const relativeFolder = id.replace(`/${path.basename(id)}`, "");
132
133
  const d = fm(src);
133
- const attributes = await convert(opts, d.attributes, { base: base2 });
134
+ const attributes = await convert(opts, d.attributes, {
135
+ base: base2,
136
+ relative: relativeFolder
137
+ });
134
138
  return `
135
139
  ${Object.entries(attributes).map(([key, value]) => `export const ${key} = ${JSON.stringify(value)};`).join("\n")}
136
140
  export const body = ${JSON.stringify(d.body)};`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sveltekit-data-plugin",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "author": {
5
5
  "name": "Jonny Thaw",
6
6
  "url": "https://jthaw.me"
@@ -29,5 +29,6 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "front-matter": "^4.0.2"
32
- }
32
+ },
33
+ "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
33
34
  }