slug
is now slug
date
(creation time) is now date
lastmod
(modification time) is now lastmod
_commands
should now be commands
)layout:post
from front matter (post metadata)1# Find and replace metadata tags
2grep -rl --null mtime . | xargs -0 sed -i '' 's/mtime/lastmod/g'
3grep -rl --null ctime . | xargs -0 sed -i '' 's/ctime/date/g'
4grep -rl --null slug . | xargs -0 sed -i '' 's/slug/slug/g'
Renaming folders on macOS was a simple double-click and Rename ** items. Use the Replace Text option from the dropdown, Find _
and replace with nothing. Click Rename and you’re done
layout: post
from postBecause it was having issues with the Hugo theme, and because adding the same layout to every post is redundant and non-productive. In Hugo, you can set a default layout for all sections via config, unlike Jekyll where I had to add default layout per collection in the config, meaning in order to set default layout for 10 collections, i had to add 10 config blocks.. It didn’t matter if they all used the same layout..
1# find all files containing 'layout: post'
2# and replace 'layout: post' with an empty line
3grep -irl --null "layout\: post" . | xargs -0 sed -i '' 's/layout\: post//g'
For posts, i want to remove the date from the title and add it inside the file as post metadata
1# find files based on pattern (date at the beginning)
2# open them files one by one and update metadata
3# rename files