Skip to content
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

Generate fallback og:description #126

Open
wincent opened this issue Sep 30, 2017 · 0 comments
Open

Generate fallback og:description #126

wincent opened this issue Sep 30, 2017 · 0 comments

Comments

@wincent
Copy link
Owner

wincent commented Sep 30, 2017

Consider an article like: https://wincent.com/blog/languages

I didn't define a description, so FB infers this one:

Searching for the Holy Grail2017-7-20I recently came to the conclusion that, when it comes to programming languages, there is no Holy Grail, just a bunch of cups, and perhaps we should just get on with drinking. I've worked with a lot of languages over the years. I started as a 10-year-old writing i...

I think we can do better than that. Basically grab the body, could even grab the HTML of it, then strip the tags to get back to the plain-text. In this case, we could produce a description similar to this:

I recently came to the conclusion that, when it comes to programming languages, there is no Holy Grail, just a bunch of cups, and perhaps we should just get on with drinking. I've worked with a lot of languages over the years. I started as a 10-year-old writing i...

Could optionally use some heuristics like preferring to stop after a period if that won't make the excerpt too short.

See also:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant