A Hugo theme component with reward-log or sponsor-log shortcode.
来源:hugo-fixit/shortcode-rewards
网站:https://lruihao.cn/reward/
shortcode-rewards
A Hugo theme component with reward-log or sponsor-log shortcode.
Demo
Requirements
Developed based on the FixIt Timeline plugin.
- v2 requires FixIt v1.0.x
- v1 requires FixIt v0.4.x
Install Component
The installation method is the same as installing a theme. There are several ways to install, choose one, for example, install through Hugo Modules:
| |
Configuration
In order to Inject the partial shortcode-rewards.html into the custom-head through the custom block opened by the FixIt theme in the layouts/partials/custom.html file, you need to fill in the following necessary configurations:
| |
Usage
First, create the reward-log.yml file and edit your data:
| |
If your site is multilingual, you can create a
reward_log.en.ymlfile for English andreward_log.zh-cn.ymlfor Chinese.
Next, use the reward-log shortcode in any page:
| |
注意
For compatibility with older versions, sponsor-log shortcode can also be used, and the corresponding data file is sponsor_log.yml.
Params
Shortcode
The reward-log shortcode has the following named parameters, and the positional parameters ordered from top to bottom:
| Parameter | Description | Type | Optional values | Default |
|---|---|---|---|---|
| reverse | whether the node is ascending or descending | boolean | - | true |
| placement | position of timestamp | string | top / bottom | bottom |
| animation | whether to enable animation | boolean | - | false |
| size | node size | string | small / medium / large | medium |
| node | node style | string | circle / dot | circle |
| width | # container width | string | - | - |
| height | # container height | string | - | - |
| class | # container classname | string | - | - |
Parameters marked with
#only support named parameters.
Data
The reward_log.yml file has the following fields:
| |
References
支付宝
微信