Closed lupinia closed 1 year ago
EDIT: This comment is obsolete, see next comment for current to-do list.
Implementation plan/ideas:
{{ super }}
variable), or include a sub-template. Specific meta tag data sources:
og:image:secure_url
, og:image:type
, og:image:width
, og:image:height
. website
. If content derives from a deertrees.leaf
object, use article
and include extra tags accordingly. summary
. If content type is sunset.image
, use summary_large_image
. .get_absolute_url()
method will be useful on some content types, but not all of them (especially static/special pages). awi_utils.context_processors.settings_vars
to include this). deertrees.leaf.timestamp_post
. deertrees.leaf.timestamp_mod
. deertrees.leaf.owner
. deertrees.leaf.cat
(immediate parent category). Tags in template:
og:title
tag in base templatetwitter:title
tag in base templateog:type
tag in base templatetwitter:card
tag in base templateog:url
tag in base templateog:description
tag in base templatetwitter:description
tag in base templateog:locale
tag in base templateog:site_name
tag in base templateog:image
tag in base templatetwitter:image
tag in base templateog:image:secure_url
tag in base templateog:image:type
tag in base templateog:image:width
tag in base templateog:image:height
tag in base templateog:image:alt
tag in base templateog:article:published_time
tag in base templateog:article:modified_time
tag in base templateog:article:author
tag in base templateog:article:section
tag in base templateog:article:tag
tags in base template (loop)twitter:site
tag in base templatetwitter:creator
tag in base template?Data population:
og:title
and twitter:title
from main site title - see #88 og:description
and twitter:description
from main site description - see #89 og:type
set to website
by defaultog:type
set to article
for content that extends deertrees.leaf
twitter:card
set to summary
by defaulttwitter:card
set to summary_large_image
on Sunset imagesog:url
set to object's get_absolute_url()
value on content that extends deertrees.leaf
og:url
set to current request URL as a fallback defaultog:locale
set to primary language from settings.py
og:site_name
set to default from settings.py
twitter:site
set to default from settings.py
og:image
and twitter:image
and sub-tags set from Sunset background system (see #65)og:image:secure_url
og:article:published_time
and og:article:modified_time
set from base timestamps in deertrees.leaf
contentog:article:author
from article author data (need to look into this more)twitter:creator
tag removed when article author isn't meog:article:section
from parent category of deertrees.leaf
contentog:article:tag
list from deertrees.leaf
content tagsdeertrees.leaf
in meta tags (URLs are incomplete)The implementation of this is mostly done! Yay! Everything works on the actual content pages and the homepage - aka the URLs most likely to be shared - and two of the four related issues are complete. It'll take some time for Twitter and Facebook to re-cache the robots.txt
file for cdn.fur.vc
(they appear to be the only sites that need to be explicitly allowed in this manner) before things will start working correctly there, but given that I don't personally use either service anymore, that's fine.
I still need to finish the other two related issues - moving title and description blocks - before I can call this done, and there are some complicated views that will need some attention. But the "minimum viable product" version of this new functionality is live and ready to use!
Since the only tasks remaining are enhancements to functionality that is now implemented, I think I can finally call this one done! This was a much bigger project than I expected, and I expected it to be huge, but I cleared out a lot of technical debt in the process, and it was worth the effort to make the site more useful and improve the quality of my link previews :)
I thought I already had an issue for this, but it's been on the to-do list for years: Most social media platforms and chat services will pick up the meta description tag for a preview of text content, but it takes an extra step to get an image to show up in the preview. Since the methods for doing this are a little more standardized than they used to be, I'm hoping it won't be prohibitively difficult to implement (famous last words).