Check to see if you're on an Article, then Page, then Podcast, etc, then fallback to the site root.
For page description
Objects
If you're on Article/Page/etc, check to see if there is a .summary, then a .name, then fallback to truncate(thing.content, 200) or something.
Site
If you're not on a particular thing, give a generic site description. (You can use lorem ipsum and we'll get @biofilo to update it.) Put it in en.yml.
For page URL
Use the same heuristic as above, first checking for an object page, then falling back to a generic one for non-object pages. You'll prolly need to create a helper method that returns the right protocol + domain depending on where the app is running.
Objects
To get the URL for object pages, check for the .path method on your object. If not, either create some special cases, use request.path or add .path to models as needed. Or create a path helper. Your call.
Site
Non-object pages should use the site root for the share URL.
http://ogp.me/#types
https://adactio.com/journal/9881
Check to see if you're on an Article, then Page, then Podcast, etc, then fallback to the site root.
For page description
Objects
If you're on Article/Page/etc, check to see if there is a
.summary
, then a.name
, then fallback totruncate(thing.content, 200)
or something.Site
If you're not on a particular thing, give a generic site description. (You can use lorem ipsum and we'll get @biofilo to update it.) Put it in
en.yml
.For page URL
Use the same heuristic as above, first checking for an object page, then falling back to a generic one for non-object pages. You'll prolly need to create a helper method that returns the right protocol + domain depending on where the app is running.
Objects
To get the URL for object pages, check for the
.path
method on your object. If not, either create some special cases, use request.path or add.path
to models as needed. Or create apath
helper. Your call.Site
Non-object pages should use the site root for the share URL.