Skip to content

Commit 77b7827

Browse files
committed
Temp fix for vuejs/vuepress#2428
1 parent fe0a419 commit 77b7827

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

docs/.vuepress/config.js

+8
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ module.exports = {
66
}], ['@vuepress/search', {
77
test: ["^((?!device-connect\/transactions).)*$"]
88
}]],
9+
mounted() {
10+
const hash = document.location.hash;
11+
if (hash.length > 1) {
12+
const id = hash.substring(1)
13+
const element = document.getElementById(id)
14+
if (element) element.scrollIntoView()
15+
}
16+
},
917
themeConfig: {
1018
logo: '/logo.svg',
1119
heroText: ' ',

docs/.vuepress/theme/index.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extend: '@vuepress/theme-default'
3+
}
+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<template>
2+
<Layout>
3+
<div slot="page-bottom" class="footer">
4+
<p>
5+
<span class="item">Copyright © {{ new Date().getFullYear() }}</span>
6+
<span class="item">Moshpit Technologies Pvt. Ltd.</span>
7+
</p>
8+
</div>
9+
</Layout>
10+
</template>
11+
12+
<script>
13+
import Layout from '@vuepress/theme-default/layouts/Layout.vue'
14+
export default {
15+
components: {
16+
Layout
17+
},
18+
mounted() {
19+
// Fix scrolling to the referenced element upon initial page load
20+
const hash = document.location.hash;
21+
if (hash.length > 1) {
22+
const id = hash.substring(1)
23+
const element = document.getElementById(id)
24+
if (element) element.scrollIntoView()
25+
}
26+
}
27+
}
28+
</script>
29+
30+
<style scoped>
31+
.footer {
32+
text-align: center;
33+
color: #4e6e8e;
34+
padding: 0 2rem;
35+
}
36+
.footer .item {
37+
white-space: nowrap;
38+
}
39+
</style>

0 commit comments

Comments
 (0)