mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-19 19:04:06 -06:00
running prettier
This commit is contained in:
parent
d446ee1f7d
commit
74cda8b1ff
@ -75,7 +75,9 @@ export const ContentPage: QuartzEmitterPlugin<Partial<FullPageLayout>> = (userOp
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
async *emit(ctx, content, resources) {
|
async *emit(ctx, content, resources) {
|
||||||
const allFiles = content.map((c) => c[1].data).filter(f => !isUnlisted(f, ctx.cfg.configuration))
|
const allFiles = content
|
||||||
|
.map((c) => c[1].data)
|
||||||
|
.filter((f) => !isUnlisted(f, ctx.cfg.configuration))
|
||||||
let containsIndex = false
|
let containsIndex = false
|
||||||
|
|
||||||
for (const [tree, file] of content) {
|
for (const [tree, file] of content) {
|
||||||
@ -99,7 +101,9 @@ export const ContentPage: QuartzEmitterPlugin<Partial<FullPageLayout>> = (userOp
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async *partialEmit(ctx, content, resources, changeEvents) {
|
async *partialEmit(ctx, content, resources, changeEvents) {
|
||||||
const allFiles = content.map((c) => c[1].data).filter(f => !isUnlisted(f, ctx.cfg.configuration))
|
const allFiles = content
|
||||||
|
.map((c) => c[1].data)
|
||||||
|
.filter((f) => !isUnlisted(f, ctx.cfg.configuration))
|
||||||
|
|
||||||
// find all slugs that changed or were added
|
// find all slugs that changed or were added
|
||||||
const changedSlugs = new Set<string>()
|
const changedSlugs = new Set<string>()
|
||||||
|
|||||||
@ -130,7 +130,9 @@ export const FolderPage: QuartzEmitterPlugin<Partial<FolderPageOptions>> = (user
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
async *emit(ctx, content, resources) {
|
async *emit(ctx, content, resources) {
|
||||||
const allFiles = content.map((c) => c[1].data).filter(f => !isUnlisted(f, ctx.cfg.configuration))
|
const allFiles = content
|
||||||
|
.map((c) => c[1].data)
|
||||||
|
.filter((f) => !isUnlisted(f, ctx.cfg.configuration))
|
||||||
const cfg = ctx.cfg.configuration
|
const cfg = ctx.cfg.configuration
|
||||||
|
|
||||||
const folders: Set<SimpleSlug> = new Set(
|
const folders: Set<SimpleSlug> = new Set(
|
||||||
@ -147,7 +149,9 @@ export const FolderPage: QuartzEmitterPlugin<Partial<FolderPageOptions>> = (user
|
|||||||
yield* processFolderInfo(ctx, folderInfo, allFiles, opts, resources)
|
yield* processFolderInfo(ctx, folderInfo, allFiles, opts, resources)
|
||||||
},
|
},
|
||||||
async *partialEmit(ctx, content, resources, changeEvents) {
|
async *partialEmit(ctx, content, resources, changeEvents) {
|
||||||
const allFiles = content.map((c) => c[1].data).filter(f => !isUnlisted(f, ctx.cfg.configuration))
|
const allFiles = content
|
||||||
|
.map((c) => c[1].data)
|
||||||
|
.filter((f) => !isUnlisted(f, ctx.cfg.configuration))
|
||||||
const cfg = ctx.cfg.configuration
|
const cfg = ctx.cfg.configuration
|
||||||
|
|
||||||
// Find all folders that need to be updated based on changed files
|
// Find all folders that need to be updated based on changed files
|
||||||
|
|||||||
@ -123,7 +123,9 @@ export const TagPage: QuartzEmitterPlugin<Partial<TagPageOptions>> = (userOpts)
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
async *emit(ctx, content, resources) {
|
async *emit(ctx, content, resources) {
|
||||||
const allFiles = content.map((c) => c[1].data).filter(f => !isUnlisted(f, ctx.cfg.configuration))
|
const allFiles = content
|
||||||
|
.map((c) => c[1].data)
|
||||||
|
.filter((f) => !isUnlisted(f, ctx.cfg.configuration))
|
||||||
const cfg = ctx.cfg.configuration
|
const cfg = ctx.cfg.configuration
|
||||||
const [tags, tagDescriptions] = computeTagInfo(allFiles, content, cfg.locale)
|
const [tags, tagDescriptions] = computeTagInfo(allFiles, content, cfg.locale)
|
||||||
|
|
||||||
@ -132,7 +134,9 @@ export const TagPage: QuartzEmitterPlugin<Partial<TagPageOptions>> = (userOpts)
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async *partialEmit(ctx, content, resources, changeEvents) {
|
async *partialEmit(ctx, content, resources, changeEvents) {
|
||||||
const allFiles = content.map((c) => c[1].data).filter(f => !isUnlisted(f, ctx.cfg.configuration))
|
const allFiles = content
|
||||||
|
.map((c) => c[1].data)
|
||||||
|
.filter((f) => !isUnlisted(f, ctx.cfg.configuration))
|
||||||
const cfg = ctx.cfg.configuration
|
const cfg = ctx.cfg.configuration
|
||||||
|
|
||||||
// Find all tags that need to be updated based on changed files
|
// Find all tags that need to be updated based on changed files
|
||||||
|
|||||||
@ -5,11 +5,10 @@ import { GlobalConfiguration } from "../../cfg"
|
|||||||
export function isUnlisted(
|
export function isUnlisted(
|
||||||
fileData: QuartzPluginData,
|
fileData: QuartzPluginData,
|
||||||
cfg: GlobalConfiguration,
|
cfg: GlobalConfiguration,
|
||||||
unlistedPatterns?: string[]
|
unlistedPatterns?: string[],
|
||||||
): boolean {
|
): boolean {
|
||||||
const unlistedFlag: boolean =
|
const unlistedFlag: boolean =
|
||||||
fileData?.frontmatter?.unlisted === true ||
|
fileData?.frontmatter?.unlisted === true || fileData?.frontmatter?.unlisted === "true"
|
||||||
fileData?.frontmatter?.unlisted === "true"
|
|
||||||
|
|
||||||
if (unlistedFlag) return true
|
if (unlistedFlag) return true
|
||||||
|
|
||||||
|
|||||||
@ -34,7 +34,7 @@ export interface BuildCtx {
|
|||||||
|
|
||||||
export function trieFromAllFiles(
|
export function trieFromAllFiles(
|
||||||
allFiles: QuartzPluginData[],
|
allFiles: QuartzPluginData[],
|
||||||
cfg?: QuartzConfig
|
cfg?: QuartzConfig,
|
||||||
): FileTrieNode<BuildTimeTrieData> {
|
): FileTrieNode<BuildTimeTrieData> {
|
||||||
const trie = new FileTrieNode<BuildTimeTrieData>([])
|
const trie = new FileTrieNode<BuildTimeTrieData>([])
|
||||||
allFiles.forEach((file) => {
|
allFiles.forEach((file) => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user