Skip to content

Commit 4a56581

Browse files
dakerjourdain
authored andcommitted
docs(website): fix website examples
1 parent 68fb62c commit 4a56581

File tree

222 files changed

+63
-72
lines changed

Some content is hidden

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

222 files changed

+63
-72
lines changed

.github/workflows/pr-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ jobs:
2424
- name: Tests must not use test.only
2525
run: bash .github/workflows/test-only-check.sh
2626
- name: API docs should generate without error
27-
run: npm run doc:generate-api
27+
run: npm run docs:generate-api

.github/workflows/publish.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,13 @@ jobs:
8080
run: npm ci
8181
- name: Build
8282
run: npm run build:release
83-
- name: Build examples
84-
run: npm run build:examples
85-
- name: Build API docs
83+
- name: Generate API docs
8684
run: npm run docs:generate-api
87-
- name: Build docs examples
85+
- name: Generate docs examples
8886
run: npm run docs:generate-examples
89-
- name: Build docs sidebar
87+
- name: Generate docs sidebar
9088
run: npm run docs:generate-sidebar
91-
- name: Build docs gallery
89+
- name: Generate docs gallery
9290
run: npm run docs:generate-gallery
9391
- name: Build docs
9492
run: npm run docs:build

CONTRIBUTING.md

Lines changed: 8 additions & 8 deletions

Documentation/.vitepress/config.mts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,21 @@ import llmstxt from 'vitepress-plugin-llms';
33
import { copyOrDownloadAsMarkdownButtons } from 'vitepress-plugin-llms';
44

55
import { sidebar } from './sidebar';
6+
import { BASE_URL, withBase } from './utils';
67

78
// https://vitepress.dev/reference/site-config
8-
const isProd = process.env.NODE_ENV === 'production';
9-
109
export default defineConfig({
11-
base: '/vtk-js',
10+
base: BASE_URL,
1211
lang: 'en-US',
1312
title: 'VTK.js ',
1413
description: 'VTK.js a Visualization Toolkit for the Web',
15-
srcDir: './content',
1614
lastUpdated: true,
1715
ignoreDeadLinks: true,
16+
srcExclude: ['**/scripts/**',],
1817
vite: {
1918
plugins: [
2019
llmstxt({
21-
ignoreFiles: ['examples/*', 'coverage/*'],
20+
ignoreFiles: ['examples/*', 'coverage/*', 'scripts/*'],
2221
}),
2322
],
2423
},

Documentation/.vitepress/theme/components/ExamplesGallery.vue

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
</div>
1212
<div class="examples-list">
1313
<div v-for="ex in filteredExamples" :key="ex.title" class="example-card">
14-
<a :href="ex.link" :title="ex.title">
15-
<img :src="`/docs/${ex.image}`" :alt="ex.title" />
14+
<a :href="withBase(`/examples/${ex.link}`)" :title="ex.title">
15+
<img :src="withBase(`/${ex.image}`)" :alt="ex.title" />
1616
<h3>{{ ex.title }}</h3>
1717
<p class="category">{{ ex.category }}</p>
1818
</a>
@@ -22,8 +22,9 @@
2222
</template>
2323

2424
<script setup>
25+
import { withBase } from 'vitepress'
2526
import { ref, computed } from 'vue'
26-
import examples from '../../../content/examples/gallery.js'
27+
import examples from '../../../examples/gallery.js'
2728
2829
const search = ref('')
2930
const selectedCategory = ref('')
@@ -84,6 +85,8 @@ const filteredExamples = computed(() => {
8485
display: flex;
8586
flex-wrap: wrap;
8687
gap: 0.5rem;
88+
align-content: center;
89+
justify-content: center;
8790
}
8891
8992
.category-buttons button {
@@ -136,8 +139,8 @@ const filteredExamples = computed(() => {
136139
margin: 0.5rem;
137140
font-size: 1.1rem;
138141
text-overflow: ellipsis;
139-
overflow:hidden;
140-
white-space:nowrap;
142+
overflow: hidden;
143+
white-space: nowrap;
141144
}
142145
143146
.example-card .category {

Documentation/.vitepress/utils.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export const BASE_URL: string = '/vtk-js/'
2+
3+
export const withBase = (path: string): string => `${ BASE_URL + path }`.replace(/\/+/g, '/')
4+
5+
export const isProd: boolean = process.env.NODE_ENV === 'production'
6+
7+
export const isDev: boolean = !isProd
Lines changed: 1 addition & 1 deletion

Documentation/content/coverage/home.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

Documentation/content/docs/concepts_widgets.md renamed to Documentation/docs/concepts_widgets.md

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)