Skip to content

Commit f97769c

Browse files
authored
Merge pull request #4 from GSiesto/feature-indexnow
integrate IndexNow API for proactive search engine crawling
2 parents b0aa7b5 + 617841f commit f97769c

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,10 @@ jobs:
156156
CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}
157157
run: |
158158
aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DISTRIBUTION_ID --paths "/*"
159-
echo "CloudFront cache invalidation requested."
159+
echo "CloudFront cache invalidation requested."
160+
161+
- name: Ping IndexNow
162+
run: |
163+
echo "Notifying Bing and other search engines via IndexNow..."
164+
curl -s "https://api.indexnow.org/indexnow?url=https://pdflince.com&key=7a258aaa2a9b472bb6e97935fe5e82ca"
165+
echo "IndexNow pinged successfully."
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7a258aaa2a9b472bb6e97935fe5e82ca

src/app/robots.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ export const revalidate = false;
66
export default function robots(): MetadataRoute.Robots {
77
const baseUrl = "https://pdflince.com";
88

9-
return {
9+
// Cast to bypass Next.js restricted Sitemap type since it doesn't officially support 'host' yet
10+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
11+
const robotsObj: any = {
1012
rules: {
1113
userAgent: "*",
1214
allow: "/",
@@ -15,5 +17,8 @@ export default function robots(): MetadataRoute.Robots {
1517
],
1618
},
1719
sitemap: `${baseUrl}/sitemap.xml`,
20+
host: "https://api.indexnow.org/indexnow?url=https://pdflince.com&key=7a258aaa2a9b472bb6e97935fe5e82ca",
1821
};
22+
23+
return robotsObj as MetadataRoute.Robots;
1924
}

0 commit comments

Comments
 (0)