Skip to content

Commit

Permalink
Merge pull request #62 from ATQQ/bugfix/theme-v0.1.5
Browse files Browse the repository at this point in the history
Bugfix/theme v0.1.5
  • Loading branch information
ATQQ authored Feb 20, 2023
2 parents 7682fca + 8120390 commit babb6ba
Show file tree
Hide file tree
Showing 9 changed files with 675 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"devDependencies": {
"sass": "^1.56.1",
"typescript": "^4.8.2",
"vitepress": "1.0.0-alpha.33"
"vitepress": "1.0.0-alpha.47"
},
"author": "粥里有勺糖",
"license": "MIT"
Expand Down
7 changes: 7 additions & 0 deletions packages/theme/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @sugarat/theme

## 0.1.6

### Patch Changes

- fix: 最新版vitepress首页顶部Nav穿透背景图
- fix: 修复window路径问题

## 0.1.5

### Patch Changes
Expand Down
4 changes: 4 additions & 0 deletions packages/theme/demo/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ export default defineConfig({
},
themeConfig: {
...blogTheme,
footer: {
message: `Power By <a target="_blank" href="https://theme.sugarat.top/"> @sugarat/theme@${packageJSON.version} </a>`,
copyright: 'MIT Licensed | Copyright © 粥里有勺糖'
},
nav: [
{
text: `v${packageJSON.version}`,
Expand Down
7 changes: 7 additions & 0 deletions packages/theme/demo/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ tag:

# Changelog

## 0.1.6 (2023/02/20)

### Patch Changes

- fix: 最新版vitepress首页顶部Nav穿透背景图
- fix: 修复window路径问题

## 0.1.5 (2023/02/19)

### Patch Changes
Expand Down
10 changes: 5 additions & 5 deletions packages/theme/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sugarat/theme",
"version": "0.1.5",
"version": "0.1.6",
"description": "简约风的 Vitepress 博客主题,sugarat vitepress blog theme",
"main": "src/index.ts",
"exports": {
Expand Down Expand Up @@ -46,13 +46,13 @@
"gray-matter": "^4.0.3"
},
"devDependencies": {
"@element-plus/icons-vue": "^2.0.10",
"element-plus": "^2.2.28",
"sass": "^1.56.1",
"tsup": " ^6.5.0",
"typescript": "^4.8.2",
"vitepress": "^1.0.0-alpha.33",
"vue": "^3.2.45",
"@element-plus/icons-vue": "^2.0.10",
"element-plus": "^2.2.28"
"vitepress": "1.0.0-alpha.46",
"vue": "^3.2.45"
},
"pnpm": {
"peerDependencyRules": {
Expand Down
6 changes: 6 additions & 0 deletions packages/theme/src/components/BlogApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ const { Layout } = Theme
max-width: 1126px;
}
@media screen and (min-width: 960px) {
.home {
padding-top: var(--vp-nav-height);
}
}
.header-banner {
width: 100%;
padding: 60px 0;
Expand Down
15 changes: 13 additions & 2 deletions packages/theme/src/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,22 @@ export function getThemeConfig(cfg?: Partial<Theme.BlogConfig>) {
// 去除 srcDir 处理目录名
if (route.startsWith('./')) {
route = route.replace(
new RegExp(`^\\.\\/${path.join(srcDir, '/')}`),
new RegExp(
`^\\.\\/${path
.join(srcDir, '/')
.replace(new RegExp(`\\${path.sep}`, 'g'), '/')}`
),
''
)
} else {
route = route.replace(new RegExp(`^${path.join(srcDir, '/')}`), '')
route = route.replace(
new RegExp(
`^${path
.join(srcDir, '/')
.replace(new RegExp(`\\${path.sep}`, 'g'), '/')}`
),
''
)
}

const fileContent = fs.readFileSync(v, 'utf-8')
Expand Down
9 changes: 9 additions & 0 deletions packages/theme/src/styles/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ html[class='dark'] {
);
}

@media screen and (min-width: 960px) {
#VPContent.VPContent{
padding-top: 0;
.VPHome{
min-height: 100vh;
}
}
}

@media screen and (max-width: 959px) {
.VPNav {
background-color: var(--nav-bgc);
Expand Down
Loading

0 comments on commit babb6ba

Please sign in to comment.