base path refactor, more docs
This commit is contained in:
		
							parent
							
								
									08f8e3b4a4
								
							
						
					
					
						commit
						906f91f8ee
					
				
					 37 changed files with 1861 additions and 156 deletions
				
			
		| 
						 | 
				
			
			@ -5,11 +5,11 @@ import path from "path"
 | 
			
		|||
 | 
			
		||||
import style from '../styles/listPage.scss'
 | 
			
		||||
import { PageList } from "../PageList"
 | 
			
		||||
import { clientSideSlug } from "../../path"
 | 
			
		||||
import { toServerSlug } from "../../path"
 | 
			
		||||
 | 
			
		||||
function FolderContent(props: QuartzComponentProps) {
 | 
			
		||||
  const { tree, fileData, allFiles } = props
 | 
			
		||||
  const folderSlug = clientSideSlug(fileData.slug!)
 | 
			
		||||
  const folderSlug = toServerSlug(fileData.slug!)
 | 
			
		||||
  const allPagesInFolder = allFiles.filter(file => {
 | 
			
		||||
    const fileSlug = file.slug ?? ""
 | 
			
		||||
    const prefixed = fileSlug.startsWith(folderSlug)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,14 +3,14 @@ import { Fragment, jsx, jsxs } from 'preact/jsx-runtime'
 | 
			
		|||
import { toJsxRuntime } from "hast-util-to-jsx-runtime"
 | 
			
		||||
import style from '../styles/listPage.scss'
 | 
			
		||||
import { PageList } from "../PageList"
 | 
			
		||||
import { clientSideSlug } from "../../path"
 | 
			
		||||
import { toServerSlug } from "../../path"
 | 
			
		||||
 | 
			
		||||
function TagContent(props: QuartzComponentProps) {
 | 
			
		||||
  const { tree, fileData, allFiles } = props
 | 
			
		||||
  const slug = fileData.slug
 | 
			
		||||
 | 
			
		||||
  if (slug?.startsWith("tags/")) {
 | 
			
		||||
    const tag = clientSideSlug(slug.slice("tags/".length))
 | 
			
		||||
    const tag = toServerSlug(slug.slice("tags/".length))
 | 
			
		||||
    const allPagesWithTag = allFiles.filter(file => (file.frontmatter?.tags ?? []).includes(tag))
 | 
			
		||||
    const listProps = {
 | 
			
		||||
      ...props,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue