Skip to content

Commit 9ceebf7

Browse files
phernandezclaude
andcommitted
add IndexNow key file and submission script
πŸ”‘ Key file at /0813239a6c6945e1bd8c01751fbc1ec8.txt for ownership verification πŸ“œ Reusable script at scripts/indexnow-submit.sh to bulk-submit all pages Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 410bc45 commit 9ceebf7

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0813239a6c6945e1bd8c01751fbc1ec8

β€Žscripts/indexnow-submit.shβ€Ž

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/usr/bin/env bash
2+
# Submit all docs.basicmemory.com pages to IndexNow for search engine indexing.
3+
# Usage: ./scripts/indexnow-submit.sh
4+
5+
set -euo pipefail
6+
7+
HOST="docs.basicmemory.com"
8+
KEY="0813239a6c6945e1bd8c01751fbc1ec8"
9+
KEY_LOCATION="https://${HOST}/${KEY}.txt"
10+
CONTENT_DIR="$(dirname "$0")/../content"
11+
12+
# Build URL list from content directory
13+
urls=()
14+
15+
# Add the root page
16+
urls+=("https://${HOST}")
17+
18+
for file in $(find "$CONTENT_DIR" -name '*.md' -not -name 'index.md' | sort); do
19+
# Strip content dir prefix
20+
rel="${file#$CONTENT_DIR/}"
21+
# Remove .md extension
22+
rel="${rel%.md}"
23+
# Remove leading numeric prefix from each path segment (e.g., 1.start-here -> start-here)
24+
# Only strips N. at segment boundaries, preserving version numbers like v0.19.0
25+
rel=$(echo "$rel" | sed -E 's|^[0-9]+\.||; s|/[0-9]+\.|/|g')
26+
urls+=("https://${HOST}/${rel}")
27+
done
28+
29+
# Build JSON url list
30+
url_json=""
31+
for url in "${urls[@]}"; do
32+
if [ -n "$url_json" ]; then
33+
url_json="${url_json},"
34+
fi
35+
url_json="${url_json}
36+
\"${url}\""
37+
done
38+
39+
payload="{
40+
\"host\": \"${HOST}\",
41+
\"key\": \"${KEY}\",
42+
\"keyLocation\": \"${KEY_LOCATION}\",
43+
\"urlList\": [${url_json}
44+
]
45+
}"
46+
47+
echo "Submitting ${#urls[@]} URLs to IndexNow..."
48+
echo ""
49+
echo "$payload" | python3 -m json.tool
50+
echo ""
51+
52+
curl -s -w "\nHTTP Status: %{http_code}\n" \
53+
-X POST "https://api.indexnow.org/IndexNow" \
54+
-H "Content-Type: application/json; charset=utf-8" \
55+
-d "$payload"

0 commit comments

Comments
Β (0)