You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: broaden IndexNow triggers to saves and permanent deletes
Adopt two hooks added in emdash 0.21.0:
- content:afterSave -> handleIndexNowPublished. Pings IndexNow whenever
published content is saved, closing the gap where edits to an already-
published page never notified search engines (afterPublish only fires
on the draft->published transition). afterPublish and afterSave both
route through this handler; a per-URL 60s debounce collapses the
duplicate they fire at the publish moment and absorbs autosave bursts.
- content:afterDelete -> handleIndexNowDelete. Pings the dead URL on a
permanent delete so engines recrawl and see the 404/410. The delete
event carries only { id, collection } (no slug), so published saves
cache an id->url mapping in KV that the delete handler resolves and
clears. Trashing stays on the afterUnpublish path.
Extracted submitUrlToIndexNow from handleIndexNowTransition (now only
afterUnpublish). Added 9 tests; README + CHANGELOG updated.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,9 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [0.12.0] - 2026-06-18
9
9
10
+
### Added
11
+
12
+
-**IndexNow now pings on edits to already-published pages.** The new `content:afterSave` hook fires on every save; the handler pings IndexNow whenever *published* content is saved. Previously only the draft→published transition (`content:afterPublish`) pinged, so editing a live page and re-saving never notified search engines. Both hooks route through the same handler; a per-URL debounce (60s, `PING_DEBOUNCE_MS`) collapses the duplicate the two fire at the publish moment and guards against autosave bursts.
13
+
-**IndexNow now pings on permanent deletes.** The new `content:afterDelete` hook submits a permanently-deleted page's last-known URL to IndexNow so engines recrawl and see the 404/410. Because the delete event carries only `{ id, collection }` (no slug), published saves record an `id → url` mapping in plugin KV (`indexnow:urlmap:<collection>:<id>`) that the delete handler resolves and then clears. Trashing is treated as an unpublish and continues to flow through `content:afterUnpublish`.
14
+
10
15
### Changed
11
16
12
-
-**`peerDependencies.emdash` bumped to `^0.21.0`.** Tracks the current EmDash release. The plugin API surface this plugin depends on — the `page:metadata`, `content:afterPublish`, and `content:afterUnpublish` hooks, plus the `read:content`, `page:inject`, and `network:fetch` capabilities — is unchanged from `0.6.0`, so no source changes were required. Verified against `emdash@0.21.0`: typecheck clean, all tests passing.
17
+
-**`peerDependencies.emdash` bumped to `^0.21.0`.** Tracks the current EmDash release. The plugin API surface this plugin depends on — the `page:metadata`, `content:afterPublish`, and `content:afterUnpublish` hooks, plus the `read:content`, `page:inject`, and `network:fetch` capabilities — is unchanged from `0.6.0`, so the compatibility bump itself required no source changes. Verified against `emdash@0.21.0`: typecheck clean, all tests passing.
13
18
- Internal plugin `version` strings in `src/index.ts` bumped to `0.12.0` to match the package version.
Copy file name to clipboardExpand all lines: README.md
+16-4Lines changed: 16 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ An SEO plugin for [EmDash CMS](https://github.com/emdash-cms/emdash) that genera
34
34
-**Schema map***(experimental)* — exposes a list of every published URL backed by schema markup at the plugin's `schema/map` route, ready to be wired to a `/schemamap.xml` Astro endpoint for agent/crawler discovery
35
35
-**Fuzzy Redirects** — admin tool that mines the core 404 log, ranks live URLs by path similarity (Levenshtein + token overlap + last-segment match), and lets you one-click create a 301 redirect for the best target. Catches moved slugs, typos in inbound links, and punctuation drift without having to write regex rules
36
36
-**NLWeb `<link>` tag** — when the **NLWeb endpoint URL** setting is set, every rendered page carries `<link rel="nlweb" href="…">` advertising the site's conversational endpoint for agent discovery. Requires EmDash with [emdash-cms/emdash#523](https://github.com/emdash-cms/emdash/pull/523) merged; older versions drop the contribution silently
37
-
-**IndexNow** — on publish/unpublish transitions, submits the affected URL to [IndexNow](https://www.indexnow.org) so Bing, Yandex, Seznam, Naver, and Yep recrawl immediately. Opt-in via a single toggle in the settings UI; the key is generated and persisted automatically on first use
37
+
-**IndexNow** — on publish, on edits to an already-published page, on unpublish, and on permanent delete, submits the affected URL to [IndexNow](https://www.indexnow.org) so Bing, Yandex, Seznam, Naver, and Yep recrawl immediately. Opt-in via a single toggle in the settings UI; the key is generated and persisted automatically on first use
38
38
-**Admin settings UI** — auto-generated from `settingsSchema` for configuring Person/Organization identity, social profiles, title separator, and default description
39
39
40
40
## Installation
@@ -129,9 +129,21 @@ URLs become `/fr-ca/…` and `/fr-fr/…`, and the emitted `hreflang` attributes
129
129
## IndexNow
130
130
131
131
When enabled via the **IndexNow submission** setting, the plugin submits
132
-
the canonical URL of any content item that transitions to or from
133
-
published. A 32-character hex key is minted on first use and persisted in
134
-
plugin KV.
132
+
the canonical URL of a content item whenever it changes in a way search
133
+
engines should re-crawl:
134
+
135
+
-**Published, or edited while published** (`content:afterPublish` +
136
+
`content:afterSave`) — so both first publish and later edits to a live
137
+
page are picked up. A per-URL 60-second debounce collapses the duplicate
138
+
these two fire at the publish moment and absorbs autosave bursts.
139
+
-**Unpublished** (`content:afterUnpublish`) — pings the now-dead URL so
140
+
engines see the 404/410.
141
+
-**Permanently deleted** (`content:afterDelete`, only when the delete is
142
+
permanent rather than a trash) — the delete event carries no slug, so
143
+
published saves cache an `id → url` mapping in plugin KV that the delete
144
+
handler resolves, submits, and then clears.
145
+
146
+
A 32-character hex key is minted on first use and persisted in plugin KV.
135
147
136
148
The front-end Astro site must serve the key-verification file at
137
149
`/<key>.txt`. Fetch the key from the plugin's `indexnow/key` route and
0 commit comments