Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Commit cfde938

Browse files
committed
Initial commit
0 parents  commit cfde938

21 files changed

+3588
-0
lines changed

.eslintrc.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
node: true,
5+
},
6+
extends: [
7+
"plugin:vue/essential",
8+
"eslint:recommended",
9+
"@vue/prettier",
10+
"plugin:prettier/recommended",
11+
],
12+
parserOptions: {
13+
parser: "babel-eslint",
14+
},
15+
ignorePatterns: ["node_modules/", "dist/"],
16+
rules: {
17+
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
18+
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
19+
"vue/max-attributes-per-line": "off",
20+
"vue/no-v-html": "off",
21+
"prettier/prettier": ["error", { semi: false }],
22+
"vue/html-self-closing": "off",
23+
semi: [2, "never"],
24+
},
25+
}

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
github: System-Glitch
2+
patreon: system_glitch
3+
custom: https://blockstream.info/address/bc1qk2sut30zvry8glr6yca7tlgc39knepjp86ywpt

.github/workflows/publish.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Publish
2+
on:
3+
release:
4+
types:
5+
- created
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v1
12+
- uses: actions/setup-node@v1
13+
with:
14+
node-version: 14
15+
- uses: JS-DevTools/npm-publish@v1
16+
with:
17+
token: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.vscode
2+
node_modules

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Jérémy LAMBERT (SystemGlitch)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Vuepress Goyave
2+
3+
The Vuepress theme for the [Goyave documentation](https://system-glitch.github.io/goyave/).
4+
5+
Features:
6+
- Dark theme
7+
- Color blindness friendly
8+
- New containers
9+
- Images in text (left or right)
10+
- Monospace box (compatible with formatting)
11+
- Wrapping grid
12+
- Back to top
13+
14+
## Installation
15+
16+
```
17+
npm install --save-dev vuepress-theme-goyave
18+
```
19+
20+
Set the theme in your vuepress config (`.vuepress/config.js`):
21+
```js
22+
module.exports = {
23+
theme: "goyave"
24+
}
25+
```
26+
27+
## New containers
28+
29+
### Image in text (left)
30+
31+
```md
32+
::: img-row <img :src="$withBase('/image.svg')" height="150" alt="Image description"/>
33+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
34+
:::
35+
```
36+
37+
### Image in text (right)
38+
39+
```md
40+
::: img-row-right <img :src="$withBase('/image.svg')" height="150" alt="Image description"/>
41+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
42+
:::
43+
```
44+
45+
### Monospace box
46+
47+
```md
48+
:::vue
49+
Monospace text **compatible** with *formatting*.
50+
:::
51+
```
52+
53+
### Wrapping grid
54+
55+
```md
56+
::: table
57+
[Link 1](#link-1)
58+
[Link 2](#link-2)
59+
[Link 3](#link-3)
60+
[Link 4](#link-4)
61+
[Link 5](#link-5)
62+
[Link 6](#link-6)
63+
:::
64+
```

components/Home.vue

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<template>
2+
<component :is="$page.frontmatter.homeComponent || 'ParentHome'" />
3+
</template>
4+
5+
<script>
6+
import ParentHome from "@parent-theme/components/Home.vue"
7+
8+
export default {
9+
components: {
10+
ParentHome,
11+
},
12+
}
13+
</script>

components/Navbar.vue

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
<template>
2+
<header class="navbar">
3+
<SidebarButton @toggle-sidebar="$emit('toggle-sidebar')" />
4+
<router-link :to="$localePath" class="home-link">
5+
<img
6+
v-if="$site.themeConfig.logo"
7+
class="logo"
8+
:src="$withBase($site.themeConfig.logo)"
9+
:alt="$siteTitle"
10+
/>
11+
<span
12+
v-if="$siteTitle"
13+
ref="siteName"
14+
class="site-name"
15+
:class="{ 'can-hide': $site.themeConfig.logo }"
16+
>{{ $siteTitle }}</span
17+
>
18+
</router-link>
19+
<div
20+
class="links"
21+
:style="
22+
linksWrapMaxWidth ? { 'max-width': linksWrapMaxWidth + 'px' } : {}
23+
"
24+
>
25+
<UserSettings />
26+
<AlgoliaSearchBox v-if="isAlgoliaSearch" :options="algolia" />
27+
<SearchBox
28+
v-else-if="
29+
$site.themeConfig.search !== false &&
30+
$page.frontmatter.search !== false
31+
"
32+
/>
33+
<NavLinks class="can-hide" />
34+
</div>
35+
</header>
36+
</template>
37+
38+
<script>
39+
import AlgoliaSearchBox from "@AlgoliaSearchBox"
40+
import SearchBox from "@SearchBox"
41+
import SidebarButton from "@parent-theme/components/SidebarButton.vue"
42+
import NavLinks from "@parent-theme/components/NavLinks.vue"
43+
import UserSettings from "@theme/components/settings/UserSettings.vue"
44+
45+
function css(el, property) {
46+
// NOTE: Known bug, will return 'auto' if style value is 'auto'
47+
const win = el.ownerDocument.defaultView
48+
// null means not to return pseudo styles
49+
return win.getComputedStyle(el, null)[property]
50+
}
51+
52+
export default {
53+
components: {
54+
SidebarButton,
55+
NavLinks,
56+
SearchBox,
57+
AlgoliaSearchBox,
58+
UserSettings,
59+
},
60+
data() {
61+
return {
62+
linksWrapMaxWidth: null,
63+
}
64+
},
65+
computed: {
66+
algolia() {
67+
return (
68+
this.$themeLocaleConfig.algolia || this.$site.themeConfig.algolia || {}
69+
)
70+
},
71+
isAlgoliaSearch() {
72+
return this.algolia && this.algolia.apiKey && this.algolia.indexName
73+
},
74+
},
75+
mounted() {
76+
const MOBILE_DESKTOP_BREAKPOINT = 719 // refer to config.styl
77+
const NAVBAR_VERTICAL_PADDING =
78+
parseInt(css(this.$el, "paddingLeft")) +
79+
parseInt(css(this.$el, "paddingRight"))
80+
const handleLinksWrapWidth = () => {
81+
if (document.documentElement.clientWidth < MOBILE_DESKTOP_BREAKPOINT) {
82+
this.linksWrapMaxWidth = null
83+
} else {
84+
this.linksWrapMaxWidth =
85+
this.$el.offsetWidth -
86+
NAVBAR_VERTICAL_PADDING -
87+
((this.$refs.siteName && this.$refs.siteName.offsetWidth) || 0)
88+
}
89+
}
90+
handleLinksWrapWidth()
91+
window.addEventListener("resize", handleLinksWrapWidth, false)
92+
},
93+
}
94+
</script>
95+
96+
<style lang="stylus">
97+
$navbar-vertical-padding = 0.7rem;
98+
$navbar-horizontal-padding = 1.5rem;
99+
100+
.navbar {
101+
padding: $navbar-vertical-padding $navbar-horizontal-padding;
102+
line-height: $navbarHeight - 1.4rem;
103+
104+
a, span, img {
105+
display: inline-block;
106+
}
107+
108+
.logo {
109+
height: $navbarHeight - 1.4rem;
110+
min-width: $navbarHeight - 1.4rem;
111+
margin-right: 0.8rem;
112+
vertical-align: top;
113+
}
114+
115+
.site-name {
116+
font-size: 1.3rem;
117+
font-weight: 600;
118+
color: $textColor;
119+
position: relative;
120+
}
121+
122+
.links {
123+
padding-left: 1.5rem;
124+
box-sizing: border-box;
125+
background-color: white;
126+
white-space: nowrap;
127+
font-size: 0.9rem;
128+
position: absolute;
129+
right: $navbar-horizontal-padding;
130+
top: $navbar-vertical-padding;
131+
display: flex;
132+
133+
.search-box {
134+
flex: 0 0 auto;
135+
vertical-align: top;
136+
}
137+
}
138+
}
139+
140+
@media (max-width: $MQMobile) {
141+
.navbar {
142+
padding-left: 4rem;
143+
144+
.can-hide {
145+
display: none;
146+
}
147+
148+
.links {
149+
padding-left: 1.5rem;
150+
}
151+
152+
.site-name {
153+
width: calc(100vw - 9.4rem);
154+
overflow: hidden;
155+
white-space: nowrap;
156+
text-overflow: ellipsis;
157+
}
158+
}
159+
}
160+
</style>

components/Page.vue

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<template>
2+
<main class="page">
3+
<slot name="top"></slot>
4+
<Content class="theme-default-content"></Content>
5+
<PageEdit />
6+
<PageNav v-bind="{ sidebarItems }" />
7+
<slot name="bottom"></slot>
8+
</main>
9+
</template>
10+
11+
<script>
12+
import PageEdit from "@parent-theme/components/PageEdit.vue"
13+
import PageNav from "@parent-theme/components/PageNav.vue"
14+
15+
export default {
16+
components: { PageEdit, PageNav },
17+
props: ["sidebarItems"],
18+
}
19+
</script>
20+
21+
<style lang="stylus">
22+
.page {
23+
display: block;
24+
padding-bottom: 2rem;
25+
}
26+
</style>

components/settings/DarkThemeIcon.vue

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<template>
2+
<svg
3+
aria-hidden="true"
4+
data-prefix="fas"
5+
data-icon="cog"
6+
class="svg-inline--fa fa-cog fa-w-16"
7+
role="img"
8+
xmlns="http://www.w3.org/2000/svg"
9+
viewBox="0 0 16 16"
10+
>
11+
<!-- eslint-disable-next-line vue/html-self-closing -->
12+
<path
13+
fill="currentColor"
14+
d="M8 0c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zM8 15c-3.9 0-7-3.1-7-7 0-2.4 1.2-4.6 3.2-5.9-0.1 0.6-0.2 1.3-0.2 1.9 0 4.9 4 8.9 8.9 9-1.3 1.3-3 2-4.9 2z"
15+
/>
16+
</svg>
17+
</template>
18+
19+
<script>
20+
export default {
21+
name: "DarkThemeIcon",
22+
}
23+
</script>

0 commit comments

Comments
 (0)