Swiper Bar
---
title: hexo搭建教程
date: 2022.8.25
updated: 8.25
cover: https://pic.imgdb.cn/item/6305bdfd16f2c2beb163dbb1.png
description: hexo小奥魔改
swiper_index: 1 #置顶轮播图顺序,非负整数,数字越大越靠前
---
点击查看更新记录
更新记录
2021-07-23:插件版1.0.10
- 更换自定义依赖项链接,迁移至
npm.elemecdn.com - 新增自定义样式及初始化方法配置项
- 旧版本的custom_css、custom_js调整为swiper_css及swiper_js,新增custom_css、custom_js应用于swiperstyle.css和swiper_init.js。语意合乎规范。
2021-07-23:插件版1.0.5
- 新增自定义依赖项的配置接口
2021-06-22:插件版1.0.0
- 发布插件版
2021-01-31:正式版v1.1.1
- 更新v3.6.0适配方案
2020-12-29:正式版v1.1
- 基于冰老师的轮播方案进行修改
- 修改了样式,转为styl
- 去jquery(貌似本来就不依赖jquery)
- 依赖项改为CDN链接
- 适配pjax
- 使用循环节配合data.slider来添加新制定信息
写在最前
本项目是对冰卡诺老师写的教程:基于Butterfly主题的轮播手动置顶文章进行重构,精简了部分样式。适配pjax。
预览效果
新版插件版教程
插件教程
安装插件,在博客根目录
[Blogroot]下打开终端,运行以下指令:
BASH|
npm install hexo-butterfly-swiper --save
| 2. 添加配置信息,以下为写法示例 |
在站点配置文件_config.yml或者主题配置文件_config.butterfly.yml中添加 |
| YAML |
|
# hexo-butterfly-swiper
# see https://akilar.top/posts/8e1264d1/
swiper:
enable: true # 开关
priority: 5 #过滤器优先权
enable_page: all # 应用页面
timemode: date #date/updated
layout: # 挂载容器类型
type: id
name: recent-posts
index: 0
default_descr: 再怎么看我也不知道怎么描述它的啦!
swiper_css: https://npm.elemecdn.com/hexo-butterfly-swiper/lib/swiper.min.css #swiper css依赖
swiper_js: https://npm.elemecdn.com/hexo-butterfly-swiper/lib/swiper.min.js #swiper js依赖
custom_css: https://npm.elemecdn.com/hexo-butterfly-swiper/lib/swiperstyle.css # 适配主题样式补丁
custom_js: https://npm.elemecdn.com/hexo-butterfly-swiper/lib/swiper_init.js # swiper初始化方法
| 3. 参数释义 |
| 参数 | 备选值/类型 | 释义 |
|---|---|---|
| priority | number | 【可选】过滤器优先级,数值越小,执行越早,默认为10,选填 |
| enable | true/false | 【必选】控制开关 |
| enable_page | path/all | 【可选】填写想要应用的页面的相对路径(即路由地址),如根目录就填’/‘,分类页面就填’/categories/‘。若要应用于所有页面,就填’all’,默认为all |
| timemode | date/updated | 【可选】时间显示,date为显示创建日期,updated为显示更新日期,默认为date |
| layout.type | id/class | 【可选】挂载容器类型,填写id或class,不填则默认为id |
| layout.name | text | 【必选】挂载容器名称 |
| layout.index | 0和正整数 | 【可选】前提是layout.type为class,因为同一页面可能有多个class,此项用来确认究竟排在第几个顺位 |
| default_descr | text | 默认文章描述 |
| swiper_css | url | 【可选】自定义的swiper依赖项css链接 |
| swiper_js | url | 【可选】自定义的swiper依赖项加js链接 |
| custom_css | url | 【可选】适配主题样式补丁 |
| custom_js | url | 【可选】swiper初始化方法 |
使用方法
在文章的front_matter中添加swiper_index配置项即可。
MARKDOWN
|
---
title: 文章标题
date: 创建日期
updated: 更新日期
cover: 文章封面
description: 文章描述
swiper_index: 1 #置顶轮播图顺序,非负整数,数字越大越靠前
---
Swiper Bar
https://akilar.top/posts/8e1264d1/
作者Akilar
发布于2020-12-29
更新于2021-12-26
许可协议CC BY-NC-SA 4.0
不给糖果就捣蛋

Akilar
674527148
**CREATED:**03/09/2020
WELCOME TO CANDYHOME
SITELINK加入群聊【🧊Akilarの糖果屋🍭】
Use this card to join the candyhome and participate in a pleasant discussion together .
Welcome to Akilar’s candyhome,wish you a nice day .
评论
©2016 - 2022Akilar
3 YEAR 131 DAYS 23 : 14 : 35
00:00 / 00:00
高清图片地址已复制。
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 满心欢喜!
评论


