Skip to content

Commit

Permalink
fix: pager
Browse files Browse the repository at this point in the history
  • Loading branch information
Renovamen committed Feb 7, 2021
1 parent 00a1850 commit 0435bf6
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 26 deletions.
2 changes: 1 addition & 1 deletion packages/theme-gungnir/components/Common.vue
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export default {
width 100vw
height 100vh
display none
background-color rgba(0, 0, 0, .65)
background-color rgba(0, 0, 0, .55)
.sidebar
.mobile-hero-avatar
margin 0 auto
Expand Down
1 change: 0 additions & 1 deletion packages/theme-gungnir/components/Page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ export default {
},
mounted() {
console.log(this.$page.readingTime)
this.codeFullScreen()
},
methods: {
Expand Down
24 changes: 12 additions & 12 deletions packages/theme-gungnir/components/Pager.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
<template>
<div class="pager">
<router-link
v-if="data.prev"
class="previous"
:to="data.prev.link"
>
{{ data.prev.text }}<br>
<span v-if="data.prev.subtext">
{{ data.prev.subtext }}
</span>
</router-link>
<router-link
v-if="data.next"
class="next"
Expand All @@ -20,6 +10,16 @@
{{ data.next.subtext }}
</span>
</router-link>
<router-link
v-if="data.prev"
class="previous"
:to="data.prev.link"
>
{{ data.prev.text }}<br>
<span v-if="data.prev.subtext">
{{ data.prev.subtext }}
</span>
</router-link>
</div>
</template>

Expand Down Expand Up @@ -55,9 +55,9 @@ export default {
letter-spacing 1px
color var(--text-color)
&.next
float right
&.previous
float left
&.previous
float right
span
font-weight normal
color var(--text-color-sub)
Expand Down
12 changes: 6 additions & 6 deletions packages/theme-gungnir/components/PostList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ export default {
getPagerData () {
var pagerData = {}
if(this.$pagination.hasPrev) {
pagerData.prev = {}
pagerData.prev.text = this.$themeLocales.homePrev
pagerData.prev.link = this.$pagination.prevLink
pagerData.next = {}
pagerData.next.text = this.$themeLocales.homePrev
pagerData.next.link = this.$pagination.prevLink
}
if(this.$pagination.hasNext) {
pagerData.next = {}
pagerData.next.text = this.$themeLocales.homeNext
pagerData.next.link = this.$pagination.nextLink
pagerData.prev = {}
pagerData.prev.text = this.$themeLocales.homeNext
pagerData.prev.link = this.$pagination.nextLink
}
return pagerData
}
Expand Down
2 changes: 0 additions & 2 deletions packages/theme-gungnir/layouts/Post.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export default {
},
data () {
return {
navHeight: 0,
isFixed: false,
catalogTop: 0,
screenWidth: 0
Expand All @@ -63,7 +62,6 @@ export default {
}
},
mounted () {
this.navHeight = this.$children[0].$children[0].$refs.navbar.offsetHeight
this.headerHeight = document.querySelector('.post-header').offsetHeight
this.screenWidth = document.body.clientWidth
if (this.screenWidth <= 719) this.catalogTop = -15 // $MQMobile
Expand Down
4 changes: 2 additions & 2 deletions packages/theme-gungnir/locales/en-US.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export default {
// post meta
lastUpdated: 'Last Updated',
editLinkText: 'Edit this page on GitHub',
postPrev: 'Next',
postNext: 'Previous',
postNext: 'Next',
postPrev: 'Previous',

// home page pager
homePrev: '← Newer Posts',
Expand Down
4 changes: 2 additions & 2 deletions packages/theme-gungnir/locales/zh-CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export default {
// post meta
lastUpdated: '上次编辑于',
editLinkText: '在 GitHub 上编辑此页',
postPrev: '下一篇',
postNext: '上一篇',
postNext: '下一篇',
postPrev: '上一篇',

// home page pager
homePrev: '← 较新的文章',
Expand Down

1 comment on commit 0435bf6

@vercel
Copy link

@vercel vercel bot commented on 0435bf6 Feb 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.