Fix error for null theme.open_graph.options (#470)

This commit is contained in:
Ljcbaby 2022-02-27 12:06:17 +08:00 committed by GitHub
parent 0533489746
commit f4969a4e36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -77,7 +77,6 @@ creative_commons:
open_graph:
enable: true
options:
type: website
#twitter_card: <twitter:card>
#twitter_id: <twitter:creator>
#twitter_site: <twitter:site>

View File

@ -1,5 +1,9 @@
{%- if theme.open_graph.enable %}
{{ open_graph(theme.open_graph.options) }}
{%- if theme.open_graph.options %}
{{ open_graph(theme.open_graph.options) }}
{%- else %}
{{ open_graph() }}
{%- endif %}
{%- endif %}
{# https://github.com/theme-next/hexo-theme-next/issues/866 #}