I’ve searched the forum for this issue but couldn’t find previous discussions.
I can reproduce the behaviour in a vault with no 3rd-party plugins, and with the default theme.
Steps to reproduce
Add the following metadata block to the top of any Obsidian file:
---
description: An introduction to our solar system.
---
Yes, everything except trying the Sandbox vault (since this issue relates to Obsidian Publish, and I’m otherwise running on a new vault with no 3rd-party plugins).
Expected result
According to the relevant documentation, this description should then override the auto-generated description in <meta name="description" content="...">
and the equivalents for og: description
, etc.
Actual result
The page’s source shows that the custom metadata is consistently ignored and only the auto-generated description is used (“Page name - Powered by Obsidian Publish.”).
This seems to occur for both YAML and JSON metadata.
Other metadata tags (notably permalink
) do have the intended effect, so it does seem that the metadata block is being parsed.
Environment
SYSTEM INFO:
Obsidian version: v1.3.5
Installer version: v1.3.5
Operating system: Darwin Kernel Version 21.6.0: Mon Aug 22 20:20:05 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T8101 21.6.0
Login status: logged in
Catalyst license: none
Insider build toggle: off
Live preview: on
Legacy editor: off
Base theme: light
Community theme: none
Snippets enabled: 0
Restricted mode: on
1 Like
The description only affects the social cards not the html get see when you use a regular browser.
So do social card work correctly for your website?
Hi WhiteNoise, thanks for the quick reply!
The description only affects the social cards not the html
Apologies if I’m misunderstanding something, but the the linked documentation states:
description overrides the auto-generated
description in ‹meta name="description"
content="..."> and the equivalents for
og: description and twitter: description.
So this appears to indicate that both the social and page description should be replaced?
In any case, even if this feature were intended to only replace the social description - the content (“An introduction to our solar system”) would still need to be present in the rendered HTML since that’s where the og:description
information is provided.
The rendered page HTML does have the necessary description
and og:description
meta
tags, the tag content is just wrong (it’s the default auto-generated content).
So do social card work correctly for your website?
No, the social card’s description is also broken (using the default auto-generated content).
To be very clear, rendered pages currently include the following HTML:
<meta name="description" content="PageName - MySite.com - Powered by Obsidian Publish.">
<meta property="og:description" content="PageName - MySite.com - Powered by Obsidian Publish.">
But should instead include the following HTML:
<meta name="description" content="An introduction to our solar system.">
<meta property="og:description" content="An introduction to our solar system.">
3 Likes
I need this for SEO as well! It doesn’t work as expected for me according to this documentation: Social media link previews - Obsidian Help
The returned html depends on the client who is making the request. The browsers get one version, the the social media description crawler gets another.
So you cannot look at the html from the browser and draw the conclusion that it doesn’t work.
I’ll update the docs to make this clear.
The returned html depends on the client. The browsers get one version, the the social media description crawler gets another.
So you cannot look at the html from the browser and draw the conclusion that it’s wrong.
Like I mentioned, social cards are (or at least were) showing the same broken info - so one need not look at browser HTML to draw the conclusion.
I ended up needing to switch away from Obsidian, so unfortunately can’t provide further info on this myself.