mirror of
https://github.com/dwmkerr/hacker-laws.git
synced 2025-12-17 12:45:20 +01:00
fix: remove frontmatter
This commit is contained in:
@@ -17,9 +17,20 @@ fi
|
||||
export date="${DATE:-$(date +%F)}"
|
||||
export version="${VERSION?error: VERSION must be set}"
|
||||
|
||||
|
||||
# Update the input file to an intermedate.
|
||||
intermediate="${input}.temp"
|
||||
DATE="${date}" VERSION="${version}" envsubst < "${input}" > "${intermediate}"
|
||||
cat <<EOF > "${intermediate}"
|
||||
---
|
||||
title: "Hacker Laws"
|
||||
author: "Dave Kerr, github.com/dwmkerr/hacker-laws"
|
||||
subtitle: "Laws, Theories, Principles, and Patterns that developers will find useful. ${VERSION}, ${DATE}."
|
||||
version: ${VERSION}
|
||||
---
|
||||
|
||||
EOF
|
||||
cat "${input}" >> "${intermediate}"
|
||||
DATE="${date}" VERSION="${version}" envsubst < "${intermediate}" > "${output}"
|
||||
|
||||
# Use a single `sed` command to clean up unwanted lines and emojis in one pass.
|
||||
sed -e '/💻📖.*/d' \
|
||||
@@ -27,7 +38,7 @@ sed -e '/💻📖.*/d' \
|
||||
-e '/^\[Translations.*/d' \
|
||||
-e '/\*.*/d' \
|
||||
-e '/ \*.*/d' \
|
||||
-e '/## Translations/,$d' "${intermediate}" > "${output}"
|
||||
rm "${intermediate}"
|
||||
-e '/## Translations/,$d' "${output}" > "${intermediate}"
|
||||
mv "${intermediate}" "${output}"
|
||||
|
||||
echo "${output} prepared successfully."
|
||||
|
||||
Reference in New Issue
Block a user