@compiiile/compiiile 2.10.1 → 2.10.2

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.
@@ -2,13 +2,17 @@
2
2
  import WorkspaceLayout from "../layouts/WorkspaceLayout.astro"
3
3
  import ContentWrapper from "../components/ContentWrapper.vue"
4
4
  import {routeList} from "virtual:compiiile"
5
- import SlidesLayout from "../layouts/SlidesLayout.astro";
5
+ import SlidesLayout from "../layouts/SlidesLayout.astro"
6
+ import path from "node:path"
6
7
 
7
8
  export async function getStaticPaths() {
8
9
  const markdownFiles = await Astro.glob('@source/**/*.{md,mdx}')
9
10
 
10
11
  return routeList.map(route => {
11
- const md = markdownFiles.find(post => post.file === `${process.cwd()}/${route.fullPath}`)
12
+ const md = markdownFiles.find(post => {
13
+ // Using normalize for paths to work on both Windows (using `\`) and UNIX systems (using `/`)
14
+ return path.normalize(post.file) === path.normalize(`${process.cwd()}/${route.fullPath}`)
15
+ })
12
16
 
13
17
  let routePath = route.path
14
18
 
package/bin/config.js CHANGED
@@ -138,7 +138,8 @@ if (packageDir) {
138
138
  const resolve = (mod) => {
139
139
  const resolvedModule = requireg.resolve("vue")
140
140
  const packagePath = resolvePackagePath(mod, resolvedModule)
141
- return packagePath.slice(0, packagePath.lastIndexOf("/"))
141
+ // Check to work on both Windows (using `\`) and UNIX systems (using `/`)
142
+ return packagePath.slice(0, packagePath.lastIndexOf("/") < 0 ? packagePath.lastIndexOf("\\") : packagePath.lastIndexOf("/"))
142
143
  }
143
144
 
144
145
  const astroConfig = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@compiiile/compiiile",
3
3
  "private": false,
4
- "version": "2.10.1",
4
+ "version": "2.10.2",
5
5
  "description": "The most convenient way to render a folder containing markdown files. Previewing and searching markdown files has never been that easy.",
6
6
  "author": "AlbanCrepel <alban.crepel@gmail.com>",
7
7
  "license": "GPL-3.0-only",