Skip to content

Commit 364c61d

Browse files
mingrammerclaude
andauthored
chore(site): add Google Search Console verification tag (#1247)
Docusaurus 1.x has no config hook for arbitrary <head> tags, and the verifier reads the served HTML without running JS, so the homepage tag is injected during the deploy assemble step. The playground ships it in its own index.html, in case /playground/ is registered as a separate property. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent 67fc9f8 commit 364c61d

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

.github/workflows/deploy-site.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,22 @@ jobs:
8585
print("added playground to sitemap")
8686
else:
8787
print("playground already in sitemap")
88+
89+
# Google Search Console ownership check. Docusaurus 1.x has no
90+
# config hook for arbitrary <head> tags, and the verifier reads the
91+
# served HTML without running JS, so the tag is injected into the
92+
# built homepage here.
93+
verification = (
94+
'<meta name="google-site-verification" '
95+
'content="p1XvVxyPOUJ6LYX5rAqSAM27tW2AFMaacg1BTr8mfR4" />'
96+
)
97+
home = Path("_site/index.html")
98+
html = home.read_text()
99+
if "google-site-verification" not in html:
100+
home.write_text(html.replace("<head>", "<head>" + verification, 1))
101+
print("added Search Console verification to homepage")
102+
else:
103+
print("verification tag already present")
88104
PY
89105
90106
- name: Deploy to gh-pages

playground/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
content="Run the Python diagrams library online. Write Diagram as Code in your browser and render AWS, Azure, GCP and Kubernetes architecture diagrams — no install required."
1010
/>
1111
<link rel="canonical" href="https://diagrams.mingrammer.com/playground/" />
12+
<!-- Search Console ownership, in case /playground/ is registered as its
13+
own URL-prefix property (the site root gets the same tag at deploy). -->
14+
<meta name="google-site-verification" content="p1XvVxyPOUJ6LYX5rAqSAM27tW2AFMaacg1BTr8mfR4" />
1215
<!-- Real diagrams project logo; relative href survives sub-path deploys. -->
1316
<link rel="icon" type="image/png" href="diagrams-logo.png" />
1417

0 commit comments

Comments
 (0)