提交 e2fdb6fc 编写于 作者: 茶陵後's avatar 茶陵後 👍

#1 SEO:add baidu tongji

上级 6f311585
...@@ -8,37 +8,22 @@ ...@@ -8,37 +8,22 @@
v-if="data.heroImage" v-if="data.heroImage"
:src="$withBase(data.heroImage)" :src="$withBase(data.heroImage)"
:alt="data.heroAlt || 'hero'" :alt="data.heroAlt || 'hero'"
> />
<h1 <h1 v-if="data.heroText !== null" id="main-title">
v-if="data.heroText !== null" {{ data.heroText || $title || "Hello" }}
id="main-title"
>
{{ data.heroText || $title || 'Hello' }}
</h1> </h1>
<p <p v-if="data.tagline !== null" class="description">
v-if="data.tagline !== null" {{ data.tagline || $description || "Welcome to your VuePress site" }}
class="description"
>
{{ data.tagline || $description || 'Welcome to your VuePress site' }}
</p> </p>
<p <p v-if="data.actionText && data.actionLink" class="action">
v-if="data.actionText && data.actionLink" <NavLink class="action-button" :item="actionLink" />
class="action"
>
<NavLink
class="action-button"
:item="actionLink"
/>
</p> </p>
</header> </header>
<div <div v-if="data.features && data.features.length" class="features">
v-if="data.features && data.features.length"
class="features"
>
<div <div
v-for="(feature, index) in data.features" v-for="(feature, index) in data.features"
:key="index" :key="index"
...@@ -51,131 +36,180 @@ ...@@ -51,131 +36,180 @@
<Content class="theme-default-content custom" /> <Content class="theme-default-content custom" />
<div <div v-if="data.footer" class="footer">
v-if="data.footer"
class="footer"
>
{{ data.footer }} {{ data.footer }}
</div> </div>
<Content <Content v-else slot-key="footer" class="footer" />
v-else
slot-key="footer"
class="footer"
/>
</main> </main>
</template> </template>
<script> <script>
import NavLink from '@theme/components/NavLink.vue' import NavLink from "@theme/components/NavLink.vue";
export default { export default {
name: 'Home', name: "Home",
components: { NavLink }, components: { NavLink },
computed: { computed: {
data () { data() {
return this.$page.frontmatter return this.$page.frontmatter;
}, },
actionLink () { actionLink() {
return { return {
link: this.data.actionLink, link: this.data.actionLink,
text: this.data.actionText text: this.data.actionText,
};
},
},
};
</script>
<script>
var _hmt = _hmt || [];
(function () {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?8eefd6b163dcb3f5762af6b0825e2dd1";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<style lang="stylus">
.home {
padding: $navbarHeight 2rem 0;
max-width: $homePageWidth;
margin: 0px auto;
display: block;
.hero {
text-align: center;
img {
max-width: 100%;
max-height: 280px;
display: block;
margin: 3rem auto 1.5rem;
}
h1 {
font-size: 3rem;
}
h1, .description, .action {
margin: 1.8rem auto;
}
.description {
max-width: 35rem;
font-size: 1.6rem;
line-height: 1.3;
color: lighten($textColor, 40%);
}
.action-button {
display: inline-block;
font-size: 1.2rem;
color: #fff;
background-color: $accentColor;
padding: 0.8rem 1.6rem;
border-radius: 4px;
transition: background-color 0.1s ease;
box-sizing: border-box;
border-bottom: 1px solid darken($accentColor, 10%);
&:hover {
background-color: lighten($accentColor, 10%);
} }
} }
} }
.features {
border-top: 1px solid $borderColor;
padding: 1.2rem 0;
margin-top: 2.5rem;
display: flex;
flex-wrap: wrap;
align-items: flex-start;
align-content: stretch;
justify-content: space-between;
}
.feature {
flex-grow: 1;
flex-basis: 30%;
max-width: 30%;
h2 {
font-size: 1.4rem;
font-weight: 500;
border-bottom: none;
padding-bottom: 0;
color: lighten($textColor, 10%);
}
p {
color: lighten($textColor, 25%);
}
}
.footer {
padding: 2.5rem;
border-top: 1px solid $borderColor;
text-align: center;
color: lighten($textColor, 25%);
}
} }
</script>
<style lang="stylus"> @media (max-width: $MQMobile) {
.home .home {
padding $navbarHeight 2rem 0 .features {
max-width $homePageWidth flex-direction: column;
margin 0px auto }
display block
.hero .feature {
text-align center max-width: 100%;
img padding: 0 2.5rem;
max-width: 100% }
max-height 280px }
display block }
margin 3rem auto 1.5rem
h1 @media (max-width: $MQMobileNarrow) {
font-size 3rem .home {
h1, .description, .action padding-left: 1.5rem;
margin 1.8rem auto padding-right: 1.5rem;
.description
max-width 35rem .hero {
font-size 1.6rem img {
line-height 1.3 max-height: 210px;
color lighten($textColor, 40%) margin: 2rem auto 1.2rem;
.action-button }
display inline-block
font-size 1.2rem h1 {
color #fff font-size: 2rem;
background-color $accentColor }
padding 0.8rem 1.6rem
border-radius 4px h1, .description, .action {
transition background-color .1s ease margin: 1.2rem auto;
box-sizing border-box }
border-bottom 1px solid darken($accentColor, 10%)
&:hover .description {
background-color lighten($accentColor, 10%) font-size: 1.2rem;
.features }
border-top 1px solid $borderColor
padding 1.2rem 0 .action-button {
margin-top 2.5rem font-size: 1rem;
display flex padding: 0.6rem 1.2rem;
flex-wrap wrap }
align-items flex-start }
align-content stretch
justify-content space-between .feature {
.feature h2 {
flex-grow 1 font-size: 1.25rem;
flex-basis 30% }
max-width 30% }
h2 }
font-size 1.4rem }
font-weight 500
border-bottom none
padding-bottom 0
color lighten($textColor, 10%)
p
color lighten($textColor, 25%)
.footer
padding 2.5rem
border-top 1px solid $borderColor
text-align center
color lighten($textColor, 25%)
@media (max-width: $MQMobile)
.home
.features
flex-direction column
.feature
max-width 100%
padding 0 2.5rem
@media (max-width: $MQMobileNarrow)
.home
padding-left 1.5rem
padding-right 1.5rem
.hero
img
max-height 210px
margin 2rem auto 1.2rem
h1
font-size 2rem
h1, .description, .action
margin 1.2rem auto
.description
font-size 1.2rem
.action-button
font-size 1rem
padding 0.6rem 1.2rem
.feature
h2
font-size 1.25rem
</style> </style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册