Skip to content

Commit

Permalink
fix: fix the problem that frontmatter contains title and h1 is hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
xcyeye committed Dec 5, 2021
1 parent 7bfed28 commit d1a3981
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
10 changes: 7 additions & 3 deletions Aurora-theme/lib/client/components/Page.vue
Expand Up @@ -2,7 +2,7 @@
<main :style="$store.state.borderRadiusStyle + $store.state.opacityStyle"
class="page sidebar-single-enter-animate" id="article-page">
<slot name="top" />
<div id="theme-default-content" class="theme-default-content pageContent medium-zoom-content">
<div id="theme-default-content" :class="!isHideH1 ? 'hide-h1-tag' : 'show-h1-tag'" class="theme-default-content pageContent medium-zoom-content">
<div class="page-top-share">
<div class="page-top-share-next">
<poster :title="originPageData.title" :content="posterContent"/>
Expand Down Expand Up @@ -36,7 +36,6 @@ import RecommendPage from "./RecommendPage";
import {usePageData} from "@vuepress/client";
import PageNext from "./child/page/PageNext";
import $ from 'jquery'
import {useThemeLocaleData} from "../composables";
const AV = require('leancloud-storage');
export default defineComponent({
name: 'Page',
Expand All @@ -54,7 +53,8 @@ export default defineComponent({
posterContent: '',
title: '',
showMobileCatalog: true,
showPageMeta: true
showPageMeta: true,
isHideH1: true
}
},
props: {
Expand Down Expand Up @@ -90,6 +90,10 @@ export default defineComponent({
const page = usePageData()
this.originPageData = page
if (page.value.frontmatter.title === undefined) {
this.isHideH1 = false
}
this.$emit('getHeadLine',page.value.title)
let lazyLoadingImg = this.themeProperty.lazyLoadingImg
this.lazyLoadingImg = lazyLoadingImg === undefined ? "https://ooszy.cco.vin/img/blog-public/ljz.gif" : lazyLoadingImg
Expand Down
2 changes: 1 addition & 1 deletion Aurora-theme/lib/client/styles/theme.style.css
Expand Up @@ -946,7 +946,7 @@ a[data-v-d8ec41bc] {
margin: 0 auto
}

.medium-zoom-content h1:first-of-type {
.hide-h1-tag h1:first-of-type {
display: none
}

Expand Down
6 changes: 6 additions & 0 deletions docs/readme/readme.md
@@ -1,3 +1,9 @@
---
title: 这是frontmatter
---

# 介绍

## Introduce

<a target="_blank" href="http://aurora.cco.vin/" >Demo</a>
Expand Down

0 comments on commit d1a3981

Please sign in to comment.