diff --git a/ci-scripts/publish-post-update.js b/ci-scripts/publish-post-update.js index 852ec7c..f7e2cfa 100644 --- a/ci-scripts/publish-post-update.js +++ b/ci-scripts/publish-post-update.js @@ -49,10 +49,10 @@ function determineEventTypes(filePath) { // Publish event to Pub/Sub async function publishEvent(slug, frontmatter, eventType) { const post = { - title: frontmatter.title || null, - tags: frontmatter.tags || [], - created_at: frontmatter.date || null, - description: frontmatter.description || null, + title: frontmatter ? frontmatter.title : "", + tags: frontmatter ? frontmatter.tags : [""], + created_at: frontmatter ? frontmatter.date : "", + description: frontmatter ? frontmatter.description : "", slug, }; @@ -81,11 +81,11 @@ async function publishEvent(slug, frontmatter, eventType) { console.log("Changed files:", changedFiles); for (const file of changedFiles) { + const slug = path.basename(file, '.mdx'); if (!fs.existsSync(file)) { - console.log(`File does not exist: ${file}`); + await publishEvent(slug, null, "POST_DELETED"); continue; } - const slug = path.basename(file, '.mdx'); const frontmatter = extractFrontmatter(file); const eventTypes = determineEventTypes(file); diff --git a/content/disappearing-props.mdx b/content/disappearing-props.mdx deleted file mode 100644 index 6aebee2..0000000 --- a/content/disappearing-props.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: "The Mysterious Case of the Disappearing Props" -description: Join us on a humorous detective journey to solve the mystery of disappearing props in a React application. Learn troubleshooting tips and best practices to prevent your props from vanishing into thin air. -date: 2024-03-01 -tags: ["code", "kubernetes", "props"] -published: true ---- - -# The Mysterious Case of the Disappearing Props - -In the quiet town of Reactville, developers live in harmony, crafting components and passing props with ease. But one day, a mystery unfolds that sends shockwaves through the community: props begin to disappear without a trace. This tale of intrigue and debugging will guide you through the dark alleys of React development to uncover the truth behind the disappearing props. - -## Chapter 1: The Disappearance - -Our story begins with a developer, much like yourself, who notices something amiss. A component that once displayed data proudly now stands empty, a shadow of its former self. The props, it seems, have vanished. - -```jsx -const MysteryComponent = ({ clue }) => ( -