fix relative path resolution in router and link crawling
This commit is contained in:
		@@ -4,7 +4,7 @@ import {
 | 
			
		||||
  ServerSlug,
 | 
			
		||||
  canonicalizeServer,
 | 
			
		||||
  resolveRelative,
 | 
			
		||||
} from "../../path"
 | 
			
		||||
} from "../../util/path"
 | 
			
		||||
import { QuartzEmitterPlugin } from "../types"
 | 
			
		||||
import path from "path"
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
import { FilePath, joinSegments, slugifyFilePath } from "../../path"
 | 
			
		||||
import { FilePath, joinSegments, slugifyFilePath } from "../../util/path"
 | 
			
		||||
import { QuartzEmitterPlugin } from "../types"
 | 
			
		||||
import path from "path"
 | 
			
		||||
import fs from "fs"
 | 
			
		||||
import { glob } from "../../glob"
 | 
			
		||||
import { glob } from "../../util/glob"
 | 
			
		||||
 | 
			
		||||
export const Assets: QuartzEmitterPlugin = () => {
 | 
			
		||||
  return {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
import { FilePath, ServerSlug } from "../../path"
 | 
			
		||||
import { FilePath, ServerSlug } from "../../util/path"
 | 
			
		||||
import { QuartzEmitterPlugin } from "../types"
 | 
			
		||||
 | 
			
		||||
// @ts-ignore
 | 
			
		||||
@@ -9,10 +9,10 @@ import plausibleScript from "../../components/scripts/plausible.inline"
 | 
			
		||||
import popoverScript from "../../components/scripts/popover.inline"
 | 
			
		||||
import styles from "../../styles/base.scss"
 | 
			
		||||
import popoverStyle from "../../components/styles/popover.scss"
 | 
			
		||||
import { BuildCtx } from "../../ctx"
 | 
			
		||||
import { StaticResources } from "../../resources"
 | 
			
		||||
import { BuildCtx } from "../../util/ctx"
 | 
			
		||||
import { StaticResources } from "../../util/resources"
 | 
			
		||||
import { QuartzComponent } from "../../components/types"
 | 
			
		||||
import { googleFontHref, joinStyles } from "../../theme"
 | 
			
		||||
import { googleFontHref, joinStyles } from "../../util/theme"
 | 
			
		||||
import { Features, transform } from "lightningcss"
 | 
			
		||||
 | 
			
		||||
type ComponentResources = {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,11 @@
 | 
			
		||||
import { GlobalConfiguration } from "../../cfg"
 | 
			
		||||
import { CanonicalSlug, ClientSlug, FilePath, ServerSlug, canonicalizeServer } from "../../path"
 | 
			
		||||
import {
 | 
			
		||||
  CanonicalSlug,
 | 
			
		||||
  ClientSlug,
 | 
			
		||||
  FilePath,
 | 
			
		||||
  ServerSlug,
 | 
			
		||||
  canonicalizeServer,
 | 
			
		||||
} from "../../util/path"
 | 
			
		||||
import { QuartzEmitterPlugin } from "../types"
 | 
			
		||||
import path from "path"
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,7 @@ import HeaderConstructor from "../../components/Header"
 | 
			
		||||
import BodyConstructor from "../../components/Body"
 | 
			
		||||
import { pageResources, renderPage } from "../../components/renderPage"
 | 
			
		||||
import { FullPageLayout } from "../../cfg"
 | 
			
		||||
import { FilePath, canonicalizeServer } from "../../path"
 | 
			
		||||
import { FilePath, canonicalizeServer } from "../../util/path"
 | 
			
		||||
import { defaultContentPageLayout, sharedPageComponents } from "../../../quartz.layout"
 | 
			
		||||
import { Content } from "../../components"
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -6,7 +6,13 @@ import { pageResources, renderPage } from "../../components/renderPage"
 | 
			
		||||
import { ProcessedContent, defaultProcessedContent } from "../vfile"
 | 
			
		||||
import { FullPageLayout } from "../../cfg"
 | 
			
		||||
import path from "path"
 | 
			
		||||
import { CanonicalSlug, FilePath, ServerSlug, canonicalizeServer, joinSegments } from "../../path"
 | 
			
		||||
import {
 | 
			
		||||
  CanonicalSlug,
 | 
			
		||||
  FilePath,
 | 
			
		||||
  ServerSlug,
 | 
			
		||||
  canonicalizeServer,
 | 
			
		||||
  joinSegments,
 | 
			
		||||
} from "../../util/path"
 | 
			
		||||
import { defaultListPageLayout, sharedPageComponents } from "../../../quartz.layout"
 | 
			
		||||
import { FolderContent } from "../../components"
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
import { FilePath, QUARTZ, joinSegments } from "../../path"
 | 
			
		||||
import { FilePath, QUARTZ, joinSegments } from "../../util/path"
 | 
			
		||||
import { QuartzEmitterPlugin } from "../types"
 | 
			
		||||
import fs from "fs"
 | 
			
		||||
import { glob } from "../../glob"
 | 
			
		||||
import { glob } from "../../util/glob"
 | 
			
		||||
 | 
			
		||||
export const Static: QuartzEmitterPlugin = () => ({
 | 
			
		||||
  name: "Static",
 | 
			
		||||
 
 | 
			
		||||
@@ -11,7 +11,7 @@ import {
 | 
			
		||||
  ServerSlug,
 | 
			
		||||
  getAllSegmentPrefixes,
 | 
			
		||||
  joinSegments,
 | 
			
		||||
} from "../../path"
 | 
			
		||||
} from "../../util/path"
 | 
			
		||||
import { defaultListPageLayout, sharedPageComponents } from "../../../quartz.layout"
 | 
			
		||||
import { TagContent } from "../../components"
 | 
			
		||||
 | 
			
		||||
@@ -41,7 +41,7 @@ export const TagPage: QuartzEmitterPlugin<FullPageLayout> = (userOpts) => {
 | 
			
		||||
        allFiles.flatMap((data) => data.frontmatter?.tags ?? []).flatMap(getAllSegmentPrefixes),
 | 
			
		||||
      )
 | 
			
		||||
      // add base tag
 | 
			
		||||
      tags.add("")
 | 
			
		||||
      tags.add("index")
 | 
			
		||||
 | 
			
		||||
      const tagDescriptions: Record<string, ProcessedContent> = Object.fromEntries(
 | 
			
		||||
        [...tags].map((tag) => {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user