Blog

BLOG

How to build a blog in 2022 ๐Ÿšง

NextJS + Contentlayer + Mdx

Ragav Kumar V

Ragav Kumar V

May 20, 2022 โ€” Updated May 21, 2022 ยท 1 min read

  1. NextJS
  2. ContentLayer
  3. Mdx
  4. Typescript
  5. Emotion / Styled-components
  6. Open-props
  7. Reading-time
  1. Bash shell script - for Windows use (git bash) to execute
  2. Husky - to run the update date command on commit
last
Copy

_15
#!/bin/sh
_15
#Contents of .git/hooks/pre-commit
_15
#Replace `last_modified_at` timestamp with current time
_15
_15
git diff-- cached-- name - status | egrep -
_15
i "^(A|M).*\.(mdx)$" | while read
_15
a b;
_15
do
_15
_15
cat $b | sed
_15
"/---.*/,/---.*/s/^last_modified_at:.*$/last_modified_at: $(date)/" >
_15
tmp
_15
mv tmp $b
_15
git add $b
_15
done

__

More update incoming ๐Ÿš€

@ragavkumarv
swipe to next โžก๏ธ