Skip to content

Commit

Permalink
chore: code style
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Nov 5, 2024
1 parent c233f69 commit 4ebe301
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ async function processCollectionItems(nuxt: Nuxt, collections: ResolvedCollectio
}
collectionDump[collection.name] = []
// Collection table definition
collectionDump[collection.name].push(
collectionDump[collection.name]!.push(
...generateCollectionTableDefinition(collection, { drop: true }).split('\n'),
)

Expand Down Expand Up @@ -270,12 +270,12 @@ async function processCollectionItems(nuxt: Nuxt, collections: ResolvedCollectio
}))
}
// Sort by file name to ensure consistent order
list.sort((a, b) => a[0].localeCompare(String(b[0])))
collectionDump[collection.name].push(...list.map(([, sql]) => sql))
list.sort((a, b) => String(a[0]).localeCompare(String(b[0])))
collectionDump[collection.name]!.push(...list.map(([, sql]) => sql!))

collectionChecksum[collection.name] = hash(collectionDump[collection.name])

collectionDump[collection.name].push(
collectionDump[collection.name]!.push(
generateCollectionTableDefinition(infoCollection, { drop: false }),
`DELETE FROM ${infoCollection.tableName} WHERE _id = 'checksum_${collection.name}'`,
generateCollectionInsert(infoCollection, { _id: `checksum_${collection.name}`, version: collectionChecksum[collection.name] }),
Expand Down
7 changes: 3 additions & 4 deletions src/runtime/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,12 @@ export const useContentHead = (content: PageCollectionItemBase | null, { host, t
head.link = [...(head.link || [])]

// Great basic informations from the content
const title = head.title || content?.title
if (title) {
head.title = title
head.title = head.title || content?.title
if (head.title) {
if (import.meta.server && !head.meta?.some(m => m.property === 'og:title')) {
head.meta.push({
property: 'og:title',
content: title as string,
content: head.title as string,
})
}
}
Expand Down

0 comments on commit 4ebe301

Please sign in to comment.