hugo-dream-plus icon indicating copy to clipboard operation
hugo-dream-plus copied to clipboard

add Open Graph protocol

Open blue-bird1 opened this issue 7 years ago • 3 comments

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Telegram and fackbook can't display my blog preview because Open Graph protocol is not supported.

Describe the solution you'd like
A clear and concise description of what you want to happen. http://ogp.me/. Just add a few meta tags

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

blue-bird1 avatar Feb 21 '19 06:02 blue-bird1

Thanks for the feature request. As of now I don't have the time, but I will look into this when I'll be free, after a couple of months or so.

UtkarshVerma avatar Feb 21 '19 12:02 UtkarshVerma

Self note: https://gohugo.io/templates/internal/#configure-open-graph

UtkarshVerma avatar May 29 '19 14:05 UtkarshVerma

It's also very easy to implement ogp manually, I looked at the hugo module and found it to be clumsy and adding a lot of boilerplate.

{{ if isset .Params "cover" }}
  <meta property="og:title" content="{{- .Params.title | plainify -}}" />
  <meta property="og:image" content="{{- .Site.Params.baseURL -}}{{- .Params.cover -}}" />
{{ else }}
    <meta property="og:title" content="{{- .Site.Params.title | plainify -}}" />
    <meta property="og:image" content="{{- .Site.Params.baseURL -}}{{- .Site.Params.cover -}}" />
{{ end }}

https://github.com/FAUSheppy/atlantishq-blog-dreamplus/commit/88859ea8b81908e8c4c4854807166901c6fcef43

FAUSheppy avatar Jun 01 '19 18:06 FAUSheppy