This article is translated from ChatGPT.
🦋 Butterfly has been updated to 4.10.
📚 Table of Contents
🚀 Get Started - 📑 Theme Pages - 📌 Theme Configuration Part 1 - ⚔️ Theme Configuration Part 2 - ❓ Q&A - ⚡️ Advanced Tutorials
Language
Modify the site configuration file _config.yml
.
The default language is set to English (en).
The theme supports three languages:
- default (English)
- zh-CN (Simplified Chinese)
- zh-TW (Traditional Chinese)
Website Information
To modify various data on the website, such as the title, subtitle, and email address, please edit the _config.yml
file located in the root directory of your blog.
Navigation Bar Settings
Parameter Configuration
In the theme configuration file, you can find the following parameters for setting up the navigation bar:
1 | nav: |
Parameter | Explanation |
---|---|
logo | The logo of the website, supporting image URLs. |
display_title | Whether to display the website title. Use true or false . |
fixed | Whether to fix the navigation bar at the top. Use true or false . |
Menu/Directory
To modify the navigation menu, edit the "Theme Configuration File" as follows:
1 | Home: / || fas fa-home |
Each item in the menu is specified with a format of /xxx/ || icon_name
. If you don't want to display an icon, you can omit the icon_name
.
The default behavior for subdirectories is to be expanded. If you want them to be hidden, you can add 'hide' to the configuration of the subdirectory
1 | List||fas fa-list||hide: |
Note: The navigation text can be customized as desired.
For example:
1 | menu: |
Code Blocks
All code block features mentioned here only apply to the built-in code rendering in Hexo.
If you use a third-party renderer, they may not work as expected.
Code Highlight Themes
Code Copy
The theme supports code copy functionality.
To enable code copy, edit the theme_config
file.
1 | highlight_copy: true |
Code Blocks Expansion/Collapse
By default, code blocks are automatically expanded. You can choose to have all code blocks in a collapsed state, and users can click the '>' symbol to expand the code.
- true: All code blocks are not expanded and need to be opened by clicking '>'.
- false: Code blocks are expanded, and there is a '>' button to collapse them.
- none: The '>' button is not displayed.
To modify the behavior, edit the theme_config
file.
1 | highlight_shrink: true # Code blocks are not expanded, need to click '>' to open. |
You can also add the highlight_shrink
parameter in the front-matter of a post/page to configure it independently.
When highlight_shrink
in the theme_config is set to true, you can add highlight_shrink: false
in the front-matter to individually configure the code block expansion for that particular post.
When highlight_shrink
in the theme_config is set to false, you can add highlight_shrink: true
in the front-matter to individually configure the code block collapse for that particular post.
highlight_shrink: true
highlight_shrink: false
highlight_shrink: none
Code Line Wrapping
By default, Hexo does not automatically wrap lines in code blocks during compilation. If you don't want horizontal scrollbars in the code block area, you can consider enabling this feature.
To enable line wrapping, edit the theme_config
file.
1 | code_word_wrap: true |
If you are using the highlight
renderer, you need to find the Hexo configuration file _config.yml
and change line_number
to false
:
1 | highlight: |
If you are using the prismjs
renderer, you need to find the Hexo configuration file _config.yml
and change line_number
to false
:
1 | prismjs: |
Before setting
code_word_wrap
:
After setting
code_word_wrap
:
Code Height Limit
Supported from version 3.7.0 and above.
You can set a limit on the code block height, and the overflow will be hidden, with an expand button displayed.
1 | highlight_height_limit: false # unit: px |
Note:
- The unit is
px
, simply add the number, e.g., 200. - The actual height limit is
highlight_height_limit + 30 px
. An extra 30px is added to prevent the expand button from appearing when the code's height is only slightly greater than thehighlight_height_limit
. - Does not apply to hidden code blocks (CSS set to display: none).
Social Settings
Butterfly supports Font Awesome v6 icons.
The format for writing is icon name: url || descriptive text || color
.
1 | social: |
You can find the icon names in the image below:
PC:
Mobile:
Avatar
Edit the theme_config
file
1 | avatar: |
Top Image
To disable all top image, you can directly configure disable_top_img: true
.
The acquisition order of the top image is as follows: if none is configured, the top image won't be displayed.
Page Top Image Acquisition Order:
Individual configured top_img
>default_top_img in the configuration file
Article Page Top Image Acquisition Order:
Individual configured top_img
>cover
>default_top_img in the configuration file
Values in the configuration:
Configuration | Explanation |
---|---|
index_img | Top image for the home page |
default_top_img | Default top image, displayed when top_img is not configured on the page |
archive_img | Top image for archive pages |
tag_img | Default top image for tag sub-pages |
tag_per_img | Top image for tag sub-pages, can be configured for each tag |
category_img | Default top image for category sub-pages |
category_per_img | Top image for category sub-pages, can be configured for each category |
For other pages (tags/categories/custom pages) and article pages, please set front-matter
in the corresponding md file to configure top_img
.
All top_img configurations above support the following values:
Versions below 3.2.0 only support
- Empty, true, and false - display the default color
- img link - display the configured image
Configuration Values | Effect |
---|---|
Empty | Display the default top_img (if available), otherwise display the default color (If top_img is empty on the article page, the value of cover will be displayed) |
img link | Link to the image, displaying the configured image |
Colors ( HEX value - #0000FF RGB value - rgb(0,0,255) Color word - orange Gradient color - linear-gradient( 135deg, #E2B0FF 10%, #9F44D3 100%) ) | Corresponding colors |
transparent | Transparent |
false | Do not display the top_img |
tag_per_img
and category_per_img
are newly added in version 3.2.0, allowing separate configurations for tags and categories.
It is not recommended to configure different top images for each tag and category, as having too many configurations can slow down the generation speed.
1 | tag_per_img: |
top_img: false
top_img: orange
top_img: 'linear-gradient(20deg, #0062be,#925696, #cc426e, #fb0347)'
Article Cover
In the markdown file of an article, you can add a cover
field in the Front-matter
section and provide the URL of the image you want to display as the cover.
If you don't configure the cover
field, you can set it to display the default cover.
If you don't want to display the cover on the homepage, you can set it to false
.
The order of obtaining the article cover is: Front-matter cover
> default_cover in the configuration file
> false
To modify the theme configuration file, use the following YAML structure:
1 | cover: |
Explanation of parameters:
Parameter | Description |
---|---|
index_enable | Whether to display article covers on the home page |
aside_enable | Whether to display article covers in the sidebar |
archives_enable | Whether to display article covers on the archives page |
position | The position of the article cover on the main page cards - left: all covers displayed on the left - right: all covers displayed on the right - both: covers displayed alternately on the left and right |
default_cover | Default cover, can be a URL link/color/gradient color, etc. |
When configuring multiple cover images, a random image will be selected as the cover. In this case, the configuration should be:
1 | default_cover: |
left
right
both
Meta Display
The post_meta
option is used to display relevant information about the articles.
To modify the theme configuration file, use the following YAML structure:
1 | post_meta: |
Explanation of parameters:
For the homepage (
page
):date_type
: Display the creation date (created
), update date (updated
), or both (both
) on the homepage.date_format
: Display the date (date
) or a relative date (relative
) on the homepage.categories
: Whether to display the categories on the homepage (true
orfalse
).tags
: Whether to display the tags on the homepage (true
orfalse
).label
: Whether to display descriptive text on the homepage (true
orfalse
).
For the article page (
post
):date_type
: Display the creation date (created
), update date (updated
), or both (both
) on the article page.date_format
: Display the date (date
) or a relative date (relative
) on the article page.categories
: Whether to display the categories on the article page (true
orfalse
).tags
: Whether to display the tags on the article page (true
orfalse
).label
: Whether to display descriptive text on the article page (true
orfalse
).
Homepage
Article Page
The date_format
parameter was introduced in version 3.2.0, allowing you to configure whether to display specific dates or relative dates.
Relative Time:
Full Date:
Homepage Article Excerpt (Auto Excerpt and Article Description)
Due to the theme's UI design, the "Homepage Article Excerpt" supports only "Auto Excerpt" and "Article Description."
In butterfly
, there are four options available:
- description: Only display the article description.
- both: Prioritize displaying the article description; if there is no description configured, it will display the auto excerpt content.
- auto_excerpt: Only display the auto excerpt.
- false: Do not display the article content.
To configure, modify the theme configuration file
:
1 | index_post_content: |
To add the description
in the front-matter:
Page Anchors
When you enable page anchors, the page links will update according to the header ID when scrolling. (Note: Each update will create a new history entry. So if an article has many anchors, there will be many history entries in the browser.)
To configure, modify the theme configuration file
:
1 | # anchor |
Image Captions
You can enable the display of Figcaption text for images.
The priority for displaying the caption is as follows: image title
attribute first, and then the alt
attribute.
To configure, modify the theme configuration file
:
1 | photofigcaption: true |
Copy Settings
You can configure whether users can copy content from your website and whether the copied content should have copyright information.
To configure, modify the theme configuration file
:
1 | # copy settings |
Configuration | Explanation |
---|---|
enable | Whether to enable website copy permission |
copy: copyright | Add copyright information after the copied content |
copy: enable | Whether to enable adding copyright information when copying |
copy: limit_count | Word count limit; when the copied text exceeds this limit, it will add copyright information at the end of the copied content |
After enabling the option, when users copy content from your website, the copied text will have the following copyright information added at the end:
1 |
|
Note that the specific text may vary based on your configuration and settings.
Article Page Configuration
Article Copyright
You can display the copyright and license information for your blog posts.
To set up the article copyright, modify the theme configuration file:
1 | post_copyright: |
Explanation of the attributes:
Attribute | Explanation |
---|---|
enable | Enable article copyright |
decode | Whether to decode URLs in the copyright information |
author_href | The link to the author's website or profile |
license | The license type for the article |
license_url | The URL to the full text of the license |
Starting from Hexo 4.1, URLs are decoded by default, which may cause Chinese URLs to be decoded. You can set decode: true
to display Chinese URLs properly.
If there are articles (e.g., reposted articles) that don't require showing copyright information, you can set copyright: false
in the article's Front-matter.
1 | copyright: false |
Starting from version 3.0.0, you can also set individual copyright information for specific articles in their Front-matter:
1 | --- |
This allows you to have different copyright information for different articles.
Article Rewards
You can add a reward button at the end of each article, along with the relevant QR codes that users can use for donations.
If you don't provide a QR code, you can configure an icon image and add the corresponding donation link. When users click on the image, they will be redirected to the specified link.
To set up article rewards, modify the theme configuration file:
1 | reward: |
Explanation of the attributes:
Attribute | Explanation |
---|---|
enable | Enable article rewards |
QR_code | List of reward options (QR code and link) |
img | The image file path for the QR code or icon |
link | The donation link associated with the image |
text | The text label for the donation option |
You can configure multiple reward options by adding more entries to the QR_code
list. If you don't want to provide a link, you can leave the link
attribute empty, and the image will act as a direct link.
Table of Contents (TOC)
The theme provides a Table of Contents (TOC) on the article page to display the table of contents.
To configure the TOC, you can modify the theme configuration file:
1 | toc: |
Explanation of the attributes:
Attribute | Explanation |
---|---|
post | Enable TOC on the article page |
page | Enable TOC on regular pages |
number | Display section numbers |
expand | Expand TOC by default |
style_simple | Simple mode (only TOC in the sidebar, for posts) |
scroll_percent | Display scrolling percentage on the progress bar |
Toc PC
Toc Mobile
style_simple: true
Configuring for Specific Posts
To configure the Table of Contents (TOC) for a specific post, add toc_number
and toc
in the front matter section of your Markdown file and set it to either true
or false
.
The theme will first check if the Markdown Front Matter of the article contains these configurations. If they are present, the theme will use the Front Matter configurations. Otherwise, it will use the configurations specified in the theme configuration file.
Example:
1 | --- |
Related Posts
When the article cover is set to false or the cover configuration is not available, the background of related posts will display the theme color.
The related posts are recommended based on the weight of the article tags.
Modify the theme configuration file
:
1 | related_post: |
enable
: Set to true to enable the display of related posts.limit
: The number of recommended posts to display.date_type
: Set tocreated
orupdated
to display the creation date or update date of the article in the related posts section.
Article Expiry Reminder
You can configure whether to display an article expiry reminder based on the update time.
1 | # Displays outdated notice for a post (文章過期提醒) |
limit_day
: The number of days after which the expiry reminder will be shown based on the update time.message_prev
: The text before the number of days.message_next
: The text after the number of days.
style: flat
style: simple
Article Editing Button
Display an editing button next to the article title that redirects to the corresponding link.
1 | # Post edit |
Post Pagination Buttons
When the post cover is set to false or the cover configuration is not obtained, the pagination background will display the theme color.
You can configure the logic for post pagination or disable the pagination display altogether using the following settings:
1 | # post_pagination (pagination) |
Explanation of parameters:
Parameter | Explanation |
---|---|
post_pagination: false | Disable pagination buttons |
post_pagination: 1 | The 'next post' links to an older post |
post_pagination: 2 | The 'next post' links to a newer post |
Footer Settings
Blog Year
The since
option is used to display the starting year of your website. It will be shown at the bottom of the page as part of the footer.
To display the starting year in the footer, modify the theme configuration file
as follows:
1 | footer: |
Custom Footer Text
The custom_text
option allows you to add custom text to the footer of your website. You can use this option to add statements, declarations, or any other custom text you want. It supports HTML formatting.
To add custom text to the footer, modify the theme configuration file
as follows:
1 | custom_text: Hi, welcome to my <a href="https://butterfly.js.org/">blog</a>! |
This will display the custom text in the footer, as shown in the image below:
If you need to include ICP (Internet Content Provider) information for certain regions that require it, you can also add it to the custom_text
option:
1 | custom_text: <a href="icp_link"><img class="icp-icon" src="icp_image"><span>备案号:xxxxxx</span></a> |
In this example, replace icp_link
with the actual ICP link and icp_image
with the image representing your ICP registration.
Aside Settings
Aside Layout
You can customize which items to display in the aside, decide their position, and even hide the sidebar if needed.
Modify the theme configuration file
to make changes.
1 | aside: |
position: left
position: right
card_tags color: false
card_tags color: true
aside button
Visitor Count (busuanzi) - UV and PV
Visit the official website of busuanzi for more information.
Modify the theme configuration file
as follows:
1 | busuanzi: |
If you need to modify the CDN link for busuanzi, you can do so through the
option
in theCDN
section of the theme configuration file:
1 | CDN: |
Runtimeshow
Displays the running time of the website.
Modify the theme configuration file
as follows:
1 | runtimeshow: |
Newest Comments
Supported from version 3.1.0
The newest comments will only be loaded when refreshing the page and won't update in real-time.
Due to API access limitations, to avoid excessive calls, the theme defaults to a storage period of 10 minutes. This means that after calling the data, it will be stored in localStorage, and refreshing the website within 10 minutes will only retrieve the data from localStorage. After the 10-minute period, when you refresh the page, it will fetch new data from the API. (As of version 3.6.0, the storage
configuration has been added, allowing you to customize the caching time.)
To display the newest comments section in the sidebar, modify the theme configuration file
as follows:
1 | # Aside widget - Newest Comments |
Explanation of some configurations:
Configuration | Explanation |
---|---|
limit | Number of comments to display |
storage | Cache duration in minutes |
avatar | Whether to display avatars for the comments |
Demo
Custom Add Aside Widget
Click to VisitBottom Right Button
Simplified-Traditional Chinese Conversion
Enable the simplified-traditional Chinese character conversion feature.
A button for simplified-traditional Chinese character conversion will be displayed in the bottom right corner.
To enable this feature, modify the theme configuration file:
1 | translate: |
Simplified Chinese
Traditional Chinese
Read Mode
In Read Mode, the theme will remove all content except for the article, providing a distraction-free reading experience.
The Read Mode button will appear only on the article pages, located in the bottom right corner.
To enable Read Mode, modify the theme configuration file:
1 | readmode: true |
When enabled, users will be able to activate the Read Mode by clicking on the button while reading an article.
Dark Mode
In the theme configuration file, you can enable the dark mode feature and customize its behavior using the following parameters:
1 | # dark mode |
Parameter | Description |
---|---|
button | Display the day/night mode toggle button in the bottom right corner |
autoChangeMode | Automatically switch modes:autoChangeMode: 1 - Follow the system setting. If the browser/system doesn't support this, it will switch to light mode between the start and end times.autoChangeMode: 2 - Switch to light mode between the start and end times, and remain in dark mode for the rest of the time.autoChangeMode: false - Disable automatic mode switching. |
start | The start time of light mode (hour of the day) |
end | The end time of light mode (hour of the day) |
The theme will display a night mode toggle button in the bottom right corner as shown in the image above.
Scroll Percentage
In the theme config file
1 | # show scroll percent in scroll-to-top button |
Button Sorting
1 | # Don't modify the following settings unless you know how they work |
Tag Plugins
Tag plugins are unique to the Hexo theme Butterfly and are not standard Markdown format.
The following syntax is only applicable to the Butterfly theme and may not work or even cause errors on other themes. Please use with caution.
While tag plugins can bring some additional functionality and UI enhancements to the theme, they also have notable limitations. Please be aware of this when using them.
Note (Bootstrap Callout)
This plugin is ported from the Next theme and has been modified.
Modify the theme configuration file
:
1 | note: |
icons
and light_bg_offset
only work for Method 1.
There are two ways to use the Note tag plugin:
1 | {% note [class] [no-icon] [style] %} |
Name | Usage |
---|---|
class | [Optional] Identifier, different identifiers have different colors (default/primary/success/info/warning/danger) |
no-icon | [Optional] Do not display an icon |
style | [Optional] Overrides the style in the configuration file (simple/modern/flat/disabled) |
simple
1 | {% note simple %} |
Default Callout Tag
Default Callout Tag
Primary Callout Tag
Success Callout Tag
Info Callout Tag
Warning Callout Tag
Danger Callout Tag
modern
1 | {% note modern %} |
Default Callout Tag
Default Callout Tag
Primary Callout Tag
Success Callout Tag
Info Callout Tag
Warning Callout Tag
Danger Callout Tag
flat
1 | {% note flat %} |
Default Callout Tag
Default Callout Tag
Primary Callout Tag
Success Callout Tag
Info Callout Tag
Warning Callout Tag
Danger Callout Tag
disabled
1 | {% note disabled %} |
Default Callout Tag
Default Callout Tag
Primary Callout Tag
Success Callout Tag
Info Callout Tag
Warning Callout Tag
Danger Callout Tag
no-icon
1 | {% note no-icon %} |
Supported in version 3.2.0 and above.
1 | {% note [color] [icon] [style] %} |
Name | Usage |
---|---|
color | 【Optional】Color (default / blue / pink / red / purple / orange / green) |
icon | 【Optional】Customizable icon (only supports fontawesome icons, can also configure no-icon) |
style | 【Optional】Can override the style in the configuration (simple/modern/flat/disabled) |
simple
1 | {% note 'fab fa-cc-visa' simple %} |
Are you using Visa or UnionPay?
2021 is coming soon...
Drive safely, safety first.
Is this a three-blade fan or a four-blade fan?
Are you using Visa or UnionPay?
Rock-paper-scissors.
The most dreaded browser for front-end developers.
modern
1 | {% note 'fab fa-cc-visa' modern %} |
Are you using Visa or UnionPay?
2021 is coming soon...
Drive safely, safety first.
Is this a three-blade fan or a four-blade fan?
Are you using Visa or UnionPay?
Rock-paper-scissors.
The most dreaded browser for front-end developers.
flat
1 | {% note 'fab fa-cc-visa' flat %} |
Are you using Visa or UnionPay?
2021 is coming soon...
Drive safely, safety first.
Is this a three-blade fan or a four-blade fan?
Are you using Visa or UnionPay?
Rock-paper-scissors.
The most dreaded browser for front-end developers.
disabled
1 | {% note 'fab fa-cc-visa' disabled %} |
Are you using Visa or UnionPay?
2021 is coming soon...
Drive safely, safety first.
Is this a three-blade fan or a four-blade fan?
Are you using Visa or UnionPay?
Rock-paper-scissors.
The most dreaded browser for front-end developers.
no-icon
1 | {% note no-icon %} |
Gallery Photo Collection
Available from version 2.2.0
A collection of photo galleries.
Syntax:
1 | <div class="gallery-group-main"> |
- name: Name of the gallery
- description: Description of the gallery
- link: Link to the corresponding album
- img-url: URL of the gallery cover image
For example:
1 | <div class="gallery-group-main"> |
Gallery Album
Available from version 2.0.0
The new Gallery Album is different from the old version. It automatically arranges images based on their length, making it more convenient to write, just like using markdown format. You can insert it into the corresponding markdown as needed.
Syntax:
1 | {% gallery [lazyload],[rowHeight],[limit] %} |
Parameter | Explanation |
---|---|
lazyload | [Optional] Click the button to load more images. Set to true/false. Default is false . |
rowHeight | [Optional] The height at which the images are displayed. If you want to display more images in a row, you can set a smaller value. Default is 220 . |
limit | [Optional] The number of images to load at a time. Default is 10 . |
Examples
1 | {% gallery %} |
For example:
1 | {% gallery %} |
Syntax:
1 | {% gallery url,[link],[lazyload],[rowHeight],[limit] %} |
Parameter | Explanation |
---|---|
url | [Required] Identifier. |
link | [Required] Remote JSON link. |
lazyload | [Optional] Click the button to load more images. Set to true/false. Default is false . |
rowHeight | [Optional] The height at which the images are displayed. If you want to display more images in a row, you can set a smaller value. Default is 220 . |
limit | [Optional] The number of images to load at a time. Default is 10 . |
Example of Remote JSON Link
There are three parameters, and url
is required. alt
and title
are optional and can be present or not.
1 | [ |
Example
1 | {% gallery url,https://xxxx.com/sss.json %} |
tag-hide
Available from version 2.2.0 onwards.
Please note that within the tag-hide
plugin, it is not recommended to have headings such as h1 - h6 in the content. The Table of Contents (ToC) may display the hidden content's headings, and scrolling may cause abnormal behavior if the hidden content is not visible.
If you want to hide certain text or content and provide a button for users to click and reveal it, you can use this tag-hide
plugin.
inline
: Adds a button to hide content within the text, limited to text only.
( The content
should not contain commas; you can use ‚
instead.)
1 | {% hideInline content,display,bg,color %} |
content
: The text content to be hidden.display
: The text to be displayed on the button (optional).bg
: The background color of the button (optional).color
: The text color of the button (optional).
Demo
1 | Which English letter is the coolest? {% hideInline Because they wear suits (C for cool),Reveal the answer,#FF7242,#fff %} |
Which English letter is the coolest?
There's a person standing inside the door?
block
: Hides independent content blocks, allowing you to hide multiple contents, including images, code blocks, etc.
( The display
should not contain commas; you can use ‚
instead.)
1 | {% hideBlock display,bg,color %} |
content
: The content to be hidden.display
: The text to be displayed on the button (optional).bg
: The background color of the button (optional).color
: The text color of the button (optional).
Demo
1 | Reveal the answer |
Reveal the answer
Available from version 2.3.0 onwards.
If you need to show a lot of content, you can hide it in a collapsible box and expand it when needed.
( The display
should not contain commas; you can use ‚
instead.)
1 | {% hideToggle display,bg,color %} |
Demo
1 | {% hideToggle Butterfly Installation Method %} |
Butterfly Installation Method
In your blog's root directory,
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly
If you want to install the newer dev branch, you can use
git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git
themes/Butterfly
Mermaid
The mermaid
tag allows you to create various diagrams like Flowchart, Sequence diagram, Class Diagram, State Diagram, Gantt chart, and Pie Chart. Here's how you can use it:
- Modify your theme configuration file (usually in YAML format) to enable
mermaid
:
1 | # mermaid |
- To create a diagram, use the
mermaid
tag plugin with your content inside:
1 | {% mermaid %} |
Example:
1 | {% mermaid %} |
This will generate a Pie Chart diagram:
You can refer to the mermaid documentation for more information and examples on how to create different types of diagrams using mermaid.
Tabs
Usage:
1 | {% tabs Unique name, [index] %} |
Demo 1 - Default selection of the first tab (Default):
1 | {% tabs test1 %} |
This is Tab 1.
This is Tab 2.
This is Tab 3.
Demo 2 - Specify the default selected tab
1 | {% tabs test2, 3 %} |
This is Tab 1.
This is Tab 2.
This is Tab 3.
Demo 3 - No default selected tab
1 | {% tabs test3, -1 %} |
This is Tab 1.
This is Tab 2.
This is Tab 3.
Demo 4 - Custom tab names + Only icon + Icon and Tab name:
1 | {% tabs test4 %} |
The name of this tab is "First Tab".
Only icon, no tab name.
Tab name + icon
Button
Version 3.0 and above
Usage:
1 | {% btn [url],[text],[icon],[color] [style] [layout] [position] [size] %} |
Parameters:
[url]
: Link to the destination.[text]
: Button text.[icon]
: [Optional] Icon for the button.[color]
: [Optional] Background color of the button (for default style),
font and border color (for outline style).
Available colors: default, blue, pink, red, purple, orange, green.[style]
: [Optional] Button style. Default is solid.
Options: outline or leave empty for solid style.[layout]
: [Optional] Button layout. Default is line.
Options: block or leave empty for line layout.[position]
: [Optional] Button position. Applicable only when the layout is set to block.
Default is left.
Options: center, right, or leave empty for left position.[size]
: [Optional] Button size.
Options: larger or leave empty.
Demo
1 | This is my website, click the button {% btn 'https://butterfly.js.org/',Butterfly %} |
This is my website, click the button Butterfly
This is my website, click the button Butterfly
This is my website, click the button Butterfly
This is my website, click the button Butterfly
This is my website, click the button Butterfly
1 | {% btn 'https://butterfly.js.org/',Butterfly,far fa-hand-point-right,block %} |
more than one button in center
1 | {% btn 'https://butterfly.js.org/',Butterfly,far fa-hand-point-right,larger %} |
1 | <div class="btn-center"> |
inlineImg
The theme displays images as default block-level elements
. If you want to display an image as an inline element
, you can use this tag plugin.
1 | {% inlineImg [src] [height] %} |
Demo
1 | Do you think I look beautiful? |
label
Due to the rendering limitations of Hexo, there are some issues when using label tags at the beginning of paragraphs. For example, consecutive paragraphs with label tags at the beginning cannot be line-broken.
It is recommended not to use label tags at the beginning of paragraphs.
Highlight the required text.
1 | {% label text color %} |
Parameter | Description |
---|---|
text | The text to be highlighted |
color | [Optional] Background color, default is default default/blue/pink/red/purple/orange/green |
Demo
1 | 臣亮言:{% label 先帝 %}創業未半,而{% label 中道崩殂 blue %}。今天下三分,{% label 益州疲敝 pink %},此誠{% label 危急存亡之秋 red %}也!然侍衞之臣,不懈於內;{% label 忠志之士 purple %},忘身於外者,蓋追先帝之殊遇,欲報之於陛下也。誠宜開張聖聽,以光先帝遺德,恢弘志士之氣;不宜妄自菲薄,引喻失義,以塞忠諫之路也。 |
臣亮言:先帝 創業未半,而中道崩殂 。今天下三分,益州疲敝 ,此誠危急存亡之秋 也!然侍衞之臣,不懈於內;忠志之士 ,忘身於外者,蓋追先帝之殊遇,欲報之於陛下也。誠宜開張聖聽,以光先帝遺德,恢弘志士之氣;不宜妄自菲薄,引喻失義,以塞忠諫之路也。
宮中、府中,俱為一體;陟罰臧否,不宜異同。若有作奸 、犯科 ,及為忠善者,宜付有司,論其刑賞,以昭陛下平明之治;不宜偏私,使內外異法也。
timeline
Supported in version 4.0.0 and above
1 | {% timeline title,color %} |
Parameter | Description |
---|---|
title | Title/timeline date |
color | Timeline color options: default (leave empty) / blue / pink / red / purple / orange / green |
Demo
1 | {% timeline 2022 %} |
2022
01-02
This is a test page.
1 | {% timeline 2022,blue %} |
2022
01-02
This is a test page.
1 | {% timeline 2022,pink %} |
2022
01-02
This is a test page.
1 | {% timeline 2022,red %} |
2022
01-02
This is a test page.
1 | {% timeline 2022,purple %} |
2022
01-02
This is a test page.
1 | {% timeline 2022,orange %} |
2022
01-02
This is a test page.
1 | {% timeline 2022,green %} |
2022
01-02
This is a test page.
flink
Supported in version 4.1.0
You can insert a friends link list effect on any page.
The content format is the same as the friends link page and supports YAML format.
1 | {% flink %} |
Demo
1 | {% flink %} |
abcjs Sheet Music
Rendering sheet music on the page.
Modify the theme configuration file
.
1 | # abcjs (Sheet Music Rendering) |
Usage:
1 | {% score %} |
Demo
1 | {% score %} |
series articles
Display series articles on the page.
Modify the theme configuration file.
1 | series: |
Usage:
1 | {% series %} |
Add the parameter series to the front matter of the article and give it an identifier.
Using this tag plugin will display articles with the same identifier in a list format.
If the series identifier is not specified, it defaults to the series identifier of the article where this tag plugin is used.
Demo
1 | {% series markdown %} |