新增站点背景图片、站名容器背景图片

站点背景

找到对应的代码文件

/Path/to/your/directory/node_modules/hexo-theme-next/source/css/_schemes/Gemini/index.styl

  注意应该在/Path/to/your/directory/node_modules/hexo-theme-next/source/目录下新建uploads子目录,并将背景图片上传至此。然后,在index.styl的最后加上如下代码:

1
2
3
4
5
6
7
body {
background: url(/uploads/forest.png);
background-repeat: no-repeat; //不重复
background-attachment:fixed;
background-size: cover; //填充
background-position:25% 25%;
}

站名容器

找到对应的代码文件

/Path/to/your/directory/node_modules/hexo-theme-next/source/css/_schemes/Pisces/_header.styl

  此格式文件是引用的母文件,替换以下代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
.site-brand-container {
background: url(/uploads/custom-logo.png);
background-position:25% 25%;
position: relative; /* 设置相对定位 */
background-size: cover;
padding: 0 10px;
//background: $black-deep;

.site-nav-on & {
+tablet-mobile() {
box-shadow: 0 0 16px rgba(0, 0, 0, .5);
}
}
}

  ‍