-
-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add meta og tags #39
base: main
Are you sure you want to change the base?
Add meta og tags #39
Conversation
adds meta section to support social sharing if meta vars found. three new variables used: meta.description, meta.url, and meta.twitter reuses variables: title, image
adds meta section to support social sharing if meta vars found. three new variables used: meta.description, meta.url, and meta.twitter reuses variables: title, image
adds meta section to support social sharing if meta vars found. three new variables used: meta.description, meta.url, and meta.twitter reuses variables: title, image
adds meta section to support social sharing if meta vars found. three new variables used: meta.description, meta.url, and meta.twitter reuses variables: title, image
add meta to yaml
add meta to yaml
add meta to yaml
add meta to yaml
remove dashes
remove dashes
remove dashes
remove dashes
add quotes around variables in meta tags
add twitter at
deal with literal at
deal with literal at
deal with literal at
removes self close meta
add closing meta tags
add url to image meta
fixes meta tags and adds url to image
close jolla meta tags and add url image
close meta tags and add image url
explains the meta options in readme
This would be a good place to try a template partial: https://pandoc.org/MANUAL.html#partials |
<meta name="twitter:url" content="$meta.url$"></meta> | ||
<meta property="og:url" content="$meta.url$"></meta> | ||
<meta name="twitter:image:src" content="$meta.url$/$image$"></meta> | ||
<meta property="og:image" content="$meta.url$/$image$"></meta> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to og:image
, I recommend that postcards also support the og:image:alt
and twitter:image:alt
tags as well. One option would be to add image_alt
or meta.image_alt
(or both) to the YAML:
meta:
description: "floatplane data artist"
url: "example.com"
twitter: "yourname"
image: https://example.com/social.png
image_alt: Short description of social card image.
image: avatar.png
image_alt: Short description of avatar image.
The two tags to add would be something like
<meta name="twitter:image:alt" content="$if(meta.image_alt)$$meta.image_alt$$else$$image_alt$$endif$"/>
<meta property="og:image:alt" content="$if(meta.image_alt)$$meta.image_alt$$else$$image_alt$$endif$"/>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relatedly, image_alt
could be added here
<img src="$image$" style="height:15rem" class="rounded float-right"> |
removes alternative for editing resulting file responding to code review
makes twitter creator conditional on twitter
makes twitter conditional
incorporates alternative urls Co-authored-by: Garrick Aden-Buie <garrick@adenbuie.com>
adds twitter conditional
adds twitter conditional
changes all templates in Pandoc (html) and skeleton (rmd) to allow for automatic meta/og tags without installing another package.
closes #32
relies on the already included
title
andimage
information.Using this in the yaml:
**results in this in the html header: **
and this twitter card: