Skip to content

Commit e9daf82

Browse files
committed
Add Search Console Monitor page and update sitemap
Introduces SearchConsoleMonitor.html for monitoring indexed pages via Google Search Console API. Updates sitemap.xml to exclude the new monitor page from the sitemap.
1 parent 1b55285 commit e9daf82

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

SearchConsoleMonitor.html

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
layout: default
3+
permalink: /scm
4+
---
5+
<!DOCTYPE html>
6+
<html>
7+
<head>
8+
<title>Indexed Pages Monitor</title>
9+
<script src="https://apis.google.com/js/api.js"></script>
10+
</head>
11+
<body>
12+
<h1>Indexed Pages Count</h1>
13+
<button onclick="initClient()">Authorize & Fetch</button>
14+
<div id="output"></div>
15+
16+
<script>
17+
function initClient() {
18+
gapi.load('client:auth2', () => {
19+
gapi.auth2.init({
20+
client_id: '830015351192-38tmspassocrp65dok2mo83d54g9gtav.apps.googleusercontent.com',
21+
scope: 'https://www.googleapis.com/auth/webmasters.readonly'
22+
}).then(() => {
23+
gapi.auth2.getAuthInstance().signIn().then(() => {
24+
gapi.client.load('searchconsole', 'v1').then(fetchSitemaps);
25+
});
26+
});
27+
});
28+
}
29+
</script>
30+
</body>
31+
</html>

sitemap.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ layout: none
1111
</url>
1212
{% for page in site.pages %}
1313
{% if page.url != "/" and page.url != "/sitemap.xml" %}
14-
{% unless page.url contains ".css" or page.url contains ".js" or page.url contains ".png" or page.url contains ".jpg" %}
14+
{% unless page.url contains ".css" or page.url contains ".js" or page.url contains ".png" or page.url contains ".jpg" or page.url contains "scm" %}
1515
<url>
1616
<loc>{{ site.url }}{{ page.url }}</loc>
1717
<lastmod>{{ page.date | default: site.time | date_to_xmlschema }}</lastmod>

0 commit comments

Comments
 (0)