Skip to content

Commit 27e4e14

Browse files
committed
feat: make footer configurable
1 parent 31d20e6 commit 27e4e14

File tree

1 file changed

+37
-21
lines changed
  • packages/vuepress/vuepress-theme-titanium/components

1 file changed

+37
-21
lines changed

packages/vuepress/vuepress-theme-titanium/components/Footer.vue

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,53 @@
11
<template>
22
<footer class="footer">
33
<section class="sitemap">
4-
<section class="sitemap-section">
5-
<h5>Docs</h5>
4+
<section v-for="sitemapConfig in sitemap" class="sitemap-section" :key="sitemapConfig.title">
5+
<h5>{{ sitemapConfig.title }}</h5>
66
<ul>
7-
<li><a href="https://docs.appcelerator.com/" target="_blank">Alloy</a></li>
8-
<li><a href="https://docs.appcelerator.com/" target="_blank">Hyperloop</a></li>
9-
</ul>
10-
</section>
11-
<section class="sitemap-section">
12-
<h5>Community</h5>
13-
<ul>
14-
<li><a href="">Slack</a></li>
15-
</ul>
16-
</section>
17-
<section class="sitemap-section">
18-
<h5>Social</h5>
19-
<ul>
20-
<li><a href="https://github.com/appcelerator" target="_blank">Github</a></li>
21-
<li><a href="https://twitter.com/appcelerator" target="_blank">Twitter</a></li>
22-
<li><a href="http://www.linkedin.com/company/200115" target="_blank">LinkedIn</a></li>
7+
<li v-for="link in sitemapConfig.links" :key="link.text"><a :href="link.link" :target="/^https?:\/\//.test(link.link) ? '_blank' : '_self'">{{ link.text }}</a></li>
238
</ul>
249
</section>
2510
</section>
26-
<a href="https://appcelerator.com" target="_blank">
27-
<img :src="$withBase('/images/axway-appcelerator-logo.png')"/>
11+
<a v-if="logo" :href="logoLink" target="_blank">
12+
<img :src="$withBase(logo)"/>
2813
</a>
2914
<section class="copyright">
30-
Copyright © 2018-present Axway Appcelerator
15+
{{ copyright }}
3116
</section>
3217
</footer>
3318
</template>
3419

20+
<script>
21+
export default {
22+
computed: {
23+
copyright() {
24+
const { themeConfig } = this.$site;
25+
return themeConfig && themeConfig.footerCopyright
26+
},
27+
logo() {
28+
const { themeConfig } = this.$site;
29+
return themeConfig && themeConfig.footerLogo
30+
},
31+
logoLink() {
32+
const { themeConfig } = this.$site;
33+
return themeConfig && themeConfig.footerLogoLink || '/'
34+
},
35+
sitemap() {
36+
const { themeConfig } = this.$site;
37+
const sitemap = themeConfig.footerSitemap || []
38+
return Object.keys(sitemap).map(sitemapColumnTitle => {
39+
const sitemapColumnConfig = sitemap[sitemapColumnTitle]
40+
return {
41+
title: sitemapColumnTitle,
42+
links: sitemapColumnConfig
43+
}
44+
})
45+
}
46+
}
47+
}
48+
</script>
49+
50+
3551
<style lang="stylus">
3652
.footer
3753
background #231f20

0 commit comments

Comments
 (0)