From b1d6f3896d45071c2fd23c8db27ab45d2d76e326 Mon Sep 17 00:00:00 2001 From: bigfa Date: Fri, 14 Jun 2024 16:01:06 +0800 Subject: [PATCH] feat:add open graph meta --- README.md | 7 +- README_CN.md | 7 +- languages/farallon.pot | 236 +++++++++++++++++++++-------------------- languages/zh_CN.mo | Bin 8952 -> 9221 bytes languages/zh_CN.po | 16 ++- modules/base.php | 16 ++- modules/setting.php | 6 ++ style.css | 2 +- 8 files changed, 167 insertions(+), 123 deletions(-) diff --git a/README.md b/README.md index 94a3096..7e2092d 100755 --- a/README.md +++ b/README.md @@ -6,12 +6,17 @@ Farallon is a simple single column wordpress theme with perfect performace and e [中文说明](https://github.com/bigfa/Farallon/blob/develop/README_CN.md) -latest version : `0.6.9` +latest version : `0.7.0` [Simple User Guide(Chinese)](https://fatesinger.com/101971) ## Changelog +### 0.7.0 + +- update translation +- add open graph meta + ### 0.6.9 - set `wp caption` style diff --git a/README_CN.md b/README_CN.md index 0f80a21..183d875 100755 --- a/README_CN.md +++ b/README_CN.md @@ -2,7 +2,7 @@ ![Wordpress 主题 Farallon](https://static.fatesinger.com/2023/06/u1ak8xgmyn9ec24r.png) -最新版本: `0.6.9` +最新版本: `0.7.0` 本主题禁止各种修改作者链接打包重新发布的行为。 @@ -10,6 +10,11 @@ ## 更新日志 +### 0.7.0 + +- 更新翻译 +- 增加 Open Graph 标签 + ### 0.6.9 - 兼容 `wp caption` 样式 diff --git a/languages/farallon.pot b/languages/farallon.pot index ce8e1e7..e04b748 100644 --- a/languages/farallon.pot +++ b/languages/farallon.pot @@ -2,14 +2,14 @@ # This file is distributed under the . msgid "" msgstr "" -"Project-Id-Version: Farallon 0.6.9\n" +"Project-Id-Version: Farallon 0.7.0\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/theme/Farallon\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2024-06-14T06:06:26+00:00\n" +"POT-Creation-Date: 2024-06-14T07:57:17+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.10.0\n" "X-Domain: Farallon\n" @@ -73,100 +73,100 @@ msgid "Use Card Template" msgstr "" #: modules/base.php:149 -#: modules/setting.php:408 +#: modules/setting.php:414 msgid "Table of content" msgstr "" -#: modules/base.php:170 +#: modules/base.php:173 msgid "author" msgstr "" -#: modules/base.php:170 +#: modules/base.php:173 msgid "published on" msgstr "" -#: modules/base.php:192 -#: modules/base.php:194 +#: modules/base.php:203 +#: modules/base.php:205 msgid "Homepage Top" msgstr "" -#: modules/base.php:202 -#: modules/base.php:204 +#: modules/base.php:213 +#: modules/base.php:215 msgid "Homepage Bottom" msgstr "" -#: modules/base.php:212 -#: modules/base.php:214 +#: modules/base.php:223 +#: modules/base.php:225 msgid "Single Pgae Bottom" msgstr "" -#: modules/base.php:255 +#: modules/base.php:266 #: modules/setting.php:47 msgid "Setting saved success!" msgstr "" -#: modules/base.php:256 +#: modules/base.php:267 #: modules/setting.php:48 msgid "Upload Image" msgstr "" -#: modules/base.php:257 +#: modules/base.php:268 msgid "Set Category Image" msgstr "" -#: modules/base.php:296 +#: modules/base.php:307 msgid "second ago" msgstr "" -#: modules/base.php:297 +#: modules/base.php:308 msgid "seconds ago" msgstr "" -#: modules/base.php:298 +#: modules/base.php:309 msgid "minute ago" msgstr "" -#: modules/base.php:299 +#: modules/base.php:310 msgid "minutes ago" msgstr "" -#: modules/base.php:300 +#: modules/base.php:311 msgid "hour ago" msgstr "" -#: modules/base.php:301 +#: modules/base.php:312 msgid "hours ago" msgstr "" -#: modules/base.php:302 +#: modules/base.php:313 msgid "day ago" msgstr "" -#: modules/base.php:303 +#: modules/base.php:314 msgid "days ago" msgstr "" -#: modules/base.php:304 +#: modules/base.php:315 msgid "week ago" msgstr "" -#: modules/base.php:305 +#: modules/base.php:316 msgid "weeks ago" msgstr "" -#: modules/base.php:306 +#: modules/base.php:317 msgid "month ago" msgstr "" -#: modules/base.php:307 +#: modules/base.php:318 msgid "months ago" msgstr "" -#: modules/base.php:308 +#: modules/base.php:319 msgid "year ago" msgstr "" -#: modules/base.php:309 +#: modules/base.php:320 msgid "years ago" msgstr "" @@ -241,347 +241,355 @@ msgid "Logo address, preferably in a square shape." msgstr "" #: modules/setting.php:247 -msgid "Favicon" +msgid "Og default thumb" msgstr "" #: modules/setting.php:248 -msgid "Favicon address" +msgid "Og meta default thumb address." msgstr "" #: modules/setting.php:253 -msgid "Title sep" +msgid "Favicon" msgstr "" #: modules/setting.php:254 -msgid "Default is" +msgid "Favicon address" msgstr "" #: modules/setting.php:259 -msgid "Disable block css" +msgid "Title sep" msgstr "" #: modules/setting.php:260 -msgid "Do not load block-style files." +msgid "Default is" msgstr "" #: modules/setting.php:265 -msgid "Gravatar proxy" +msgid "Disable block css" msgstr "" #: modules/setting.php:266 +msgid "Do not load block-style files." +msgstr "" + +#: modules/setting.php:271 +msgid "Gravatar proxy" +msgstr "" + +#: modules/setting.php:272 msgid "Gravatar proxy domain,like cravatar.cn" msgstr "" -#: modules/setting.php:276 +#: modules/setting.php:282 msgid "Update notice" msgstr "" -#: modules/setting.php:277 +#: modules/setting.php:283 msgid "Get theme update notice." msgstr "" -#: modules/setting.php:282 +#: modules/setting.php:288 msgid "Upyun CDN" msgstr "" -#: modules/setting.php:283 +#: modules/setting.php:289 msgid "Make sure all images are uploaded to Upyun, otherwise thumbnails may not display properly." msgstr "" -#: modules/setting.php:288 +#: modules/setting.php:294 msgid "Aliyun OSS CDN" msgstr "" -#: modules/setting.php:289 +#: modules/setting.php:295 msgid "Make sure all images are uploaded to Aliyun OSS, otherwise thumbnails may not display properly." msgstr "" -#: modules/setting.php:294 +#: modules/setting.php:300 msgid "Qiniu OSS CDN" msgstr "" -#: modules/setting.php:295 +#: modules/setting.php:301 msgid "Make sure all images are uploaded to Qiniu OSS, otherwise thumbnails may not display properly." msgstr "" -#: modules/setting.php:300 +#: modules/setting.php:306 msgid "Dark Mode" msgstr "" -#: modules/setting.php:301 +#: modules/setting.php:307 msgid "Enable dark mode" msgstr "" -#: modules/setting.php:306 +#: modules/setting.php:312 msgid "Default thumbnail" msgstr "" -#: modules/setting.php:307 +#: modules/setting.php:313 msgid "Default thumbnail address" msgstr "" -#: modules/setting.php:312 +#: modules/setting.php:318 msgid "Back to top" msgstr "" -#: modules/setting.php:313 +#: modules/setting.php:319 msgid "Enable back to top" msgstr "" -#: modules/setting.php:318 +#: modules/setting.php:324 msgid "Load more" msgstr "" -#: modules/setting.php:319 +#: modules/setting.php:325 msgid "Enable load more" msgstr "" -#: modules/setting.php:324 +#: modules/setting.php:330 msgid "Author info" msgstr "" -#: modules/setting.php:325 +#: modules/setting.php:331 msgid "Enable author info in homepage" msgstr "" -#: modules/setting.php:330 +#: modules/setting.php:336 msgid "Category info" msgstr "" -#: modules/setting.php:331 +#: modules/setting.php:337 msgid "Enable category info in homepage" msgstr "" -#: modules/setting.php:336 +#: modules/setting.php:342 msgid "Like info" msgstr "" -#: modules/setting.php:337 +#: modules/setting.php:343 msgid "Enable like info in homepage" msgstr "" -#: modules/setting.php:342 -#: modules/setting.php:343 +#: modules/setting.php:348 +#: modules/setting.php:349 msgid "Hide home cover" msgstr "" -#: modules/setting.php:348 +#: modules/setting.php:354 msgid "Exclude status" msgstr "" -#: modules/setting.php:349 +#: modules/setting.php:355 msgid "Exclude post type status in homepage" msgstr "" -#: modules/setting.php:360 +#: modules/setting.php:366 msgid "Author bio" msgstr "" -#: modules/setting.php:361 +#: modules/setting.php:367 msgid "Enable author bio" msgstr "" -#: modules/setting.php:366 +#: modules/setting.php:372 msgid "Author sns icons" msgstr "" -#: modules/setting.php:367 +#: modules/setting.php:373 msgid "Show author sns icons, will not show when author bio is off." msgstr "" -#: modules/setting.php:372 +#: modules/setting.php:378 msgid "Related posts" msgstr "" -#: modules/setting.php:373 +#: modules/setting.php:379 msgid "Enable related posts" msgstr "" -#: modules/setting.php:378 +#: modules/setting.php:384 msgid "Post like" msgstr "" -#: modules/setting.php:379 +#: modules/setting.php:385 msgid "Enable post like" msgstr "" -#: modules/setting.php:384 +#: modules/setting.php:390 msgid "Post navigation" msgstr "" -#: modules/setting.php:385 +#: modules/setting.php:391 msgid "Enable post navigation" msgstr "" -#: modules/setting.php:390 +#: modules/setting.php:396 msgid "Copy link" msgstr "" -#: modules/setting.php:391 +#: modules/setting.php:397 msgid "Enable copy link" msgstr "" -#: modules/setting.php:396 +#: modules/setting.php:402 msgid "Category card" msgstr "" -#: modules/setting.php:397 +#: modules/setting.php:403 msgid "Show post category info after post." msgstr "" -#: modules/setting.php:402 +#: modules/setting.php:408 msgid "Show parent comment" msgstr "" -#: modules/setting.php:403 +#: modules/setting.php:409 msgid "Enable show parent comment" msgstr "" -#: modules/setting.php:409 +#: modules/setting.php:415 msgid "Enable table of content" msgstr "" -#: modules/setting.php:414 +#: modules/setting.php:420 msgid "Start heading" msgstr "" -#: modules/setting.php:415 +#: modules/setting.php:421 msgid "Start heading,default h3" msgstr "" -#: modules/setting.php:420 +#: modules/setting.php:426 msgid "Post Author" msgstr "" -#: modules/setting.php:421 +#: modules/setting.php:427 msgid "Show post author tip in comment" msgstr "" -#: modules/setting.php:426 +#: modules/setting.php:432 msgid "Disable comment link" msgstr "" -#: modules/setting.php:427 +#: modules/setting.php:433 msgid "Disable comment author url" msgstr "" -#: modules/setting.php:432 +#: modules/setting.php:438 msgid "No reply text" msgstr "" -#: modules/setting.php:433 +#: modules/setting.php:439 msgid "Text display when no comment in current post." msgstr "" -#: modules/setting.php:438 +#: modules/setting.php:444 msgid "Friend icon" msgstr "" -#: modules/setting.php:439 +#: modules/setting.php:445 msgid "Show icon when comment author url is in blogroll." msgstr "" -#: modules/setting.php:449 +#: modules/setting.php:455 msgid "Footer SNS Icons" msgstr "" -#: modules/setting.php:450 +#: modules/setting.php:456 msgid "Show sns icons in footer, if this setting is on, the footer menu won',t be displayed." msgstr "" -#: modules/setting.php:455 +#: modules/setting.php:461 msgid "Telegram" msgstr "" -#: modules/setting.php:456 +#: modules/setting.php:462 msgid "Telegram link" msgstr "" -#: modules/setting.php:461 +#: modules/setting.php:467 msgid "Email" msgstr "" -#: modules/setting.php:462 +#: modules/setting.php:468 msgid "Your email address" msgstr "" -#: modules/setting.php:467 +#: modules/setting.php:473 msgid "Instagram" msgstr "" -#: modules/setting.php:468 +#: modules/setting.php:474 msgid "Instagram link" msgstr "" -#: modules/setting.php:473 +#: modules/setting.php:479 msgid "Twitter" msgstr "" -#: modules/setting.php:474 +#: modules/setting.php:480 msgid "Twitter link" msgstr "" -#: modules/setting.php:479 +#: modules/setting.php:485 msgid "RSS" msgstr "" -#: modules/setting.php:480 +#: modules/setting.php:486 msgid "RSS link" msgstr "" -#: modules/setting.php:485 +#: modules/setting.php:491 msgid "Github" msgstr "" -#: modules/setting.php:486 +#: modules/setting.php:492 msgid "Github link" msgstr "" -#: modules/setting.php:491 +#: modules/setting.php:497 msgid "Discord" msgstr "" -#: modules/setting.php:492 +#: modules/setting.php:498 msgid "Discord link" msgstr "" -#: modules/setting.php:497 +#: modules/setting.php:503 msgid "Mastodon" msgstr "" -#: modules/setting.php:498 +#: modules/setting.php:504 msgid "Mastodon link" msgstr "" -#: modules/setting.php:503 +#: modules/setting.php:509 msgid "Custom" msgstr "" -#: modules/setting.php:504 +#: modules/setting.php:510 msgid "Custom sns link,use html." msgstr "" -#: modules/setting.php:514 +#: modules/setting.php:520 msgid "CSS" msgstr "" -#: modules/setting.php:515 +#: modules/setting.php:521 msgid "Custom CSS" msgstr "" -#: modules/setting.php:520 +#: modules/setting.php:526 msgid "Javascript" msgstr "" -#: modules/setting.php:521 +#: modules/setting.php:527 msgid "Custom Javascript" msgstr "" -#: modules/setting.php:526 +#: modules/setting.php:532 msgid "Copyright" msgstr "" -#: modules/setting.php:527 +#: modules/setting.php:533 msgid "Custom footer content" msgstr "" diff --git a/languages/zh_CN.mo b/languages/zh_CN.mo index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45FK~1EluYucaZZn(AH_U^m0b0zDP!szc^$j~?<>$>y z=GCaQxW-L@hCBS@@hRRm?p`9ECX}`i4-%7zI3(Dz-yTd4`2OMG9f1}8 zxnTOO<;-07{EMQDqZb`vuQz5X}SB5w3HDNQD7 ziI)j&-*)0gdWM@vh$bsoio1wng5&Hq5+y_fu~q-6(00uw`Vl&N&l5^DeYoe4Pf|3k z<(fl`Cv-d(6V*f|v5$C)SVt&5=7$o)ffxKSiA9+eeMQl0BiAZ|&rUQIa^2uJC5G=T zvl5O#G|e`}YGOVykyuEqBy_@;_~#PG1)hiuNXm_kRD^#CL~4>_gON!3H-X5fnZ^D7 E2fz{%K>z>% diff --git a/languages/zh_CN.po b/languages/zh_CN.po index 9293227..64de133 100644 --- a/languages/zh_CN.po +++ b/languages/zh_CN.po @@ -208,6 +208,14 @@ msgstr "Logo" msgid "Logo address, preferably in a square shape." msgstr "Logo地址,最好是方形的。" +#: modules/setting.php:247 +msgid "Og default thumb" +msgstr "默认Open Graph 缩略图" + +#: modules/setting.php:248 +msgid "Og meta default thumb address." +msgstr "默认 Open Graph 缩略图地址" + #: modules/setting.php:244 msgid "Favicon" msgstr "Favicon" @@ -414,12 +422,12 @@ msgid "Enable table of content" msgstr "开启文章目录" #: modules/setting.php:414 -msgid "开始层级" -msgstr "" +msgid "Start heading" +msgstr "开始层级" #: modules/setting.php:415 -msgid "文章目录标题开始层级,默认为 h3" -msgstr "" +msgid "Start heading,default h3" +msgstr "文章目录标题开始层级,默认为 h3" #: modules/setting.php:387 msgid "Post Author" diff --git a/modules/base.php b/modules/base.php index c51c3dc..238b573 100755 --- a/modules/base.php +++ b/modules/base.php @@ -154,12 +154,15 @@ function farallon_toc($content) function head_output() { - global $s, $post, $farallonSetting; + global $wp, $post, $farallonSetting; + $current_url = home_url(add_query_arg(array(), $wp->request)); //echo ''; $description = ''; $blog_name = get_bloginfo('name'); + $ogmeta = ''; + $ogmeta .= ''; if (is_singular()) { $ID = $post->ID; $author = $post->post_author; @@ -170,6 +173,9 @@ function head_output() $description = $post->post_title . ',' . __('author', 'Farallon') . ':' . get_the_author_meta('nickname', $author) . ',' . __('published on', 'Farallon') . get_the_date('Y-m-d'); echo ''; } + $ogmeta .= ''; + $ogmeta .= ''; + $ogmeta .= ''; } else { if (is_home()) { $description = $farallonSetting->get_setting('description'); @@ -181,8 +187,14 @@ function head_output() $description = $farallonSetting->get_setting('description'); } $description = mb_substr($description, 0, 220, 'utf-8'); - echo ''; + if ($farallonSetting->get_setting('og_default_thumb')) { + $ogmeta .= ''; + } + if ($description) $ogmeta .= ''; + $ogmeta .= ''; + if ($description) echo ''; } + echo $ogmeta; } function widgets_init() diff --git a/modules/setting.php b/modules/setting.php index 2554f71..4a33bc5 100755 --- a/modules/setting.php +++ b/modules/setting.php @@ -241,6 +241,12 @@ function setting_switch($params) 'label' => __('Logo', 'Farallon'), 'description' => __('Logo address, preferably in a square shape.', 'Farallon'), ], + [ + 'type' => 'input', + 'name' => 'og_default_thumb', + 'label' => __('Og default thumb', 'Farallon'), + 'description' => __('Og meta default thumb address.', 'Farallon'), + ], [ 'type' => 'input', 'name' => 'favicon', diff --git a/style.css b/style.css index c287621..25d1b2f 100755 --- a/style.css +++ b/style.css @@ -4,6 +4,6 @@ Theme URI: https://github.com/bigfa/Farallon Author: bigfa Author URI: https://github.com/bigfa Description: theme 2024 -Version: 0.6.9 +Version: 0.7.0 Tags: Minimalism, Responsive */