UtkarshVerma / hugo-dream-plus

:rainbow: An upgraded version of the Hugo "Dream" theme with tons of new features.
http://dream-plus-posts.netlify.com
MIT License
68 stars 66 forks source link

add Open Graph protocol #59

Open blue-bird1 opened 5 years ago

blue-bird1 commented 5 years ago

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.

UtkarshVerma commented 5 years ago

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 commented 5 years ago

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

FAUSheppy commented 5 years ago

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