commit 8504659d7eb92f4a805160111c6455a96c820db1
parent d09ca6585e66674e603c1997b2e120a3b4f280e3
Author: Francesco Saccone <francesco@francescosaccone.com>
Date: Sun, 9 Mar 2025 18:28:36 +0100
feat: remove dates from atom and sitemap altogether
I can't seem to make dates work in any way when running the
scripts from my server, so I removed them altogether along with
their 'git' dependencies.
Signed-off-by: Francesco Saccone <francesco@francescosaccone.com>
Diffstat:
2 files changed, 2 insertions(+), 11 deletions(-)
diff --git a/scripts/generate-atom.sh b/scripts/generate-atom.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-for program in dirname echo find git mkdir realpath sed; do
+for program in dirname echo find mkdir realpath sed; do
if ! command -v "$program" > /dev/null 2>&1; then
echo "Error: Required program '$program' is not installed."
exit 1
@@ -19,8 +19,6 @@ ATOM_FILE="$DESTINATION/atom.xml"
TITLE="$2"
BASE_URL="$3"
-SITE_DATE=$(cd "$SOURCE" && git log -1 --pretty=%cI)
-
mkdir -p "$DESTINATION"
{
@@ -28,7 +26,6 @@ mkdir -p "$DESTINATION"
echo -n "<feed xmlns=\"http://www.w3.org/2005/Atom\">"
echo -n "<title>${TITLE}</title>"
echo -n "<link href=\"${BASE_URL}\" rel=\"self\"/>"
- echo -n "<updated>$SITE_DATE</updated>"
echo -n "<id>$BASE_URL/atom.xml</id>"
} > "$ATOM_FILE"
@@ -42,8 +39,6 @@ in $(find "$BLOG_SOURCE" -mindepth 2 -maxdepth 2 -type f -name "index.md"); do
url="$BASE_URL/blog/$entry_title_id"
- date=$(cd "$SOURCE" && git log -1 --pretty=%cI "$md_file")
-
# First capitalise the first letter, then replace hyphens with spaces.
entry_title=$(echo "${entry_title_id^}" | sed -e 's/-/ /g')
@@ -51,7 +46,6 @@ in $(find "$BLOG_SOURCE" -mindepth 2 -maxdepth 2 -type f -name "index.md"); do
echo -n "<entry>"
echo -n "<title>$entry_title</title>"
echo -n "<link href=\"$url\"/>"
- echo -n "<updated>$date</updated>"
echo -n "</entry>"
} >> "$ATOM_FILE"
done
diff --git a/scripts/generate-sitemap.sh b/scripts/generate-sitemap.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-for program in dirname echo find git mkdir realpath; do
+for program in dirname echo find mkdir realpath; do
if ! command -v "$program" > /dev/null 2>&1; then
echo "Error: Required program '$program' is not installed."
exit 1
@@ -35,12 +35,9 @@ for md_file in $(find "$SOURCE" -type f -name "index.md"); do
url="$BASE_URL/$url_path"
- date=$(cd "$SOURCE" && git log -1 --pretty=%cI "$md_file")
-
{
echo -n "<url>"
echo -n "<loc>$url</loc>"
- echo -n "<lastmod>$date</lastmod>"
echo -n "</url>"
} >> "$SITEMAP_FILE"
done