Skip to content

Commit ac3634b

Browse files
committed
Initial commit
0 parents  commit ac3634b

File tree

675 files changed

+27287
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

675 files changed

+27287
-0
lines changed

Diff for: .gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

Diff for: .github/workflows/deploy.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Deploy
2+
on:
3+
push:
4+
branches: [main]
5+
permissions:
6+
contents: read
7+
pages: write
8+
id-token: write
9+
concurrency:
10+
group: pages
11+
cancel-in-progress: false
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
20+
- uses: pnpm/action-setup@v2
21+
- name: Setup Node
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: 20
25+
cache: pnpm
26+
- name: Setup Pages
27+
uses: actions/configure-pages@v3
28+
- name: Install dependencies
29+
run: pnpm install --prod
30+
- name: Build with VitePress
31+
run: pnpm run build
32+
- name: Upload artifact
33+
uses: actions/upload-pages-artifact@v2
34+
with:
35+
path: docs/.vitepress/dist
36+
deploy:
37+
environment:
38+
name: github-pages
39+
url: ${{ steps.deployment.outputs.page_url }}
40+
needs: build
41+
runs-on: ubuntu-latest
42+
name: Deploy
43+
steps:
44+
- name: Deploy to GitHub Pages
45+
id: deployment
46+
uses: actions/deploy-pages@v2

Diff for: .gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Node
2+
node_modules/
3+
4+
# VitePress
5+
.vitepress/dist
6+
.vitepress/cache

Diff for: .vitepress/config.ts

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import defineConfig from './theme/themeConfig';
2+
3+
export default defineConfig({
4+
base: '/notes/',
5+
cleanUrls: true,
6+
description: "Mateus Etto's notes, a personal knowledge base mainly with programming and Linux "
7+
+ 'tools information.',
8+
head: [
9+
[
10+
'link', {
11+
href: '/favicon.png',
12+
rel: 'icon',
13+
type: 'image/png',
14+
},
15+
],
16+
],
17+
ignoreDeadLinks: 'localhostLinks',
18+
lang: 'en-US',
19+
lastUpdated: true,
20+
scrollOffset: {
21+
padding: 0,
22+
selector: '.topbar',
23+
},
24+
srcDir: './notes/',
25+
themeConfig: {
26+
datetime: {
27+
locale: 'default',
28+
options: {
29+
dateStyle: 'short',
30+
timeStyle: 'short',
31+
},
32+
},
33+
},
34+
titleTemplate: ':title | Notes',
35+
});

Diff for: .vitepress/theme/App.vue

+211
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
<script setup lang="ts">
2+
import '@fontsource/roboto/400.css';
3+
import '@fontsource/roboto/400-italic.css';
4+
import '@fontsource/roboto/700.css';
5+
import '@fontsource/source-code-pro/400.css';
6+
import '@fontsource/source-code-pro/400-italic.css';
7+
import '@fontsource/source-code-pro/700.css';
8+
import { onMounted, ref } from 'vue';
9+
import HomePage from './pages/HomePage.vue';
10+
import NavMenu from './menu/NavMenu.vue';
11+
import NotFoundPage from './pages/NotFoundPage.vue';
12+
import NotePage from './pages/NotePage.vue';
13+
import SideMenu from './menu/SideMenu.vue';
14+
import TopBar from './components/TopBar.vue';
15+
import TopBarButton from './components/TopBarButton.vue';
16+
import { useData } from 'vitepress';
17+
18+
const { page } = useData();
19+
20+
const activeComponent = ref('');
21+
const screenWidth = ref(0);
22+
23+
function updateScreenWidth() {
24+
screenWidth.value = window.innerWidth;
25+
}
26+
27+
onMounted(() => {
28+
window.addEventListener('resize', updateScreenWidth);
29+
updateScreenWidth();
30+
});
31+
</script>
32+
33+
<template>
34+
<div class="wrapper">
35+
<TopBar
36+
v-if="screenWidth < 960"
37+
@activate="(component: string) => activeComponent = component"
38+
/>
39+
<TopBarButton
40+
v-else-if="screenWidth < 1280"
41+
target="nav"
42+
icon="fa-bars"
43+
@activate="(component: string) => activeComponent = component"
44+
/>
45+
<Transition>
46+
<SideMenu
47+
v-if="screenWidth >= 960 || activeComponent == 'side'"
48+
@jump="() => activeComponent = ''"
49+
/>
50+
</Transition>
51+
<div class="content">
52+
<NotFoundPage v-if="page.isNotFound" />
53+
<HomePage v-else-if="page.filePath === 'index.md'" />
54+
<NotePage v-else />
55+
</div>
56+
<Transition>
57+
<NavMenu
58+
v-if="screenWidth >= 1280 || activeComponent == 'nav'"
59+
:small-screen="screenWidth < 1280"
60+
@jump="() => activeComponent = ''"
61+
/>
62+
</Transition>
63+
<Transition>
64+
<div
65+
v-if="screenWidth < 1280 && activeComponent.length"
66+
class="darken"
67+
@click="() => activeComponent = ''"
68+
/>
69+
</Transition>
70+
</div>
71+
</template>
72+
73+
<style>
74+
.wrapper {
75+
position: relative;
76+
display: flex;
77+
}
78+
79+
.content {
80+
position: relative;
81+
min-height: 100vh;
82+
}
83+
84+
@media (width < 960px) {
85+
.content {
86+
width: 100vw;
87+
min-width: 360px;
88+
}
89+
90+
.topbar {
91+
position: fixed;
92+
z-index: 1;
93+
width: 100vw;
94+
height: 55px;
95+
background-color: var(--bg-sec);
96+
border-bottom: 2px solid var(--separator);
97+
}
98+
99+
.sidemenu {
100+
position: fixed;
101+
left: 0;
102+
z-index: 3;
103+
display: block;
104+
width: 280px;
105+
height: 100vh;
106+
background-color: var(--bg-sec);
107+
border-right: 2px solid var(--separator);
108+
}
109+
110+
.sidemenu.v-enter-active,
111+
.sidemenu.v-leave-active {
112+
transition: all 0.25s ease-out;
113+
}
114+
115+
.sidemenu.v-enter-from,
116+
.sidemenu.v-leave-to {
117+
opacity: 0;
118+
transform: translateX(-280px);
119+
}
120+
}
121+
122+
@media (width < 1280px) {
123+
.navmenu {
124+
position: fixed;
125+
right: 0;
126+
z-index: 3;
127+
display: block;
128+
width: 250px;
129+
height: 100vh;
130+
background-color: var(--bg-sec);
131+
border-left: 2px solid var(--separator);
132+
}
133+
134+
.darken {
135+
position: fixed;
136+
z-index: 2;
137+
width: 100vw;
138+
height: 100vh;
139+
background-color: black;
140+
opacity: 0.5;
141+
}
142+
143+
.navmenu.v-enter-active,
144+
.navmenu.v-leave-active,
145+
.darken.v-enter-active,
146+
.darken.v-leave-active {
147+
transition: all 0.25s ease-out;
148+
}
149+
150+
.navmenu.v-enter-from,
151+
.navmenu.v-leave-to {
152+
opacity: 0;
153+
transform: translateX(250px);
154+
}
155+
156+
.darken.v-enter-from,
157+
.darken.v-leave-to {
158+
opacity: 0;
159+
}
160+
}
161+
162+
@media (width >= 960px) and (width < 1280px) {
163+
.navbutton {
164+
z-index: 1;
165+
}
166+
}
167+
168+
@media (width >= 960px) {
169+
.content {
170+
width: 73vw;
171+
}
172+
173+
.sidemenu {
174+
position: relative;
175+
display: flex;
176+
flex-direction: row-reverse;
177+
flex-grow: 1;
178+
background-color: var(--bg-sec);
179+
}
180+
}
181+
182+
@media (width >= 1280px) {
183+
.content {
184+
width: 750px;
185+
}
186+
187+
.navmenu {
188+
position: relative;
189+
display: block;
190+
flex-grow: 1;
191+
background-color: unset;
192+
border-left: unset;
193+
}
194+
195+
.navbutton {
196+
display: none;
197+
}
198+
}
199+
200+
@media (width >= 1440px) {
201+
.content {
202+
width: 850px;
203+
}
204+
}
205+
206+
@media (width >= 1920px) {
207+
.content {
208+
width: 1000px;
209+
}
210+
}
211+
</style>

0 commit comments

Comments
 (0)