diff --git a/commands/prep-now.ts b/commands/prep-now.ts index 98e38ce..74a3f5c 100644 --- a/commands/prep-now.ts +++ b/commands/prep-now.ts @@ -1,5 +1,5 @@ import { fileURLToPath } from 'node:url' -import { readFileSync, writeFileSync } from 'node:fs' +import { copyFileSync, readFileSync, writeFileSync } from 'node:fs' import { consola } from 'consola' import { colorize } from 'consola/utils' import { dirname, resolve } from 'pathe' @@ -8,8 +8,7 @@ import now from '../src/constants/now.json' export default async function newNow(): Promise { consola.box('Preparing for a new Now page!') - const datetime = now.publishDate - const postFileName = `${datetime}.astro` + const postFileName = `${now.publishDate}.astro` consola.start(`Copying current now page to ${colorize('blue', postFileName)}`) try { @@ -40,9 +39,15 @@ export default async function newNow(): Promise { /** * clear now.md */ - // consola.start('Clearing now.md file...') - // writeFileSync(nowMdPath, '') - // consola.success('now.md cleared') + consola.start('Clearing now.md file...') + const destinationMd = resolve( + __dirname, + '../src/constants/bkup', + `${now.publishDate}.md` + ) + copyFileSync(nowMdPath, destinationMd) + writeFileSync(nowMdPath, '') + consola.success('now.md cleared') /** * clear now.ts @@ -54,6 +59,14 @@ export default async function newNow(): Promise { ) // Object.assign({}, now) newNowObj.publishDate = new Date().toISOString().split('T')[0] ?? '' const nowJsonPath = resolve(__dirname, '../src/constants/now.json') + // backup file + const destinationJson = resolve( + __dirname, + '../src/constants/bkup', + `${now.publishDate}.json` + ) + copyFileSync(nowJsonPath, destinationJson) + writeFileSync(nowJsonPath, JSON.stringify(newNowObj, null, '\t')) consola.success('You may now update your Now content and props.\n') diff --git a/src/constants/bkup/2024-12-25.json b/src/constants/bkup/2024-12-25.json new file mode 100644 index 0000000..bf36101 --- /dev/null +++ b/src/constants/bkup/2024-12-25.json @@ -0,0 +1,7 @@ +{ + "title": "Celebrating the year's end 🎉", + "description": "Wrapping up 2024 and preparing for the next year...", + "publishDate": "2024-12-25", + "publishedOn": "the Christmas Day of 2024", + "publishState": "while on the way home after a vacation in Germany; now onboard a train from Eindhoven to Amsterdam." +} diff --git a/src/constants/bkup/2024-12-25.md b/src/constants/bkup/2024-12-25.md new file mode 100644 index 0000000..8013984 --- /dev/null +++ b/src/constants/bkup/2024-12-25.md @@ -0,0 +1,16 @@ +Christmas holidays as started for me. + +I think I finished all needed stuff for work. Also messaged people online for a final happy holiday greetings of the year. Will go offline til January and figure out my rhythm for next year. + +Reading Radical Candor by Kim Scott. Feels like a lot of these kind of books are a rehash of concepts in "The 7 Habits of Highly Effective People" and "How to Win Friends and Influence People" -- I recommend those first before this one! I like that “humility” was also given a spotlight; there's not enough attention to the effectivity/productivity of acknowledging you can be wrong and welcoming feedback (both praise & criticism). Hard to capture in a paragraph though -- ask me to elaborate if you want and when given the chance! + +Also reinforced the idea that 'writing a story' in my head about people, with prejudice, is unproductive. Assumptions are never good; always verify before forming judgments and/or giving feedbacks. + +Spent some time in Aachen, Germany with the fam. Walked around the Christmas Market there. Food trip galore, sat at cafes, read books, bought stuff. :) + +But the highlight is going to Monschau on a day trip. Kahel buit a small snowman. + +Also, realized down-time travel time is infinitely more productive when listening to Audio books. It is especially effective for me for books I have already finished and just need a review. So I am glad I have a copy of the 7-habits book ready -- I finished that one years ago, listening to the audio is mostly just a review. + +Stopping now before this becomes a long blog about books; seems I need to write that separately... + \ No newline at end of file diff --git a/src/constants/now.json b/src/constants/now.json index 1d2a02d..5b1c48f 100644 --- a/src/constants/now.json +++ b/src/constants/now.json @@ -1,7 +1,7 @@ { - "title": "Yes, New year!", - "description": "Oh what a feeling...", + "title": "", + "description": "", "publishDate": "2025-01-04", - "publishedOn": "the fourth day of the first month of 2025", - "publishState": "after a weekend coding session" + "publishedOn": "", + "publishState": "" } diff --git a/src/constants/now.md b/src/constants/now.md index b4e2221..e69de29 100644 --- a/src/constants/now.md +++ b/src/constants/now.md @@ -1 +0,0 @@ -something happened \ No newline at end of file diff --git a/src/pages/now/and-then/posts/2024-12-25.astro b/src/pages/now/and-then/posts/2024-12-25.astro index 4768976..304a53a 100644 --- a/src/pages/now/and-then/posts/2024-12-25.astro +++ b/src/pages/now/and-then/posts/2024-12-25.astro @@ -2,12 +2,19 @@ import Layout from '../../../../layouts/Layout.astro' import Footer from '../../../../components/Footer.astro' -const title = `Yessss` -const description = `Closing the year and planning for the next` +const title = `Celebrating the year's end 🎉` +const description = `Wrapping up 2024 and preparing for the next year...` const publishedOn = `the Christmas Day of 2024` const publishDate = `2024-12-25` const publishState = `while on the way home after a vacation in Germany; now onboard a train from Eindhoven to Amsterdam.` -const content = `

something happened

` +const content = `

Christmas holidays as started for me.

+

I think I finished all needed stuff for work. Also messaged people online for a final happy holiday greetings of the year. Will go offline til January and figure out my rhythm for next year.

+

Reading Radical Candor by Kim Scott. Feels like a lot of these kind of books are a rehash of concepts in "The 7 Habits of Highly Effective People" and "How to Win Friends and Influence People" -- I recommend those first before this one! I like that “humility” was also given a spotlight; there's not enough attention to the effectivity/productivity of acknowledging you can be wrong and welcoming feedback (both praise & criticism). Hard to capture in a paragraph though -- ask me to elaborate if you want and when given the chance!

+

Also reinforced the idea that 'writing a story' in my head about people, with prejudice, is unproductive. Assumptions are never good; always verify before forming judgments and/or giving feedbacks.

+

Spent some time in Aachen, Germany with the fam. Walked around the Christmas Market there. Food trip galore, sat at cafes, read books, bought stuff. :)

+

But the highlight is going to Monschau on a day trip. Kahel buit a small snowman.

+

Also, realized down-time travel time is infinitely more productive when listening to Audio books. It is especially effective for me for books I have already finished and just need a review. So I am glad I have a copy of the 7-habits book ready -- I finished that one years ago, listening to the audio is mostly just a review.

+

Stopping now before this becomes a long blog about books; seems I need to write that separately...

` ---