Skip to content

Commit

Permalink
chore: delete post
Browse files Browse the repository at this point in the history
  • Loading branch information
leo-the-nardo committed Dec 6, 2024
1 parent f3a5d39 commit e0c8df9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 81 deletions.
12 changes: 6 additions & 6 deletions ci-scripts/publish-post-update.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down Expand Up @@ -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);

Expand Down
75 changes: 0 additions & 75 deletions content/disappearing-props.mdx

This file was deleted.

0 comments on commit e0c8df9

Please sign in to comment.