Merge pull request #65 from vuepress-reco/feature/reco

Feature/reco
This commit is contained in:
reco_luan 2019-10-17 20:33:19 +08:00 committed by GitHub
commit a12b6cb875
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 33 additions and 22 deletions

View File

@ -96,8 +96,8 @@ export default {
posts () { posts () {
let posts = this.$site.pages let posts = this.$site.pages
posts = posts.filter(item => { posts = posts.filter(item => {
const { home, isTimeLine, date } = item.frontmatter const { home, date } = item.frontmatter
return !(home == true || isTimeLine == true || date === undefined) return !(home == true || date === undefined)
}) })
posts.sort((a, b) => { posts.sort((a, b) => {
return this._getTimeNum(b) - this._getTimeNum(a) return this._getTimeNum(b) - this._getTimeNum(a)
@ -162,8 +162,8 @@ export default {
getPages () { getPages () {
let pages = this.$site.pages let pages = this.$site.pages
pages = pages.filter(item => { pages = pages.filter(item => {
const { home, isTimeLine, date } = item.frontmatter const { home, date } = item.frontmatter
return !(home == true || isTimeLine == true || date === undefined) return !(home == true || date === undefined)
}) })
// reverse() // reverse()
this.pages = pages.length == 0 ? [] : pages this.pages = pages.length == 0 ? [] : pages

View File

@ -2,7 +2,7 @@
<main class="page" :class="recoShow?'reco-show': 'reco-hide'"> <main class="page" :class="recoShow?'reco-show': 'reco-hide'">
<slot name="top"/> <slot name="top"/>
<div class="page-title" v-if="!(isTimeLine)"> <div class="page-title">
<h1>{{$page.title}}</h1> <h1>{{$page.title}}</h1>
<hr> <hr>
<PageInfo :pageInfo="$page"></PageInfo> <PageInfo :pageInfo="$page"></PageInfo>
@ -10,8 +10,6 @@
<Content/> <Content/>
<TimeLine v-if="isTimeLine"></TimeLine>
<footer class="page-edit"> <footer class="page-edit">
<div <div
class="edit-link" class="edit-link"
@ -74,10 +72,9 @@
<script> <script>
import PageInfo from '@theme/components/PageInfo' import PageInfo from '@theme/components/PageInfo'
import { resolvePage, outboundRE, endingSlashRE } from '../util' import { resolvePage, outboundRE, endingSlashRE } from '../util'
import TimeLine from '@theme/components/TimeLine'
export default { export default {
components: { PageInfo, TimeLine }, components: { PageInfo },
props: ['sidebarItems'], props: ['sidebarItems'],
@ -89,9 +86,6 @@ export default {
}, },
computed: { computed: {
isTimeLine () {
return this.$frontmatter.isTimeLine
},
lastUpdated () { lastUpdated () {
return this.$page.lastUpdated return this.$page.lastUpdated
}, },

View File

@ -25,6 +25,9 @@ module.exports = (options, ctx) => ({
'@vuepress-reco/ga', '@vuepress-reco/ga',
'@vuepress-reco/comments', '@vuepress-reco/comments',
'@vuepress/active-header-links', '@vuepress/active-header-links',
'@vuepress/medium-zoom',
'@vuepress/plugin-nprogress',
'@vuepress/search',
['@vuepress/plugin-blog', { ['@vuepress/plugin-blog', {
permalink: '/:regular', permalink: '/:regular',
frontmatters: [ frontmatters: [
@ -41,11 +44,16 @@ module.exports = (options, ctx) => ({
path: '/categories/', path: '/categories/',
layout: 'Categories', layout: 'Categories',
scopeLayout: 'Category' scopeLayout: 'Category'
},
{
id: 'timeline',
keys: ['timeline'],
path: '/timeline/',
layout: 'TimeLines',
scopeLayout: 'TimeLine'
} }
] ]
}], }],
'@vuepress/search',
'@vuepress/plugin-nprogress',
['container', { ['container', {
type: 'tip', type: 'tip',
defaultTitle: { defaultTitle: {

View File

@ -39,8 +39,8 @@ export default {
handlePosts () { handlePosts () {
let posts = this.$site.pages let posts = this.$site.pages
posts = posts.filter(item => { posts = posts.filter(item => {
const { home, isTimeLine, date } = item.frontmatter const { home, date } = item.frontmatter
return !(home == true || isTimeLine == true || date === undefined) return !(home == true || date === undefined)
}) })
posts.sort((a, b) => { posts.sort((a, b) => {
return this._getTimeNum(b) - this._getTimeNum(a) return this._getTimeNum(b) - this._getTimeNum(a)
@ -137,4 +137,4 @@ export default {
@media (max-width: $MQMobile) @media (max-width: $MQMobile)
.tags-wrapper .tags-wrapper
padding: 5rem 0.6rem 0; padding: 5rem 0.6rem 0;
</style> </style>

View File

@ -1,5 +1,6 @@
<template> <template>
<div> <div>
<Common :sidebar="false" :isComment="false"></Common>
<ul class="timeline-wrapper"> <ul class="timeline-wrapper">
<li class="desc">Yesterday Once More!</li> <li class="desc">Yesterday Once More!</li>
<li v-for="(item, index) in formatPagesArr" :key="index"> <li v-for="(item, index) in formatPagesArr" :key="index">
@ -17,9 +18,11 @@
</template> </template>
<script> <script>
import Common from '@theme/components/Common.vue'
export default { export default {
name: 'TimeLine', name: 'TimeLine',
components: { Common },
data () { data () {
return { return {
pages: [], pages: [],
@ -104,7 +107,7 @@ export default {
.timeline-wrapper .timeline-wrapper
box-sizing border-box box-sizing border-box
max-width: 740px; max-width: 740px;
margin: 0 auto; margin: 4rem auto;
position relative position relative
list-style none list-style none
&::after { &::after {

View File

@ -1,6 +1,6 @@
{ {
"name": "vuepress-theme-reco", "name": "vuepress-theme-reco",
"version": "1.0.9-alpha.13", "version": "1.0.9-alpha.15",
"description": "this is a vuepress theme", "description": "this is a vuepress theme",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
@ -32,6 +32,7 @@
"@vuepress-reco/vuepress-plugin-screenfull": "^1.0.0", "@vuepress-reco/vuepress-plugin-screenfull": "^1.0.0",
"@vuepress-reco/vuepress-plugin-ga": "^1.0.2", "@vuepress-reco/vuepress-plugin-ga": "^1.0.2",
"@vuepress-reco/vuepress-plugin-comments": "1.0.1", "@vuepress-reco/vuepress-plugin-comments": "1.0.1",
"@vuepress/plugin-medium-zoom": "1.2.0",
"@vuepress/plugin-blog": "1.3.0", "@vuepress/plugin-blog": "1.3.0",
"leancloud-storage": "3.13.2", "leancloud-storage": "3.13.2",
"valine": "1.3.6", "valine": "1.3.6",

View File

@ -1,6 +1,3 @@
// colors
$accentColor = #424242
$textColor = #232321
$boxShadow = 0 1px 6px 0 rgba(0, 0, 0, 0.2) $boxShadow = 0 1px 6px 0 rgba(0, 0, 0, 0.2)
$boxShadowHover = 0 2px 16px 0 rgba(0, 0, 0, 0.2) $boxShadowHover = 0 2px 16px 0 rgba(0, 0, 0, 0.2)
$textShadow = 0 2px 4px rgba(0, 0, 0, 0.2); $textShadow = 0 2px 4px rgba(0, 0, 0, 0.2);

View File

@ -291,5 +291,13 @@ th, td
.jump, .jumpinp input .jump, .jumpinp input
box-shadow: $boxShadow box-shadow: $boxShadow
/************** **************/
.search-box input .search-box input
border-radius: $borderRadius border-radius: $borderRadius
/************** **************/
.back-to-ceiling
box-shadow: 0 9px 17px 0 rgba(0,0,0,0.2)!important
background-color: transparent!important