From 0b73491db02d11d824cf2cf850be8bb4fb1386c2 Mon Sep 17 00:00:00 2001 From: Ljcbaby <46277145+ljcbaby@users.noreply.github.com> Date: Mon, 7 Feb 2022 18:03:18 +0800 Subject: [PATCH] Support customize open_graph information (#448) --- _config.yml | 7 +++++++ layout/_partials/head/head-unique.njk | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/_config.yml b/_config.yml index d796b34..d3a023e 100644 --- a/_config.yml +++ b/_config.yml @@ -72,6 +72,13 @@ creative_commons: # CC licenses are available in 39 languages, you can find the specific and correct abbreviation you need on https://creativecommons.org language: +# Open graph settings +# See: https://hexo.io/docs/helpers#open-graph +open_graph: + enable: true + # Add pairs each line to customize + options: '' + # --------------------------------------------------------------- # Menu Settings diff --git a/layout/_partials/head/head-unique.njk b/layout/_partials/head/head-unique.njk index 14505f6..5fe40ce 100644 --- a/layout/_partials/head/head-unique.njk +++ b/layout/_partials/head/head-unique.njk @@ -1,4 +1,6 @@ -{{ open_graph() }} +{%- if theme.open_graph.enable %} + {{ open_graph(theme.open_graph.options) }} +{%- endif %} {# https://github.com/theme-next/hexo-theme-next/issues/866 #} {%- set canonical = url | replace(r/index\.html$/, '') %}