Skip to content

Commit 3159c40

Browse files
committed
separating examples in a repository of its own at https://github.com/ESA-EarthCODE/examples
1 parent a4c3d64 commit 3159c40

22 files changed

+11
-2768
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ concurrency:
2323
group: pages
2424
cancel-in-progress: false
2525

26-
env:
27-
# BASE_URL for MyST build
28-
BASE_URL: /${{ github.event.repository.name }}/examples
29-
3026
jobs:
3127
deploy:
3228
runs-on: ubuntu-latest
@@ -50,22 +46,10 @@ jobs:
5046
run: npm ci # or pnpm install / yarn install / bun install
5147
- name: Build with VitePress
5248
run: npm run build # or pnpm docs:build / yarn docs:build / bun run docs:build
53-
- name: Move VitePress build under path /documentation
54-
run: mkdir deploy && mv .vitepress/dist/ deploy/documentation/
55-
- name: Install MyST
56-
run: npm install -g mystmd
57-
- name: Build MyST HTML Assets
58-
run: cd examples/ && myst build --html
59-
- name: Move MyST build under path /examples
60-
run: mv examples/_build/html/ deploy/examples/
61-
- name: Add index.html for initial links
62-
run: echo 'EarthCODE <a href="documentation/">Documentation</a> and <a href="examples/">examples</a>' > deploy/index.html
63-
- name: No Jekyll build
64-
run: touch deploy/.nojekyll
6549
- name: Deploy
6650
uses: JamesIves/github-pages-deploy-action@v4
6751
with:
68-
folder: deploy/
52+
folder: .vitepress/dist
6953
branch: gh-pages
7054
clean-exclude: pr-preview
7155
force: false

.github/workflows/preview.yml

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ on:
1818
# do not allow running multiple of pipelines for this PR in parallel
1919
concurrency: preview-${{ github.ref }}
2020

21-
env:
22-
# BASE_URL for MyST build
23-
BASE_URL: /${{ github.event.repository.name }}/pr-preview/pr-${{ github.event.number }}/examples
24-
2521
jobs:
2622
deploy-preview:
2723
runs-on: ubuntu-latest
@@ -50,26 +46,11 @@ jobs:
5046
env:
5147
PR_NUMBER: ${{ github.event.number }}
5248
if: github.event.action != 'closed'
53-
run: sed -e "s|/documentation/documentation/|/documentation/pr-preview/pr-${PR_NUMBER}/documentation/|g" -i .vitepress/config.mjs
49+
run: sed -e "s|/documentation/|/documentation/pr-preview/pr-${PR_NUMBER}/documentation/|g" -i .vitepress/config.mjs
5450
- name: Build with VitePress
5551
if: github.event.action != 'closed'
5652
run: npm run build # or pnpm docs:build / yarn docs:build / bun run docs:build
57-
- name: Move VitePress build under path /documentation
58-
if: github.event.action != 'closed'
59-
run: mkdir deploy && mv .vitepress/dist/ deploy/documentation/
60-
- name: Install MyST
61-
if: github.event.action != 'closed'
62-
run: npm install -g mystmd
63-
- name: Build MyST HTML Assets
64-
if: github.event.action != 'closed'
65-
run: cd examples/ && myst build --html
66-
- name: Move MyST build under path /examples
67-
if: github.event.action != 'closed'
68-
run: mv examples/_build/html/ deploy/examples/
69-
- name: Add index.html for initial links
70-
if: github.event.action != 'closed'
71-
run: echo 'EarthCODE <a href="documentation/">Documentation</a> and <a href="examples/">examples</a>' > deploy/index.html
7253
- name: Deploy preview
7354
uses: rossjrw/pr-preview-action@v1
7455
with:
75-
source-dir: deploy/
56+
source-dir: .vitepress/dist/

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
node_modules
22
.vitepress/dist
33
.vitepress/cache
4-
examples/_build
54
.DS_Store
65
pages/.DS_Store
76
pages/Community and Collaboration/.DS_Store

.vitepress/config.mjs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ const sideBar = withSidebar(
1010
titleTemplate: " EarthCODE",
1111
collapsed: true,
1212
description: "Documentation for the EarthCODE website",
13-
base: "/documentation/documentation/",
14-
ignoreDeadLinks: [
15-
// ignore all links include "/examples/""
16-
/\/examples\//,
17-
],
13+
base: "/documentation/",
1814
head: [
1915
["link", { rel: "icon", href: "/img/EarthCODE_Favicon_32x32px.png" }],
2016
// Open Graph / Facebook
@@ -110,7 +106,7 @@ const sideBar = withSidebar(
110106
)
111107

112108
const trainingSection = sideBar.themeConfig.sidebar.find(section => section.text === 'Training and Resources')
113-
trainingSection.items.push({ text: 'Examples', link: 'https://esa-earthcode.github.io/documentation/examples/' })
109+
trainingSection.items.push({ text: 'Examples', link: 'https://esa-earthcode.github.io/examples/' })
114110

115111
sideBar.themeConfig.sidebar.forEach(group => {
116112
group.collapsed = true;

README.md

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,10 @@
11
# EarthCODE Documentation
22

3-
The EarthCODE Documentation has two parts, the documentation using VitePress and examples using MyST.
3+
The EarthCODE Documentation using VitePress.
44

55
```
66
npm install
7-
```
8-
9-
## Documentation
10-
11-
Using VitePress
12-
13-
```
147
npm run dev
158
npm run build
169
npm run preview
1710
```
18-
19-
## Examples
20-
21-
Using MyST
22-
23-
```
24-
myst start
25-
```

0 commit comments

Comments
 (0)