Skip to content

Commit da01645

Browse files
authored
feat: add Vitepress site in place of Docusaurus site (celestiaorg#1169)
From https://github.com/celestiaorg/docs-vitepress/tree/jcs/update-base-url
1 parent ae36967 commit da01645

File tree

250 files changed

+6833
-18499
lines changed

Some content is hidden

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

250 files changed

+6833
-18499
lines changed

.env

-1
This file was deleted.

.eslintrc.json

+16-12
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
{
2-
"extends": ["plugin:mdx/recommended"],
3-
"settings": {
4-
"mdx/code-blocks": true,
5-
"mdx/language-mapper": {}
2+
"env": {
3+
"browser": true,
4+
"es2021": true,
5+
"node": true
66
},
7-
"overrides": [
8-
{
9-
"files": ["*.mdx"],
10-
"rules": {
11-
"no-unused-expressions": "off"
12-
}
13-
}
14-
]
7+
"extends": [
8+
"eslint:recommended",
9+
"plugin:@typescript-eslint/recommended",
10+
"plugin:vue/vue3-essential"
11+
],
12+
"parserOptions": {
13+
"ecmaVersion": "latest",
14+
"parser": "@typescript-eslint/parser",
15+
"sourceType": "module"
16+
},
17+
"plugins": ["@typescript-eslint", "vue"],
18+
"rules": {}
1519
}

.github/workflows/deploy.yml

+38-25
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,57 @@
1-
name: Deploy to GitHub Pages
1+
# Sample workflow for building and deploying a VitePress site to GitHub Pages
2+
#
3+
name: Deploy VitePress site to Pages
24

35
on:
6+
# Runs on pushes targeting the `main` branch. Change this to `master` if you're
7+
# using the `master` branch as the default branch.
48
push:
5-
branches:
6-
- main
9+
branches: [main]
10+
11+
# Allows you to run this workflow manually from the Actions tab
712
workflow_dispatch:
813

14+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
15+
permissions: write-all
16+
17+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
18+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
19+
concurrency:
20+
group: pages
21+
cancel-in-progress: false
22+
923
jobs:
10-
deploy:
11-
name: Deploy to GitHub Pages
24+
# Build job
25+
build:
1226
runs-on: ubuntu-latest
13-
env:
14-
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
15-
permissions: write-all
1627
steps:
17-
- uses: actions/checkout@v3
18-
- uses: actions/setup-node@v3
28+
- name: Checkout
29+
uses: actions/checkout@v3
1930
with:
20-
node-version: 16.x
21-
cache: npm
22-
23-
- run: yarn install --frozen-lockfile
24-
- run: yarn crowdin:sync
25-
- name: Clean Crowdin Front Matter issues
26-
run: bash clean.sh
27-
shell: bash
28-
- run: yarn build
29-
31+
fetch-depth: 0 # Not needed if lastUpdated is not enabled
32+
# - uses: pnpm/action-setup@v2 # Uncomment this if you're using pnpm
33+
- name: Setup Node
34+
uses: actions/setup-node@v3
35+
with:
36+
node-version: 18
37+
cache: yarn # or pnpm / npm
38+
- name: Setup Pages
39+
uses: actions/configure-pages@v3
40+
- name: Install dependencies
41+
run: yarn install # or pnpm install / npm ci
42+
- name: Build with VitePress
43+
run: yarn build # or pnpm docs:build / npm docs:build
3044
- name: Deploy to GitHub Pages
3145
uses: peaceiris/actions-gh-pages@v3
3246
with:
3347
github_token: ${{ secrets.GITHUB_TOKEN }}
34-
publish_dir: ./build
35-
keep_files: ${{ github.event_name == 'push' }}
36-
force_orphan: true
48+
publish_dir: ./.vitepress/dist
49+
keep_files: ${{ github.event_name != 'workflow_dispatch' }}
3750
# The following lines assign commit authorship to the official
3851
# GH-Actions bot for deploys to `gh-pages` branch:
3952
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
4053
# The GH actions bot is used by default if you didn't specify the two fields.
4154
# You can swap them out with your own user credentials.
4255
cname: docs.celestia.org
43-
user_name: YazzyYaz
44-
user_email: yaz@celestia.org
56+
user_name: jcstein
57+
user_email: joshcs@celestia.org

.github/workflows/latest_tags.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,18 @@ jobs:
105105
export default ${{ inputs.network }}Versions;
106106
EOF
107107
)
108-
echo $CONTENTS > docs/constants/\${{ inputs.network }}_versions.js
108+
echo $CONTENTS > .vitepress/constants/\${{ inputs.network }}_versions.js
109109
- name: Install Prettier
110110
run: |
111111
npm install -g prettier
112112
- name: Format the code with Prettier
113113
run: |
114-
prettier docs/constants/\${{ inputs.network }}_versions.js --write
114+
prettier .vitepress/constants/\${{ inputs.network }}_versions.js --write
115115
- name: Open PR
116116
uses: peter-evans/create-pull-request@v4
117117
with:
118118
# This github action has a lot of options, currently we just tweak the
119119
# commit-message and title of the PR.
120120
commit-message: "[automated GH action] update latest release tags & commit sha (${{ inputs.network }})"
121121
title: "[GH Action] Update release tags and commit SHAs for ${{ inputs.network }}"
122-
token: ${{ secrets.PAT_CREATE_PR }}
122+
token: ${{ secrets.PAT_CREATE_PR }}

.github/workflows/lint.yml

-25
This file was deleted.

.github/workflows/preview.yml

+13-5
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,22 @@ jobs:
1818
- name: Checkout
1919
uses: actions/checkout@v3
2020

21-
- name: Install
21+
- name: Setup Node
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: 18
25+
cache: yarn
26+
27+
- name: Install dependencies
2228
run: yarn install --frozen-lockfile
23-
- name: Build
24-
run: BASE_URL='/pr-preview/pr-${{ github.event.number }}/' yarn build
29+
30+
- name: Build with Base URL
31+
run: BASE='/pr-preview/pr-${{ github.event.number }}/' yarn build
32+
2533
- name: Add CNAME file
26-
run: echo docs.celestia.org > ./build/CNAME
34+
run: mkdir -p ./.vitepress/dist && echo docs.celestia.org > .vitepress/dist/CNAME
2735

2836
- name: Deploy preview
2937
uses: rossjrw/pr-preview-action@v1
3038
with:
31-
source-dir: ./build/
39+
source-dir: .vitepress/dist

.github/workflows/test-deploy.yml

-19
This file was deleted.

.gitignore

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
.docusaurus/
2-
build/
3-
node_modules/
4-
i18n/
5-
**/.DS_Store
6-
.idea/
7-
.vscode/
8-
package-lock.json
1+
.vitepress/dist
2+
node_modules
3+
.vitepress/cache/**
4+
*.log
5+
*.tgz
6+
.DS_Store
7+
.idea
8+
.temp
9+
.vite_opt_cache
10+
.vscode

.husky/commit-msg

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx commitlint --edit $1

.husky/pre-commit

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env sh
22
. "$(dirname -- "$0")/_/husky.sh"
33

4-
npx lint-staged && git add . && git commit --no-verify -m 'Apply linting and formatting'
4+
npx lint-staged

.markdownlint.yml

-3
This file was deleted.

.markdownlintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/
+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
<template>
2+
<div class="center">
3+
<button class="keplrButton" @click="add">{{ `Add/switch to ${params.chainName}` }}</button>
4+
</div>
5+
</template>
6+
7+
<script>
8+
export default {
9+
props: ['params'],
10+
methods: {
11+
async add() {
12+
if (!window.keplr) {
13+
alert("Please install keplr extension");
14+
} else {
15+
if (window.keplr.experimentalSuggestChain){
16+
try {
17+
await window.keplr.experimentalSuggestChain({
18+
chainId: this.params.chainId,
19+
chainName: this.params.chainName,
20+
rpc: this.params.rpc,
21+
rest: this.params.rest,
22+
bip44: {
23+
coinType: 118,
24+
},
25+
bech32Config: {
26+
bech32PrefixAccAddr: "celestia",
27+
bech32PrefixAccPub: "celestia" + "pub",
28+
bech32PrefixValAddr: "celestia" + "valoper",
29+
bech32PrefixValPub: "celestia" + "valoperpub",
30+
bech32PrefixConsAddr: "celestia" + "valcons",
31+
bech32PrefixConsPub: "celestia" + "valconspub",
32+
},
33+
currencies: [
34+
{
35+
coinDenom: "TIA",
36+
coinMinimalDenom: "utia",
37+
coinDecimals: 6,
38+
coinGeckoId: "celestia",
39+
},
40+
],
41+
feeCurrencies: [
42+
{
43+
coinDenom: "TIA",
44+
coinMinimalDenom: "utia",
45+
coinDecimals: 6,
46+
coinGeckoId: "celestia",
47+
gasPriceStep: {
48+
low: 0.1,
49+
average: 0.2,
50+
high: 0.4,
51+
},
52+
},
53+
],
54+
stakeCurrency: {
55+
coinDenom: "TIA",
56+
coinMinimalDenom: "utia",
57+
coinDecimals: 6,
58+
coinGeckoId: "celestia",
59+
},
60+
})
61+
} catch {
62+
alert("Failed to suggest the chain");
63+
}
64+
}
65+
const chainId = this.params.chainId;
66+
await window.keplr.enable(chainId);
67+
}
68+
}
69+
}
70+
}
71+
</script>
72+
73+
<style scoped>
74+
.center {
75+
display: flex;
76+
justify-content: center;
77+
align-items: center;
78+
height: 9vh;
79+
}
80+
81+
.keplrButton {
82+
padding: 10px 20px;
83+
background-color: #7B2BF9;
84+
border: none;
85+
color: white;
86+
text-align: center;
87+
text-decoration: none;
88+
display: inline-block;
89+
font-size: 16px;
90+
margin: 4px 2px;
91+
cursor: pointer;
92+
border-radius: 4px;
93+
transition-duration: 0.4s;
94+
}
95+
96+
.keplrButton:hover {
97+
background-color: #FFFFC5;
98+
color: black;
99+
border: 2px solid #7B2BF9;
100+
}
101+
102+
</style>

0 commit comments

Comments
 (0)