Skip to content

Commit 6df9d21

Browse files
hotfix: duplicate and static meta tags interfere with each other
1 parent 38879b6 commit 6df9d21

7 files changed

Lines changed: 32 additions & 40 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.2.8] - 2026-02-20
9+
10+
### Fixed
11+
12+
- Duplicate meta tags in `<head>` caused by hardcoded tags in `index.html` conflicting with dynamically added tags from `Layout.jsx` and `react-helmet` in `Header.jsx`.
13+
814
## [1.2.7] - 2026-02-17
915

1016
### Added

docsite/docusaurus.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ const config: Config = {
123123
{
124124
type: 'html',
125125
position: 'right',
126-
value: '<span style="padding: 0.25rem 0.5rem; background: var(--ifm-color-primary); color: white; border-radius: 4px; font-size: 0.875rem; font-weight: 600;">v1.2.7</span>',
126+
value: '<span style="padding: 0.25rem 0.5rem; background: var(--ifm-color-primary); color: white; border-radius: 4px; font-size: 0.875rem; font-weight: 600;">v1.2.8</span>',
127127
},
128128
{
129129
href: 'https://demo.ode.dimwit.me/',

index.html

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@
44
<meta charset="UTF-8" />
55
<link rel="icon" type="image/ico" href="/favicon.ico" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>Ode to the Ordinary</title>
8-
<meta name="description" content="An ode to those who love the craft, an ode to the old internet, an ode to a time before numbers and figures dominated writing, an ode to a time where readers remembered their favourite writers, and an ode to the hope that all of it is still present, somewhere." />
9-
<meta name="author" content="John Doe" />
10-
<meta property="og:title" content="Ode to the Ordinary" />
11-
<meta property="og:description" content="An ode to those who love the craft, an ode to the old internet, an ode to a time before numbers and figures dominated writing, an ode to a time where readers remembered their favourite writers, and an ode to the hope that all of it is still present, somewhere." />
12-
<meta property="og:url" content="https://demo.ode.dimwit.me" />
13-
<meta property="og:type" content="website" />
7+
<title>Ode</title>
148
</head>
159
<body>
1610
<div id="root"></div>

landing/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ <h1>Ode</h1>
2929
<a href="https://github.com/DeepanshKhurana/ode/pkgs/container/ode" class="text-link" target="_blank" rel="noopener noreferrer">Packages</a>
3030
<a href="https://github.com/sponsors/DeepanshKhurana" class="text-link" target="_blank" rel="noopener noreferrer">Donate</a>
3131
</div>
32+
<div class="nav-links sister-project">
33+
<span>As for the writing itself, there's <a href="https://github.com/DeepanshKhurana/Prosaic" class="text-link secondary" target="_blank" rel="noopener noreferrer">Prosaic</a>.</span>
34+
</div>
3235
<div class="footer">
3336
<span>Made with love and labour by Deepansh Khurana</span>
3437
<span><a href="https://dimwit.me" target="_blank" rel="noopener noreferrer">Dimwit</a> | <a href="https://journal.coffee" target="_blank" rel="noopener noreferrer">journal.coffee</a></span>

landing/style.css

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,26 @@ h1 {
8181
border-bottom: 1px solid var(--primary-color);
8282
}
8383

84+
.text-link.secondary {
85+
color: var(--secondary-color);
86+
}
87+
88+
.text-link.secondary:hover {
89+
border-bottom-color: var(--secondary-color);
90+
}
91+
92+
.sister-project {
93+
font-size: 1rem;
94+
margin-top: 3rem;
95+
margin-bottom: 3rem;
96+
}
97+
98+
.sister-project .text-link {
99+
font-size: inherit;
100+
}
101+
84102
.footer {
85-
margin-top: 4rem;
103+
margin-top: 0;
86104
font-size: 0.9rem;
87105
color: #999;
88106
display: flex;

src/components/Header/Header.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useEffect, useState } from "react";
33
import { Helmet } from "react-helmet";
44

55
import LampToggle from "../LampToggle/LampToggle";
6+
import { makeAppTitle } from "../../utils/makeAppTitle";
67

78
import "./Header.scss";
89

@@ -39,7 +40,7 @@ function Header({ config }) {
3940
return (
4041
<>
4142
<Helmet>
42-
<title>{site.title}</title>
43+
<title>{makeAppTitle(site)}</title>
4344
<meta name="description" content={site.description} />
4445
<meta property="og:title" content={site.title} />
4546
<meta property="og:description" content={site.description} />

src/components/Layout/Layout.jsx

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { BrowserRouter, Routes, Route, Navigate, useLocation } from "react-route
33

44
import { loadConfig } from "../../utils/loadConfig";
55
import { loadTheme } from "../../utils/loadTheme";
6-
import { makeAppTitle } from "../../utils/makeAppTitle";
76

87
import Header from "../Header/Header";
98
import HomeView from "../HomeView/HomeView";
@@ -34,36 +33,7 @@ function Layout() {
3433
.catch(setError);
3534
}, []);
3635

37-
useEffect(() => {
38-
if (config?.site) {
39-
document.title = makeAppTitle(config.site);
40-
41-
const metaDescription = document.createElement("meta");
42-
metaDescription.name = "description";
43-
metaDescription.content = config.site.description;
44-
document.head.appendChild(metaDescription);
45-
46-
const ogTitle = document.createElement("meta");
47-
ogTitle.setAttribute("property", "og:title");
48-
ogTitle.content = config.site.title;
49-
document.head.appendChild(ogTitle);
50-
51-
const ogDescription = document.createElement("meta");
52-
ogDescription.setAttribute("property", "og:description");
53-
ogDescription.content = config.site.description;
54-
document.head.appendChild(ogDescription);
55-
56-
const ogUrl = document.createElement("meta");
57-
ogUrl.setAttribute("property", "og:url");
58-
ogUrl.content = config.site.url;
59-
document.head.appendChild(ogUrl);
6036

61-
const ogType = document.createElement("meta");
62-
ogType.setAttribute("property", "og:type");
63-
ogType.content = "website";
64-
document.head.appendChild(ogType);
65-
}
66-
}, [config]);
6737

6838
if (error) {
6939
return <div style={{ padding: "1rem", color: "red" }}>

0 commit comments

Comments
 (0)