Skip to content

Commit

Permalink
footer
Browse files Browse the repository at this point in the history
  • Loading branch information
yliaho committed Apr 30, 2018
1 parent 702e4cc commit 15011eb
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Layout.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
<template>
<div class="theme-container" :class="pageClasses">
<component :is="layout"/>
<ValleFooter/>
</div>
</template>

<script>
import Home from './layouts/Home.vue'
import Post from './layouts/Post.vue'
import ValleFooter from './components/ValleFooter.vue'
export default {
name: 'layout',
components: {
Home,
Post
Post,
ValleFooter
},
computed: {
Expand Down
26 changes: 26 additions & 0 deletions components/ValleFooter.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<template>
<footer>
<span>
{{copyright}} – <a :href="$moduleMeta().url">{{$moduleMeta().name}}</a>
</span>
</footer>
</template>

<script>
export default {
name: 'valle-footer',
computed: {
author() {
return this.$site.themeConfig.author
},
copyright() {
return `Copyright © ${new Date().getFullYear()} ${this.author}`
}
}
}
</script>

<style>
</style>
14 changes: 14 additions & 0 deletions enhanceApp.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { compareAsc, compareDesc } from 'date-fns'
import { flatten } from 'lodash'
import { md, stripMd } from './utils/index'
//@ts-ignore
import pkg from './package.json'

export default ({ Vue, options, router, siteData: { themeConfig } }) => {
Vue.mixin({
Expand Down Expand Up @@ -58,6 +60,18 @@ export default ({ Vue, options, router, siteData: { themeConfig } }) => {
return postCollection.sort((a, b) =>
compareDesc(a.frontmatter.date, b.frontmatter.date)
)
},

$moduleMeta() {
const {
name,
repository: { url }
} = pkg

return {
name,
url
}
}
}
})
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/yliaho/vuepress-theme-valle.git"
"url": "https://github.com/yliaho/vuepress-theme-valle.git"
},
"keywords": ["static-site", "blog", "vue", "vuepress"],
"bugs": {
Expand Down
1 change: 0 additions & 1 deletion styles/theme.styl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ html
body
line-height: 1.4
height: initial;
// font-family: CamphorPro-Regular

a
text-decoration: none
Expand Down

0 comments on commit 15011eb

Please sign in to comment.