Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #183 from terwer/v4.x
fix:Tag support and SEO
- Loading branch information
Showing
8 changed files
with
139 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
<template> | ||
<el-container> | ||
<el-main> | ||
<el-row> | ||
<el-col :xs="0" :md="2"> </el-col> | ||
<el-col :xs="24" :md="20"> | ||
<el-main> | ||
<el-container> | ||
<el-main> | ||
<el-container> | ||
<el-header> | ||
<HeaderTime /> | ||
</el-header> | ||
<el-header> | ||
<Header /> | ||
</el-header> | ||
<el-main> | ||
<Body :keyword="tag" :post-list="postListArray" /> | ||
</el-main> | ||
</el-container> | ||
</el-main> | ||
</el-container> | ||
</el-main> | ||
</el-col> | ||
<el-col :xs="0" :md="2"> </el-col> | ||
</el-row> | ||
<el-row> | ||
<el-col> | ||
<el-footer> | ||
<Footer :site-config="siteConfigObj" /> | ||
<FriendLink /> | ||
</el-footer> | ||
</el-col> | ||
</el-row> | ||
</el-main> | ||
</el-container> | ||
</template> | ||
|
||
<script> | ||
import { getLogger } from "../../util/logger"; | ||
import HeaderTime from "../../components/themes/default/HeaderTime"; | ||
import Header from "../../components/themes/default/Header"; | ||
import Body from "../../components/themes/default/Body"; | ||
import Footer from "../../components/themes/default/Footer"; | ||
import FriendLink from "../../components/themes/default/FriendLink"; | ||
const logger = getLogger("pages/post"); | ||
export default { | ||
components: { HeaderTime, Header, Body, Footer, FriendLink }, | ||
async asyncData({ $axios }) { | ||
const siteConfigResult = await $axios.$post("/site/config/list"); | ||
const siteConfigObj = | ||
siteConfigResult.status === 1 ? siteConfigResult.data : {}; | ||
logger.info("fetch siteConfig and postList finish"); | ||
return { siteConfigObj }; | ||
}, | ||
data() { | ||
return { | ||
tag: this.$route.params.tag | ||
? this.$route.params.tag.replace(/\.[^/.]+$/, "") | ||
: "", | ||
postListArray: [] | ||
}; | ||
}, | ||
head() { | ||
return { | ||
title: this.siteConfigObj.webname + " - " + this.siteConfigObj.webslogen, | ||
meta: [ | ||
{ | ||
name: "keywords", | ||
content: this.siteConfigObj.keywords | ||
}, | ||
{ | ||
hid: "description", | ||
name: "description", | ||
content: this.siteConfigObj.description | ||
} | ||
] | ||
}; | ||
}, | ||
async mounted() { | ||
const postsResult = await this.$axios.$post("/blog/post/list", { | ||
postStatus: "publish", | ||
tags: this.tag | ||
}); | ||
this.postListArray = postsResult.status === 1 ? postsResult.data.list : []; | ||
} | ||
}; | ||
</script> | ||
|
||
<style lang="scss"> | ||
@import "../common.css"; | ||
@import "../default.css"; | ||
</style> | ||
|
||
<style scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44e6540
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
jvue – ./
jvue-git-master-terwergreen.vercel.app
jvue4.vercel.app
www.terwer.space
jvue-terwergreen.vercel.app
terwer.space