Skip to content

Commit 3e5bcb0

Browse files
1e9yantongolub
andauthored
docs: move docs to main branch google#969 (google#985)
* Move documentation from `gh-pages` to `main` branch * Format code with `npm run fmt` * Restore Contribution guide * chore: update package-lock.json to solve CI problem * chore: up deps * build(tsd): disable default nm/@types traversing * chore: up size limit --------- Co-authored-by: Anton Golub <antongolub@antongolub.com>
1 parent 97d0f5f commit 3e5bcb0

Some content is hidden

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

44 files changed

+5258
-400
lines changed

.github/workflows/docs.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
name: Deploy docs
2-
32
on:
4-
push:
5-
branches: ['gh-pages']
63
workflow_dispatch:
4+
release:
5+
types: [created]
76

87
permissions:
98
contents: read
@@ -24,17 +23,17 @@ jobs:
2423
- name: Checkout
2524
uses: actions/checkout@v4
2625
with:
27-
ref: gh-pages
26+
ref: main
2827
- name: Setup Pages
2928
uses: actions/configure-pages@v3
3029
- name: Install deps
3130
run: npm ci
32-
- name: Built docs
33-
run: npm run docs:built
31+
- name: Build docs
32+
run: npm run docs:build
3433
- name: Upload artifact
3534
uses: actions/upload-pages-artifact@v2
3635
with:
37-
path: 'docs'
36+
path: 'docs/build'
3837
- name: Deploy to GitHub Pages
3938
id: deployment
4039
uses: actions/deploy-pages@v2

docs/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/cache/
2+
/build/

docs/.vitepress/config.mts

+131
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
import { defineConfig } from 'vitepress'
2+
3+
// https://vitepress.dev/reference/site-config
4+
export default defineConfig({
5+
base: '/zx/',
6+
outDir: 'build',
7+
cleanUrls: true,
8+
title: 'google/zx',
9+
titleTemplate: ':title | google/zx',
10+
description: 'A tool for writing better scripts',
11+
head: [
12+
[
13+
'link',
14+
{
15+
rel: 'apple-touch-icon',
16+
sizes: '180x180',
17+
href: '/zx/img/favicons/apple-touch-icon.png',
18+
},
19+
],
20+
[
21+
'link',
22+
{
23+
rel: 'icon',
24+
type: 'image/png',
25+
sizes: '32x32',
26+
href: '/zx/img/favicons/favicon-32x32.png',
27+
},
28+
],
29+
[
30+
'link',
31+
{
32+
rel: 'icon',
33+
type: 'image/png',
34+
sizes: '16x16',
35+
href: '/zx/img/favicons/favicon-16x16.png',
36+
},
37+
],
38+
[
39+
'link',
40+
{
41+
rel: 'mask-icon',
42+
href: '/zx/img/favicons/safari-pinned-tab.svg',
43+
color: '#3a0839',
44+
},
45+
],
46+
['link', { rel: 'shortcut icon', href: '/zx/img/favicons/favicon.ico' }],
47+
['meta', { name: 'og:image', content: '/zx/img/og-image.png' }],
48+
['meta', { name: 'twitter:image', content: '/zx/img/og-image.png' }],
49+
],
50+
themeConfig: {
51+
logo: '/img/logo.svg',
52+
// https://vitepress.dev/reference/default-theme-config
53+
nav: [
54+
{ text: 'Home', link: '/' },
55+
{ text: 'Docs', link: '/getting-started' },
56+
{
57+
text: 'v8',
58+
items: [
59+
{ text: 'v8', link: '/migration-from-v7' },
60+
{ text: 'v7', link: '/v7/api' },
61+
],
62+
},
63+
],
64+
65+
sidebar: {
66+
'/': [
67+
{
68+
text: 'Docs',
69+
items: [
70+
{ text: 'Getting Started', link: '/getting-started' },
71+
{ text: 'Setup', link: '/setup' },
72+
{ text: 'API Reference', link: '/api' },
73+
{ text: 'CLI Usage', link: '/cli' },
74+
{ text: 'Configuration', link: '/configuration' },
75+
{ text: 'Process Promise', link: '/process-promise' },
76+
{ text: 'Contribution Guide', link: '/contribution' },
77+
{ text: 'Migration from v7', link: '/migration-from-v7' },
78+
],
79+
},
80+
{
81+
text: 'FAQ',
82+
link: '/faq',
83+
items: [
84+
{ text: 'Quotes', link: '/quotes' },
85+
{ text: 'TypeScript', link: '/typescript' },
86+
{ text: 'Markdown Scripts', link: '/markdown-scripts' },
87+
{ text: 'Known Issues', link: '/known-issues' },
88+
],
89+
},
90+
],
91+
92+
'/v7/': [
93+
{
94+
text: 'Docs (v7)',
95+
items: [
96+
{ text: 'Getting Started', link: '/v7/getting-started' },
97+
{ text: 'Process Promise', link: '/v7/process-promise' },
98+
{ text: 'API Reference', link: '/v7/api' },
99+
{ text: 'Configuration', link: '/v7/configuration' },
100+
{ text: 'CLI Usage', link: '/v7/cli' },
101+
],
102+
},
103+
{
104+
text: 'FAQ',
105+
link: '/v7/faq',
106+
items: [
107+
{ text: 'Quotes', link: '/v7/quotes' },
108+
{ text: 'TypeScript', link: '/v7/typescript' },
109+
{ text: 'Markdown Scripts', link: '/v7/markdown-scripts' },
110+
{ text: 'Known Issues', link: '/v7/known-issues' },
111+
],
112+
},
113+
],
114+
},
115+
116+
socialLinks: [{ icon: 'github', link: 'https://github.com/google/zx' }],
117+
118+
editLink: {
119+
pattern: 'https://github.com/google/zx/blob/main/docs/:path',
120+
},
121+
122+
footer: {
123+
message:
124+
'Disclaimer: This is not an officially supported Google product.',
125+
},
126+
127+
search: {
128+
provider: 'local',
129+
},
130+
},
131+
})

docs/.vitepress/theme/MyLayout.vue

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<script setup>
2+
import DefaultTheme from 'vitepress/theme'
3+
import MyOxygen from './MyOxygen.vue'
4+
5+
const { Layout } = DefaultTheme
6+
</script>
7+
8+
<template>
9+
<Layout>
10+
<template #aside-ads-after>
11+
<MyOxygen />
12+
</template>
13+
</Layout>
14+
</template>

docs/.vitepress/theme/MyOxygen.vue

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<template>
2+
<div class="Oxygen">
3+
<a href="https://webpod.dev/?from=zx-site">
4+
<!--<img src="https://webpod.dev/img/banner.png" alt="Webpod - deploy JavaScript apps">-->
5+
<img
6+
src="https://webpod.dev/img/logo.svg"
7+
alt="Webpod - deploy JavaScript apps"
8+
/>
9+
<p>Webpod – deploy JavaScript apps to own cloud or private server</p>
10+
</a>
11+
</div>
12+
</template>
13+
14+
<style scoped>
15+
.Oxygen {
16+
display: flex;
17+
justify-content: center;
18+
align-items: center;
19+
padding: 24px;
20+
border-radius: 12px;
21+
min-height: 256px;
22+
text-align: center;
23+
line-height: 18px;
24+
font-size: 12px;
25+
font-weight: 500;
26+
background-color: var(--vp-carbon-ads-bg-color);
27+
}
28+
29+
.Oxygen :deep(img) {
30+
margin: 0 auto;
31+
}
32+
33+
.Oxygen :deep(p) {
34+
display: block;
35+
margin: 0 auto;
36+
color: var(--vp-carbon-ads-text-color);
37+
transition: color 0.25s;
38+
}
39+
40+
.Oxygen :deep(p:hover) {
41+
color: var(--vp-carbon-ads-hover-text-color);
42+
}
43+
</style>
44+
<script setup></script>

docs/.vitepress/theme/custom.css

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
:root {
2+
--vp-home-hero-name-color: transparent;
3+
--vp-home-hero-name-background: -webkit-linear-gradient(
4+
120deg,
5+
#f11a7b 10%,
6+
#feffac
7+
);
8+
9+
--vp-home-hero-image-background-image: linear-gradient(
10+
-45deg,
11+
rgba(241, 26, 123, 0.33) 50%,
12+
rgba(254, 255, 172, 0.33) 50%
13+
);
14+
--vp-home-hero-image-filter: blur(40px);
15+
}
16+
17+
@media (min-width: 640px) {
18+
:root {
19+
--vp-home-hero-image-filter: blur(56px);
20+
}
21+
}
22+
23+
@media (min-width: 960px) {
24+
:root {
25+
--vp-home-hero-image-filter: blur(72px);
26+
}
27+
}

docs/.vitepress/theme/index.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import DefaultTheme from 'vitepress/theme'
2+
import MyLayout from './MyLayout.vue'
3+
import './custom.css'
4+
5+
export default {
6+
...DefaultTheme,
7+
// override the Layout with a wrapper component that
8+
// injects the slots
9+
Layout: MyLayout,
10+
}

0 commit comments

Comments
 (0)