Skip to content

Commit

Permalink
chore: use unsplash for default home page cover image
Browse files Browse the repository at this point in the history
  • Loading branch information
Renovamen committed Feb 3, 2021
1 parent 79c9a76 commit 229d2f7
Show file tree
Hide file tree
Showing 15 changed files with 113 additions and 62 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
.DS_Store
.cache/
node_modules
dist
dist
.npmrc
.yarnrc
8 changes: 4 additions & 4 deletions example/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ module.exports = {
'/': {
label: 'English',
selectText: 'Languages',
nav: require('./nav/en'),
sidebar: require('./sidebar/en')
nav: require('./configs/nav/en'),
sidebar: require('./configs/sidebar/en')
},
'/zh/': {
label: '简体中文',
selectText: '选择语言',
nav: require('./nav/zh'),
sidebar: require('./sidebar/zh')
nav: require('./configs/nav/zh'),
sidebar: require('./configs/sidebar/zh')
}
},
personalInfo: {
Expand Down
38 changes: 38 additions & 0 deletions example/.vuepress/configs/nav/en.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
module.exports = [
{
text: 'Home',
link: '/',
icon: 'fa-fort-awesome'
},
{
text: 'Tags',
link: '/tags/',
icon: 'fa-tag'
},
{
text: 'Links',
link: '/links/',
icon: 'fa-satellite-dish'
},
{
text: 'Docs',
link: '/docs/',
icon: 'fa-book'
},
{
text: 'v0.1.2',
icon: 'fa-github',
items: [
{
text: 'Repository',
link: 'https://github.com/Renovamen/vuepress-theme-gungnir',
icon: 'oi-repo'
},
{
text: 'Chore Changelog',
link: 'https://github.com/Renovamen/vuepress-theme-gungnir/blob/main/CHANGELOG.md',
icon: 'oi-git-compare'
}
]
}
]
38 changes: 38 additions & 0 deletions example/.vuepress/configs/nav/zh.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
module.exports = [
{
text: '首页',
link: '/',
icon: 'fa-fort-awesome'
},
{
text: '标签',
link: '/tags/',
icon: 'fa-tag'
},
{
text: '链接',
link: '/links/',
icon: 'fa-satellite-dish'
},
{
text: '文档',
link: '/zh/docs/',
icon: 'fa-book'
},
{
text: 'v0.1.2',
icon: 'fa-github',
items: [
{
text: '仓库地址',
link: 'https://github.com/Renovamen/vuepress-theme-gungnir',
icon: 'oi-repo'
},
{
text: '更新日志',
link: 'https://github.com/Renovamen/vuepress-theme-gungnir/blob/main/CHANGELOG.md',
icon: 'oi-git-compare'
}
]
}
]
File renamed without changes.
File renamed without changes.
21 changes: 19 additions & 2 deletions example/.vuepress/enhanceApp.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
import VueIcon from 'oh-vue-icons/components/Icon'
import { FaFortAwesome, FaTag, FaSatelliteDish, FaBook } from 'oh-vue-icons/icons'
VueIcon.add([ FaFortAwesome, FaTag, FaSatelliteDish, FaBook ])
import {
FaFortAwesome,
FaTag,
FaSatelliteDish,
FaBook,
FaGithub,
OiRepo,
OiGitCompare
} from 'oh-vue-icons/icons'

VueIcon.add([
FaFortAwesome,
FaTag,
FaSatelliteDish,
FaBook,
FaGithub,
OiRepo,
OiGitCompare
])
22 changes: 0 additions & 22 deletions example/.vuepress/nav/en.js

This file was deleted.

22 changes: 0 additions & 22 deletions example/.vuepress/nav/zh.js

This file was deleted.

2 changes: 1 addition & 1 deletion example/docs/basic/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ The `mask` is a translucent overlay placed on the cover image. It will be helpfu
Check the [home page](/) of this site to see the effect. Click the left and right button to switch among multiple cover images.
If `homeHeaderImages` is not cofigured, a default cover image will be displayed on home page.
If `homeHeaderImages` is not cofigured, a galaxy wallpaper returned by [Unsplash API](https://source.unsplash.com/) will be displayed on home page.
## Other Pages
Expand Down
2 changes: 1 addition & 1 deletion example/zh/docs/basic/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ module.exports = {
页面效果可以参考本站的[首页](/),点击封面图左右两边的按钮可以在多张图片之间进行切换。
如果不配置 `homeHeaderImages` 项,则主题会在首页显示默认图片
如果不配置 `homeHeaderImages` 项,则主题会在首页上显示通过 [Unsplash API](https://source.unsplash.com/) 随机拉取的一张星空壁纸
## 页面
Expand Down
4 changes: 2 additions & 2 deletions packages/theme-gungnir/components/DropdownLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default {
margin-left 0.4rem
.nav-dropdown
.dropdown-item
line-height 1.7rem
line-height 1.9rem
text-transform none
h4
margin 0.45rem 0 0
Expand All @@ -110,7 +110,7 @@ export default {
a
color var(--text-color)
display block
line-height 1.7rem
line-height 1.9rem
position relative
border-bottom none
margin-bottom 0
Expand Down
4 changes: 2 additions & 2 deletions packages/theme-gungnir/components/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ export default {
return bgPath
}
else {
const defaultImg = require('@theme/assets/default-home-bg.svg')
return `url(${defaultImg})`
const bgURL = 'url(https://source.unsplash.com/collection/1065374/1600x900)'
return bgURL
}
},
heroHeight () {
Expand Down
2 changes: 1 addition & 1 deletion packages/theme-gungnir/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@vuepress/plugin-google-analytics": "^1.8.0",
"markdown-it-chain": "^1.3.0",
"md5": "2.3.0",
"oh-vue-icons": "^0.1.7",
"oh-vue-icons": "^0.1.8",
"vuepress-plugin-chart": "^0.1.1",
"vuepress-plugin-container": "^2.1.5",
"vuepress-plugin-roughviz": "^0.1.0",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5933,10 +5933,10 @@ obuf@^1.0.0, obuf@^1.1.2:
resolved "https://registry.npm.taobao.org/obuf/download/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e"
integrity sha1-Cb6jND1BhZ69RGKS0RydTbYZCE4=

oh-vue-icons@^0.1.7:
version "0.1.7"
resolved "https://registry.npm.taobao.org/oh-vue-icons/download/oh-vue-icons-0.1.7.tgz#3e701ed7938f6de1661edf39249ab4e2763c5362"
integrity sha1-PnAe15OPbeFmHt85JJq04nY8U2I=
oh-vue-icons@^0.1.8:
version "0.1.8"
resolved "https://registry.npm.taobao.org/oh-vue-icons/download/oh-vue-icons-0.1.8.tgz#eecba4c3b3651b8af1d54d5cc620f5e69aa72d05"
integrity sha1-7sukw7NlG4rx1U1cxiD15pqnLQU=
dependencies:
core-js "^3.4.4"

Expand Down

1 comment on commit 229d2f7

@vercel
Copy link

@vercel vercel bot commented on 229d2f7 Feb 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.