diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index 411b9f98..944ccdc0 100644 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -1,9 +1,6 @@ - - - <% let title = page.title; if (is_archive()) { @@ -21,12 +18,18 @@ title = __(page.title); } %> - - <% if (title) { %> - <%= title %> | - <% } %> - <%= theme?.base_info?.title || config?.title || 'Keep Theme' %> - + <% + const ogOptions = { title: title || config.title } + const cover = page?.cover || page?.post_cover || page?.page_cover || page?.home_cover + if (cover) ogOptions.image = getPostCoverUrl(page, cover) + %> + <%- open_graph(ogOptions) %> + <% if (page?.keywords || config?.keywords) { %> + + <% } %> + + + <%= title ? title + ' | ' : '' %><%= theme?.base_info?.title || config?.title || 'Keep Theme' %> <%- css('css/style') %> <% if (theme?.base_info?.favicon) { %> <%- favicon_tag(theme?.base_info?.favicon) %>