Skip to content

fix: add missing SEO meta tags to metadata.svelte and news/[slug]#2946

Draft
10-trix wants to merge 1 commit intoOWASP:masterfrom
10-trix:fix/navbar-seo-ally
Draft

fix: add missing SEO meta tags to metadata.svelte and news/[slug]#2946
10-trix wants to merge 1 commit intoOWASP:masterfrom
10-trix:fix/navbar-seo-ally

Conversation

@10-trix
Copy link
Copy Markdown
Contributor

@10-trix 10-trix commented May 8, 2026

Description

Fixes missing SEO meta tags on two pages:

  1. src/lib/components/metadata.svelte — added og:title, og:description,
    twitter:title, and twitter:description which were absent from the global
    metadata component.

  2. src/routes/news/[slug]/+page.svelte — replaced the minimal <svelte:head>
    block (which only had a broken canonical pointing to /news) with a full set
    of SEO meta tags using the blogpost's title, path, and markdown content.

Resolves: #2194

AI Tool Disclosure

  • My contribution does not include any AI-generated content
  • My contribution includes AI-generated content, as disclosed below:
    • AI Tools: [e.g. GitHub CoPilot, ChatGPT, JetBrains Junie etc.]
    • LLMs and versions: [e.g. GPT-4.1, Claude Haiku 4.5, Gemini 2.5 Pro etc.]
    • Prompts: [Summarize the key prompts or instructions given to the AI tools]

Affirmation

@Adarshkumar0509
Copy link
Copy Markdown
Contributor

see i have a doubt twitter:title and twitter:description appear twice in the HTML once from the global metadata.svelte and once from the article page. Duplicate meta tags cause unpredictable behavior in search engines and social platforms?

@10-trix
Copy link
Copy Markdown
Contributor Author

10-trix commented May 8, 2026

@Adarshkumar0509 Thankyou for asking.As i knew that SvelteKit automatically deduplicates the head tags, so i thought it will not be a problem for Search Engines practicaly but you have stated a correct point it might create a Unexpected Behaviour for the Social media platforms as they rendered by the Server Side.
I will reomove the title/description from metadata.svelte and keep only true Global Tags there.
Thankyou!

@Adarshkumar0509
Copy link
Copy Markdown
Contributor

overall i think its fine i think @ANNI160 , @immortal71 and @muhammad7865 will take a look.

@ANNI160
Copy link
Copy Markdown
Contributor

ANNI160 commented May 8, 2026

Great catch, @Adarshkumar0509 ! And perfect response, @10-trix. You are right that SvelteKit tries to deduplicate svelte:head elements, but social media scrapers (like Twitter and LinkedIn bots) can be notoriously picky if they see competing tags in the raw SSR HTML.

Keeping the dynamic title/description tags strictly on the individual page level and leaving only the static, site-wide tags in metadata.svelte is definitely the safest architecture.

Go ahead and push that update, @10-trix. Once it is up, I will pull your branch locally, inspect the compiled DOM, and give it a final QA check before we mark it ready for Johan. Great teamwork, guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redesign for cornucopia.owasp.org

3 participants