From 8451c546b8ee48f3fe2f7c0af2733f1dacc03889 Mon Sep 17 00:00:00 2001
From: i-abc <104631897+i-abc@users.noreply.github.com>
Date: Wed, 29 Mar 2023 12:40:02 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20keywords=20(#280)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
layout/_partial/head.ejs | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs
index 729dbe4..f14ea73 100755
--- a/layout/_partial/head.ejs
+++ b/layout/_partial/head.ejs
@@ -37,6 +37,17 @@ function generate_description() {
}
return '';
}
+function generate_keywords() {
+ if (page.keywords && page.keywords.length > 0) {
+ return '';
+ } else if (page.tags && page.tags.length > 0) {
+ return '';
+ } else if (config.keywords && config.keywords.length > 0) {
+ return '';
+ } else {
+ return '';
+ }
+}
function generate_robots() {
if (is_home() == true) {
@@ -82,6 +93,8 @@ function og_args() {
<%- open_graph(og_args()) %>
<% } %>
<%- generate_description() %>
+
+ <%- generate_keywords() %>
<% if (config.feed && config.feed.path) { %>