oleeskild / obsidian-digital-garden

MIT License
1.33k stars 124 forks source link

meta tags not working #203

Open katat opened 1 year ago

katat commented 1 year ago

The following meta tags don't seem to work. They don't show up as meta tags in the HTML header section. Any ideas of what went wrong in my settings?

dg-meta-tags:
 "description": "a description"
 "og:image": "https://obsidian-digital-garden-front.vercel.app/img/user/tumblr_pep7kan09p1qbgdnxo1_1280.png"
timfong888 commented 1 year ago

I have had the same problem. I looked through the repo to see where it would write "meta" in the html markdown but don't see where it would do this, just how it would parse meta tags.

GJRobert commented 1 year ago

Same here. Thanks!

GJRobert commented 1 year ago

Oh my goodness!!! dg-metatags works!!! metatags metatags metatags (no hyphen)

I guess this issue can be closed once the official doc is modified to correspond the working frontmatter tag.


By the way, a great "default" og:image method to check out: topobon/002-og-image.njk at main · uroybd/topobon · GitHub

Put the default cover photo in src/site/img.

timfong888 commented 1 year ago

Thanks for figuring this oh, how did you know?

On Mon, May 1, 2023 at 1:45 PM GHSRobert Ciang @.***> wrote:

Oh my goodness!!! dg-metatags works!!! metatags metatags metatags (no hyphen)

I guess this issue can be closed once the official doc is modified to correspond the working frontmatter tag.

By the way, a great "default" og:image method to check out: topobon/002-og-image.njk at main · uroybd/topobon · GitHub https://github.com/uroybd/topobon/blob/main/src/site/_includes/components/user/common/head/002-og-image.njk

Put the default cover photo in src/site/img.

— Reply to this email directly, view it on GitHub https://github.com/oleeskild/obsidian-digital-garden/issues/203#issuecomment-1530224776, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAADNZ5E5P7VF7WXJCHXWILXEAOGVANCNFSM6AAAAAAVBRPM7U . You are receiving this because you commented.Message ID: @.***>

-- [image: photo-logo] Tim Fong

phone: 415-508-6888 email: @.*** calendar: https://calendar.fong888.com

[image: banner] https://img.newoldstamp.com/r/92647/b

timfong888 commented 1 year ago

I had looked at the code and saw the loop for in metatags, but I didn't make the connection to 'dg-metatags'. I guess I was reading the code wrong.

GJRobert commented 1 year ago

I have to thank @topobon , for in his topobon/002-og-image.njk at main · uroybd/topobon · GitHub he had written metatags, so I made a guess that perhaps @oleeskild put a redundant hyphen in the document. Luckily, we got out of the issue 🙂

timfong888 commented 1 year ago

I added the front matter and not getting the meta tags to work.

my site

timfong888 commented 1 year ago

Oh we add that .njk file to have a default image? That's not existing in the original code?

Btw, what does it mean 'if metatags' if the yank is dg-metatags?

oleeskild commented 1 year ago

Well, now I feel dumb 😅 ! Sorry for not spotting this and causing the confusion. You are correct @GJRobert, it is "dg-metatags", not "dg-meta-tags". The docs were wrong, I've updated them now. I should have caught this much earlier, but I'm a bit overwhelmed with the number of open issues, so things are moving a bit slow. Thank you for sharing the solution!

@timfong888 Can you send a screenshot or a of the note you are using, that doesn't work?

timfong888 commented 1 year ago

@oleeskild The Platform Product Manager Series - Public Essays - Obsidian v1 2 7 2023-05-02 at 3 52 18 PM

GJRobert commented 1 year ago

@timfong888 How many spaces do you have before "description" and "og:image"? @oleeskild has said that only one space works.

timfong888 commented 1 year ago

I only have one space (not tab)....

On Wed, May 3, 2023 at 5:15 AM GHSRobert Ciang @.***> wrote:

@timfong888 https://github.com/timfong888 How many spaces do you have before "description" and "og:image"? @oleeskild https://github.com/oleeskild has said that only one space works.

— Reply to this email directly, view it on GitHub https://github.com/oleeskild/obsidian-digital-garden/issues/203#issuecomment-1532921956, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAADNZ3UIKGDKTSILWCXP7DXEJD6RANCNFSM6AAAAAAVBRPM7U . You are receiving this because you were mentioned.Message ID: @.***>

GJRobert commented 1 year ago

There is indeed no og:image <meta> tag in your generated HTML codes. Weird. How about try real image value in your og:image metadata? (I've found that quotes are not necessary)

GJRobert commented 1 year ago

By the way, just don't use that 002-og-image.njk yet, because I was just thanking for giving me inspiration about the correct spelling as metatags. Please make sure you take that .njk file down for now, until your first problem is solved.

timfong888 commented 1 year ago

Thanks, I think it works now: https://essays.fong888.com/the-graph-indexer/

Will keep playing but we're getting closer!

On Wed, May 3, 2023 at 5:11 PM GHSRobert Ciang @.***> wrote:

By the way, just don't use that 002-og-image.njk yet, because I was just thanking for giving me inspiration about the correct spelling as metatags. Please make sure you take that .njk file down for now, until your first problem is solved.

— Reply to this email directly, view it on GitHub https://github.com/oleeskild/obsidian-digital-garden/issues/203#issuecomment-1533903004, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAADNZ6Z6FMFUNCKKCTUZC3XELXZZANCNFSM6AAAAAAVBRPM7U . You are receiving this because you were mentioned.Message ID: @.***>

-- [image: photo-logo] Tim Fong

phone: 415-508-6888 email: @.*** calendar: https://calendar.fong888.com

[image: banner] https://img.newoldstamp.com/r/92647/b

GJRobert commented 1 year ago

Great to hear that @timfong888

GJRobert commented 1 year ago

I guess this can be closed @oleeskild Digital Garden is easy to use and I like it :) Thank you.