首页轮播图的创建
给个人博客添加首页轮播图
💌
适用于
hexo - theme - butterfly
主题
安装💨
在博客的根目录[Blogroot]打开vs终端或者git输入
1 | npm install hexo-butterfly-swiper-marcus --save |
添加配置信息💨
在站点配置文件_config.yml
或者主题配置文件_config.butterfly.yml
里面添加💨
1 | swiper: |
使用方法💨
在文章front_matter
中添加配置项目swiper_index
和top_group_index
控制轮播图和右侧的磁铁
1 | --- |
在[Blogroot]\themes\butterfly\layout\includes\layout.pug中
1 | if page.type !== '404' |
注意去掉 + 号哈
最后加个css!
1 | #home_top { |
最后如果出现没有元素图标的轮播效果可能就是没有挂在元素
在source_data\creativity.yml 创建一个creativity.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35- class_name: 开启创造力
creativity_list:
- name: Docker
color: "#57b6e6"
icon: https://img02.anzhiy.cn/adminuploads/1/2022/09/25/63300647df7fa.png
- name: Photoshop
color: "#4082c3"
icon: https://img02.anzhiy.cn/adminuploads/1/2022/09/25/63300647e1f10.png
- name: Git
color: "#df5b40"
icon: /img/git.png
- name: AI
color: "#937df7"
icon: /img/illustrator.png
- name: python
color: "#fff"
icon: /img/Python.png
- name: HTML5
color: "#e9572b"
icon: /img/HTML.png
- name: JS
color: "#f7cb4f"
icon: /img/JS.png
- name: Swift
color: "#f7cb4f"
icon: /img/Swift.png
- name: Sketch
color: "#2c51db"
icon: /img/Sketch.png
大功告成!!