I'm back, (apologies). I couldn't get micro.blog to generate a test OpenGraph card while editing a template. It looks to be choking on the lack of a space.
File: layouts/opengraph.html
Description
There's a missing space before the {{ if }} block on line 1, which causes two HTML attributes to be concatenated without a separator when custom_avatar is set.
Current code:
htmldata-content-background="#3d4149"{{ if .Site.Params.custom_avatar }} data-avatar-url="{{ .Site.Params.custom_avatar }}"{{ end }}>
When custom_avatar is set, this renders as:
htmldata-content-background="#3d4149"data-avatar-url="https://example.com/avatar.jpg">
Two attributes with no space between them seems to make micro.blog choke on rendering this as an OpenGraph card.
Fix
Add a space before the conditional, it then worked when I tried it:
htmldata-content-background="#3d4149" {{ if .Site.Params.custom_avatar }} data-avatar-url="{{ .Site.Params.custom_avatar }}"{{ end }}>
Thanks!
Mark.
I'm back, (apologies). I couldn't get micro.blog to generate a test OpenGraph card while editing a template. It looks to be choking on the lack of a space.
File: layouts/opengraph.html
Description
There's a missing space before the {{ if }} block on line 1, which causes two HTML attributes to be concatenated without a separator when custom_avatar is set.
Current code:
htmldata-content-background="#3d4149"{{ if .Site.Params.custom_avatar }} data-avatar-url="{{ .Site.Params.custom_avatar }}"{{ end }}>When custom_avatar is set, this renders as:
htmldata-content-background="#3d4149"data-avatar-url="https://example.com/avatar.jpg">Two attributes with no space between them seems to make micro.blog choke on rendering this as an OpenGraph card.
Fix
Add a space before the conditional, it then worked when I tried it:
htmldata-content-background="#3d4149" {{ if .Site.Params.custom_avatar }} data-avatar-url="{{ .Site.Params.custom_avatar }}"{{ end }}>Thanks!
Mark.