Skip to content

Commit

Permalink
feat: add id
Browse files Browse the repository at this point in the history
  • Loading branch information
zakiego committed Apr 9, 2023
1 parent c2fb1f1 commit eceb676
Show file tree
Hide file tree
Showing 23 changed files with 53 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ publishedDate: '2023-03-14'
coverImage: coverImage.jpg
instagramLink: https://www.instagram.com/p/CpuxS1fPtRC/
tags: []
id: 61215343-e69d-9a2c-5ade-19f5ad2ce03d
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ instagramLink: https://www.instagram.com/p/CqQj-D8PdPg/
tags:
- dzikrayat
- ramadhan
id: effed409-2954-9678-e82f-c6bed2fce20b
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ instagramLink: https://www.instagram.com/p/CqRLKadP_u9/
tags:
- dzikrayat
- ramadhan
id: cfe59793-0341-e191-c301-b4726fcc3631
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ publishedDate: '2023-03-14'
coverImage: null
instagramLink: https://www.instagram.com/p/CpwFSN-PvRz/
tags: []
id: a6599a3d-fee9-182a-bb5f-9a058da88d7a
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ instagramLink: https://www.instagram.com/p/CpwRofSPDTY/
tags:
- dzikrayat
- ramadhan
id: 93658ada-6d11-2333-60ed-1ecb8e7619be
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ instagramLink: https://www.instagram.com/p/CpyTBz4ybou/
tags:
- dzikrayat
- ramadhan
id: 63a15763-8f38-fa12-8e68-f74aaa4ab447
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ instagramLink: https://www.instagram.com/p/Cp1WkeyvZvi/
tags:
- dzikrayat
- ramadhan
id: 1c846607-63d9-f88f-e50c-74671a00e644
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ coverImage: coverImage.jpg
instagramLink: https://www.instagram.com/p/Cp2ta54vR7Z/
tags:
- dzikrayat
id: c1228ef1-06cd-e3c6-a5c8-97db6d458563
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ instagramLink: https://www.instagram.com/p/Cp-cm0DvAM0/
tags:
- dzikrayat
- ramadhan
id: 16fd046b-8ed0-647d-d102-4ec6664be073
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ instagramLink: https://www.instagram.com/p/CqMivv2vcQo/
tags:
- dzikrayat
- ramadhan
id: d22d6d36-11c5-18d2-8b86-89802918be83
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ coverImage: coverImage.jpg
instagramLink: https://www.instagram.com/p/CqMjKJyPWrl/
tags:
- dzikrayat
id: aed1f789-6b90-9db0-b11b-f8806abd0710
1 change: 1 addition & 0 deletions content/posts/hati-hati-dalam-bergaul/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ publishedDate: '2023-03-09'
coverImage: coverImage.jpg
instagramLink: https://www.instagram.com/p/Cpkpq2or5ir/
tags: []
id: c52e9d46-3f31-d73d-08de-96e0791fdeb1
1 change: 1 addition & 0 deletions content/posts/lika-liku-dan-luka-hidup/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ publishedDate: '2023-04-06'
coverImage: null
instagramLink: null
tags: []
id: 6c95ef68-2975-11bd-6b94-b8467772fdee
1 change: 1 addition & 0 deletions content/posts/ngaji-isra-mi-raj/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ coverImage: coverImage.jpg
instagramLink: https://www.instagram.com/p/Co6axQTPdUP/
tags:
- isra-miraj
id: 1d7ab26a-8484-6fad-a0c4-ab0f7dff0930
1 change: 1 addition & 0 deletions content/posts/pada-satu-hati/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ publishedDate: '2021-02-21'
coverImage: coverImage.jpg
instagramLink: https://www.instagram.com/p/CLioQXdH-Ea/
tags: []
id: cb4e90da-b94e-b996-763d-9cd529f26155
1 change: 1 addition & 0 deletions content/posts/pena-ramadan/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ coverImage: coverImage.jpg
instagramLink: https://www.instagram.com/p/CqGBMIxPvsZ/
tags:
- ramadhan
id: 95b7e4ae-59dc-a1f7-e3fa-27c939ef1f2b
1 change: 1 addition & 0 deletions content/posts/ramadhaniyyat/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ coverImage: coverImage.jpg
instagramLink: https://www.instagram.com/p/CqUyKbyPcGq/
tags:
- ramadhan
id: dcffe602-8926-740c-bca6-b83de976ea9c
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ coverImage: null
instagramLink: null
tags:
- pernikahan
id: 98c07cd4-518c-2934-b794-b43f69f31bb6
1 change: 1 addition & 0 deletions content/posts/risalah/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ publishedDate: '2023-03-07'
coverImage: coverImage.jpg
instagramLink: https://www.instagram.com/p/CpfKjaCKpiA/
tags: []
id: cba6082f-57ad-ad1c-01d3-a8d7dbe1f3dc
1 change: 1 addition & 0 deletions content/posts/rumahku-surgaku/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ publishedDate: '2023-04-05'
coverImage: coverImage.jpg
instagramLink: https://www.instagram.com/p/CqoQZ--v10f/
tags: []
id: 58e4a9ed-fa33-77a8-789b-71b4c88e51b4
1 change: 1 addition & 0 deletions content/posts/sahabat/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ tags:
- sahabat
- taubat
- mati
id: f06c558c-e8af-294e-59aa-d3eb253af5b6
1 change: 1 addition & 0 deletions content/posts/separuh-ramadan/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ coverImage: null
instagramLink: null
tags:
- ramadhan
id: 9e63dabf-fe32-0575-8d00-64d71bac9608
31 changes: 31 additions & 0 deletions script/editPost.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import * as fs from "fs";
import { v4 as uuidv4 } from "uuid";
import { parse, stringify } from "yaml";

const main = () => {
const posts = fs.readdirSync("./content/posts");

posts.forEach((post) => {
const path = `./content/posts/${post}/index.yaml`;
let postContent = fs.readFileSync(path, {
encoding: "utf-8",
});

if (!postContent) return;

// const tags = parse(postContent);

// if (!tags.id) {
// tags.id = uuidv4();
// }

// add one paragraph
postContent += `id: ${uuidv4()}`;

fs.writeFileSync(path, postContent, {
encoding: "utf-8",
});
});
};

main();

0 comments on commit eceb676

Please sign in to comment.