Skip to content

Commit

Permalink
Remove “Product update: April 2023”
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroBailaAndrade committed Jan 8, 2024
1 parent 8260b75 commit 94787fc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 29 deletions.
10 changes: 0 additions & 10 deletions _data/announcements/product-update-april-2023.yml

This file was deleted.

42 changes: 23 additions & 19 deletions workspaces/cms-scripts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,23 @@ const createAnnouncementDetails = async () => {

const jsonFilesInDir = filesInDir.filter((file) => file.endsWith(".json"));

for (const fileName of jsonFilesInDir) {
const fileData = await fs.readFile(
path.join(
process.cwd(),
"public/data/announcements",
locale,
fileName
),
"utf8"
);

const { blocks, gitlog, sourceFilepath, objectID, ...roadmapDetails }: AnnouncementsPost = JSON.parse(fileData.toString());
roadmapPosts.push(roadmapDetails);
if (jsonFilesInDir.length > 0) {
for (const fileName of jsonFilesInDir) {
const fileData = await fs.readFile(
path.join(
process.cwd(),
"public/data/announcements",
locale,
fileName
),
"utf8"
);

const { blocks, gitlog, sourceFilepath, objectID, ...roadmapDetails }: AnnouncementsPost = JSON.parse(fileData.toString());
roadmapPosts.push(roadmapDetails);
}
await write(path.join("public/data/announcements-details", `${locale}.json`), roadmapPosts);
}
await write(path.join("public/data/announcements-details", `${locale}.json`), roadmapPosts);
}
}

Expand Down Expand Up @@ -224,11 +226,13 @@ for (const data of roadmapPosts.filenameMap.values()) {
);
}

for (const data of announcements.filenameMap.values()) {
await write(
`public/data/announcements/${data.locale}/${data.slug}.json`,
data
);
if (announcements.filenames.length > 0) {
for (const data of announcements.filenameMap.values()) {
await write(
`public/data/announcements/${data.locale}/${data.slug}.json`,
data
);
}
}

for (const locale of locales) {
Expand Down

0 comments on commit 94787fc

Please sign in to comment.