rss + sitemap
This commit is contained in:
		
							parent
							
								
									ba9f243728
								
							
						
					
					
						commit
						4c904d88ab
					
				
					 11 changed files with 131 additions and 491 deletions
				
			
		| 
						 | 
				
			
			@ -1,22 +1,17 @@
 | 
			
		|||
import { resolveToRoot } from "../path"
 | 
			
		||||
import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
 | 
			
		||||
 | 
			
		||||
interface Options {
 | 
			
		||||
  title: string
 | 
			
		||||
function PageTitle({ fileData, cfg }: QuartzComponentProps) {
 | 
			
		||||
  const title = cfg?.pageTitle ?? "Untitled Quartz"
 | 
			
		||||
  const slug = fileData.slug!
 | 
			
		||||
  const baseDir = resolveToRoot(slug)
 | 
			
		||||
  return <h1 class="page-title"><a href={baseDir}>{title}</a></h1>
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export default ((opts?: Options) => {
 | 
			
		||||
  const title = opts?.title ?? "Untitled Quartz"
 | 
			
		||||
  function PageTitle({ fileData }: QuartzComponentProps) {
 | 
			
		||||
    const slug = fileData.slug!
 | 
			
		||||
    const baseDir = resolveToRoot(slug)
 | 
			
		||||
    return <h1 class="page-title"><a href={baseDir}>{title}</a></h1>
 | 
			
		||||
  }
 | 
			
		||||
  PageTitle.css = `
 | 
			
		||||
  .page-title {
 | 
			
		||||
    margin: 0;
 | 
			
		||||
  }
 | 
			
		||||
  `
 | 
			
		||||
PageTitle.css = `
 | 
			
		||||
.page-title {
 | 
			
		||||
  margin: 0;
 | 
			
		||||
}
 | 
			
		||||
`
 | 
			
		||||
 | 
			
		||||
  return PageTitle
 | 
			
		||||
}) satisfies QuartzComponentConstructor
 | 
			
		||||
export default (() => PageTitle) satisfies QuartzComponentConstructor
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue