Skip to content

Commit

Permalink
feat:add custom twitter_card selection
Browse files Browse the repository at this point in the history
  • Loading branch information
BrotherJie committed Dec 8, 2024
1 parent 54b89c9 commit a89988a
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 65 deletions.
114 changes: 50 additions & 64 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# DEMO: https://redefine.ohevan.com
# <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< end


# BASIC INFORMATION >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> start
# Docs: https://redefine-docs.ohevan.com/basic/info
info:
Expand All @@ -20,19 +19,17 @@ info:
url: https://redefine.ohevan.com
# BASIC INFORMATION <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< end


# IMAGE CONFIGURATION >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> start
# Docs: https://redefine-docs.ohevan.com/basic/defaults
defaults:
# Favicon
favicon: /images/redefine-favicon.svg
# Site logo
logo:
logo:
# Site avatar
avatar: /images/redefine-avatar.svg
# IMAGE CONFIGURATION <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< end


# COLORS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> start
# Docs: https://redefine-docs.ohevan.com/basic/colors
colors:
Expand All @@ -44,27 +41,26 @@ colors:
default_mode: light # light, dark
# COLORS <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< end


# SITE CUSTOMIZATION >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> start
# Docs: https://redefine-docs.ohevan.com/basic/global
global:
# Custom global fonts
fonts:
# Chinese fonts
chinese:
chinese:
enable: false # Whether to enable custom chinese fonts
family: # Font family
url: # Font URL to CSS file
family: # Font family
url: # Font URL to CSS file
# English fonts
english:
english:
enable: false # Whether to enable custom english fonts
family: # Font family
url: # Font URL to CSS file
family: # Font family
url: # Font URL to CSS file
# Custom title fonts (navbar, sidebar)
title:
enable: false # Whether to enable custom title fonts
family: # Font family
url: # Font URL to CSS file
family: # Font family
url: # Font URL to CSS file
# Content max width
content_max_width: 1000px
# Sidebar width
Expand Down Expand Up @@ -93,14 +89,14 @@ global:
# Whether to enable open graph
open_graph:
enable: true
image: /images/redefine-og.webp # default og:image
image: /images/redefine-og.webp # default og:image
description: Hexo Theme Redefine, Redefine Your Hexo Journey.
twitter_card: summary # summary/summary_large_image/app/player
# Google Analytics
google_analytics:
enable: false # Whether to enable Google Analytics
id: # Google Analytics Measurement ID
id: # Google Analytics Measurement ID
# SITE CUSTOMIZATION <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< end


# FONTAWESOME >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> start
# Docs: https://redefine-docs.ohevan.com/basic/fontawesome
Expand All @@ -115,7 +111,6 @@ fontawesome: # Pro v6.2.1
sharp_solid: false
# FONTAWESOME <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< end


# HOME BANNER >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> start
# Docs: https://redefine-docs.ohevan.com/home/home_banner
home_banner:
Expand All @@ -124,15 +119,15 @@ home_banner:
# style of home banner
style: fixed # static or fixed
# Home banner image
image:
image:
light: /images/wallhaven-wqery6-light.webp # light mode
dark: /images/wallhaven-wqery6-dark.webp # dark mode
# Home banner title
title: Theme Redefine
# Home banner subtitle
subtitle:
text: [] # subtitle text, array
hitokoto: # 一言配置
hitokoto: # 一言配置
enable: false # Whether to enable hitokoto
show_author: false # Whether to show author
api: https://v1.hitokoto.cn # API URL, can add types, see https://developer.hitokoto.cn/sentence/#%E5%8F%A5%E5%AD%90%E7%B1%BB%E5%9E%8B-%E5%8F%82%E6%95%B0
Expand All @@ -143,23 +138,23 @@ home_banner:
loop: true # Whether to loop
smart_backspace: true # Whether to smart backspace
# Color of home banner text
text_color:
text_color:
light: "#fff" # light mode
dark: "#d1d1b6" # dark mode
# Specific style of the text
text_style:
text_style:
# Title font size
title_size: 2.8rem
# Subtitle font size
subtitle_size: 1.5rem
# Line height between title and subtitle
line_height: 1.2
# Home banner custom font
custom_font:
custom_font:
# Whether to enable custom font
enable: false
# Font family
family:
family:
# URL to font CSS file
url:
# Home banner social links
Expand All @@ -170,52 +165,51 @@ home_banner:
style: default # default, reverse, center
# Social links
links:
github: # your GitHub URL
github: # your GitHub URL
instagram: # your Instagram URL
zhihu: # your ZhiHu URL
twitter: # your twitter URL
email: # your email
zhihu: # your ZhiHu URL
twitter: # your twitter URL
email: # your email
# ...... # you can add more
# Social links with QRcode drawers
qrs:
weixin: # your Wechat QRcode image URL
weixin: # your Wechat QRcode image URL
# ...... # you can add more
# HOME BANNER <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< end


# NAVIGATION BAR >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> start
# Docs: https://redefine-docs.ohevan.com/home/navbar
navbar:
# Auto hide navbar
auto_hide: false
# Navbar background color
color:
left: "#f78736" #left side
right: "#367df7" #right side
left: "#f78736" #left side
right: "#367df7" #right side
transparency: 35 #percent (10-99)
# Navbar width (usually no need to modify)
width:
home: 1200px #home page
pages: 1000px #other pages
# Navbar links
links:
Home:
path: /
Home:
path: /
icon: fa-regular fa-house # can be empty
# Archives:
# path: /archives
# Archives:
# path: /archives
# icon: fa-regular fa-archive # can be empty
# Status:
# Status:
# path: https://status.ohevan.com/
# icon: fa-regular fa-chart-bar
# About:
# About:
# icon: fa-regular fa-user
# submenus:
# Me: /about
# Github: https://github.com/EvanNotFound/hexo-theme-redefine
# Blog: https://ohevan.com
# Friends: /friends
# Links:
# Links:
# icon: fa-regular fa-link
# submenus:
# Link1: /link1
Expand All @@ -230,7 +224,6 @@ navbar:
preload: true
# NAVIGATION BAR <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< end


# HOME PAGE ARTICLE SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> start
# Docs: https://redefine-docs.ohevan.com/home/home
home:
Expand All @@ -242,14 +235,14 @@ home:
announcement: # Announcement text
show_on_mobile: true # Whether to show sidebar navigation on mobile sheet menu
links:
# Archives:
# path: /archives
# Archives:
# path: /archives
# icon: fa-regular fa-archive # can be empty
# Tags:
# path: /tags
# Tags:
# path: /tags
# icon: fa-regular fa-tags # can be empty
# Categories:
# path: /categories
# Categories:
# path: /categories
# icon: fa-regular fa-folder # can be empty
# ...... # you can add more
# Article date format
Expand All @@ -258,15 +251,14 @@ home:
excerpt_length: 200 # Max length of article excerpt
# Article categories visibility
categories:
enable: true # Whether to enable
enable: true # Whether to enable
limit: 3 # Max number of categories to display
# Article tags visibility
tags:
enable: true # Whether to enable
limit: 3 # Max number of tags to display
enable: true # Whether to enable
limit: 3 # Max number of tags to display
# HOME PAGE ARTICLE SETTINGS <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< end


# ARTICLE >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> start
# Docs: https://redefine-docs.ohevan.com/posts/articles
articles:
Expand All @@ -293,7 +285,7 @@ articles:
count: true # Whether to display word count
min2read: true # Whether to display reading time
# Author label
author_label:
author_label:
enable: true # Whether to enable
auto: false # Whether to automatically add author label, e.g. Lv1, Lv2, Lv3...
list: []
Expand Down Expand Up @@ -339,7 +331,6 @@ articles:
skip_dirs: []
# ARTICLE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< end


# COMMENT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> start
# Docs: https://redefine-docs.ohevan.com/posts/comment
comment:
Expand Down Expand Up @@ -384,7 +375,6 @@ comment:
loading: lazy # Load the comments lazily
# COMMENT <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< end


# FOOTER >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> start
# Docs: https://redefine-docs.ohevan.com/footer
footer:
Expand All @@ -405,14 +395,13 @@ footer:
url: # ICP record url
# FOOTER <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< end


# INJECT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> start
# Docs: https://redefine-docs.ohevan.com/inject
inject:
# Whether to enable inject
enable: false
# Inject custom head html code
head:
head:
-
-
# Inject custom footer html code
Expand All @@ -421,7 +410,6 @@ inject:
-
# INJECT <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< end


# PLUGINS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> start
# Docs: https://redefine-docs.ohevan.com/plugins
plugins:
Expand All @@ -438,19 +426,18 @@ plugins:
url: # audio url
cover: # audio cover url
lrc: # audio cover lrc
# - name: # audio name
# artist: # audio artist
# url: # audio url
# cover: # audio cover url
# lrc: # audio cover lrc
# .... you can add more audios here
# - name: # audio name
# artist: # audio artist
# url: # audio url
# cover: # audio cover url
# lrc: # audio cover lrc
# .... you can add more audios here
# Mermaid JS. Requires hexo-filter-mermaid-diagrams (npm i hexo-filter-mermaid-diagrams). See https://mermaid.js.org/
mermaid:
enable: false # enable mermaid or not
version: "11.4.1" # default v11.4.1
# PLUGINS <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< end


# PAGE TEMPLATES >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> start
# Docs: https://redefine-docs.ohevan.com/page_templates
page_templates:
Expand All @@ -460,7 +447,6 @@ page_templates:
tags_style: blur # blur, cloud
# PAGE TEMPLATES <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< end


# CDN >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> start
# Docs: https://redefine-docs.ohevan.com/cdn
cdn:
Expand All @@ -471,7 +457,7 @@ cdn:
# Custom CDN URL
# format example: https://cdn.custom.com/hexo-theme-redefine/${version}/source/${path}
# The ${path} must leads to the root of the "source" folder of the theme
custom_url:
custom_url:
# CDN <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< end

# DEVELOPER MODE >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> start
Expand Down
3 changes: 2 additions & 1 deletion layout/components/header/head.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@
let ogImage = page.og_image || theme.global.open_graph?.image;
let ogDescription = page.og_description || theme.global.open_graph?.description || page.description || config.description;
let author = page.author || config.author || 'Redefine Team';
let twitterCard = page.twitter_card || theme.global.open_graph?.twitter_card || 'summary';
%>
<%- open_graph({
image: ogImage,
author: author,
description: ogDescription,
twitter_card: 'summary',
twitter_card: twitterCard,
twitter_image: ogImage,
}) %>
<% } %>
Expand Down

0 comments on commit a89988a

Please sign in to comment.