When a site is imported with --archived, both the YAML title in the
frontmatter and the first <h1> in the HTML body of the index page now
include the version number in parentheses, e.g. "My Project (1.2.0)".
This makes it immediately clear to visitors (and in browser titles /
breadcrumbs) which version they are viewing.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
NUM_CHILDS=$(echo "$PAGE" | jq '.childs | length')
if [[ "$FILE" == "index.html" ]]; then
- TITLE_YAML=$(echo "$JSON" | jq '.project')
+ if [[ "$ARCHIVED" -eq 1 ]]; then
+ TITLE_YAML=$(echo "$JSON" | jq --arg v " ($VERSION)" '.project + $v')
+ else
+ TITLE_YAML=$(echo "$JSON" | jq '.project')
+ fi
CONTENT_REL="_index.html"
PAGE_URL="${URL_BASE}/"
ROUTING_FILE="index.astro"
"$CONTENT_TARGET"
done
+ if [[ "$FILE" == "index.html" && "$ARCHIVED" -eq 1 ]]; then
+ sed -i "0,/<\/h1>/s|</h1>| ($VERSION)</h1>|" "$CONTENT_TARGET"
+ fi
+
echo "Content: $CONTENT_TARGET"
ROUTING_TARGET="$PAGES_BASE/$ROUTING_FILE"
NUM_CHILDS=$(echo "$PAGE" | jq '.childs | length')
if [[ "$FILE" == "index.html" ]]; then
- TITLE_YAML=$(echo "$JSON" | jq '.project')
+ if [[ "$ARCHIVED" -eq 1 ]]; then
+ TITLE_YAML=$(echo "$JSON" | jq --arg v " ($VERSION)" '.project + $v')
+ else
+ TITLE_YAML=$(echo "$JSON" | jq '.project')
+ fi
CONTENT_REL="_index.html"
PAGE_URL="${URL_BASE}/"
CANONICAL_URL="${CANONICAL}/"
's#<pre\b[^>]*>(.*?)</pre>#"{{< highlight guess >}}\n".decode_entities($1)."\n{{< /highlight >}}"#gse'
} > "$TARGET"
+ if [[ "$FILE" == "index.html" && "$ARCHIVED" -eq 1 ]]; then
+ sed -i "0,/<\/h1>/s|</h1>| ($VERSION)</h1>|" "$TARGET"
+ fi
+
echo "Content: $TARGET"
done