Skip to content

Commit f8c28de

Browse files
authored
Refactor DocumentationVersionHint component and update styles (#307)
2 parents e191f93 + 4739b0d commit f8c28de

File tree

21 files changed

+3000
-3222
lines changed

21 files changed

+3000
-3222
lines changed

.github/actions/pnpm-setup/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
name: pnpm Setup
66
description: Install Node and pnpm, install dependencies
77
runs:
8-
using: "composite"
8+
using: 'composite'
99
steps:
1010
- uses: pnpm/action-setup@v4
1111
with:
12-
version: 9
12+
version: 10
1313
run_install: false
1414

1515
- uses: actions/setup-node@v4
1616
with:
17-
node-version: '20'
17+
node-version: '22'
1818
cache: 'pnpm'
1919

2020
- run: pnpm install

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: ./.github/actions/pnpm-setup
1717

1818
- name: Lint
19-
run: pnpm run lint:hard
19+
run: pnpm run lint
2020

2121
- name: Build
2222
run: pnpm run build

.github/workflows/dod-checker.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ on:
44
types: [opened, edited, synchronize]
55

66
concurrency:
7-
group: pr-{{ github.event.pull_request.number }}
7+
group: 'pr-${{ github.event.pull_request.number }}'
88
cancel-in-progress: true
99

1010
jobs:
1111
check-dod:
12-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-latest
1313
steps:
1414
- name: Print Pull Request ID
1515
run: |

.github/workflows/draft-deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
shell: bash
2222
run: |
2323
mkdir -p dist/docs
24-
mv build dist/docs/2.2/
24+
mv build dist/v2/
2525
2626
- name: Netlify Deploy
2727
uses: netlify/actions/cli@master
@@ -47,6 +47,6 @@ jobs:
4747
issue-number: ${{ github.event.pull_request.number }}
4848
body: |
4949
Netlify Draft Deployment
50-
URL: ${{ steps.netlify.outputs.NETLIFY_URL }}/docs/2.2
50+
URL: ${{ steps.netlify.outputs.NETLIFY_URL }}/v2
5151
Logs: ${{ steps.netlify.outputs.NETLIFY_LOGS_URL }}
5252
edit-mode: replace

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535

3636
- name: Bump version
3737
shell: bash
38-
run: pnpm version patch --no-git-tag-version
38+
run: pnpm version prerelease --no-git-tag-version
3939

4040
- name: Commit and push changes
4141
uses: stefanzweifel/git-auto-commit-action@v5

.kolibri.config.json

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

.npmrc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1 @@
1-
# - npm
2-
legacy-peer-deps=true
3-
save-exact=true
4-
5-
# - pnpm
6-
auto-install-peers=true
7-
prefer-offline=true
81
shamefully-hoist=true
9-
strict-peer-dependencies=false

.prettierrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"printWidth": 120,
3+
"singleQuote": true,
4+
"useTabs": true
5+
}

docusaurus.config.js renamed to docusaurus.config.ts

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
// @ts-check
22
// Note: type annotations allow type checking and IDEs autocompletion
33

4-
const { themes } = require('prism-react-renderer');
4+
import { themes } from 'prism-react-renderer';
5+
import type { Config } from '@docusaurus/types';
6+
import type { PostCssOptions } from '@docusaurus/types';
7+
import tailwindcss from 'tailwindcss';
8+
import autoprefixer from 'autoprefixer';
59

6-
const PUBLIC_BASE_URL = 'https://public-ui.github.io/';
10+
const PUBLIC_BASE_URL = 'https://public-ui.github.io';
711

8-
/** @type {import('@docusaurus/types').Config} */
9-
const config = {
12+
const config: Config = {
1013
title: 'KoliBri - Public UI',
1114
tagline: 'The accessible Web Component Library',
12-
url: 'https://public-ui.github.io',
13-
baseUrl: '/docs/2.2/',
15+
url: PUBLIC_BASE_URL,
16+
baseUrl: '/v2/',
1417
onBrokenLinks: 'throw',
1518
trailingSlash: false,
1619
onBrokenMarkdownLinks: 'warn',
@@ -33,11 +36,11 @@ const config = {
3336
[
3437
'classic',
3538
/** @type {import('@docusaurus/preset-classic').Options} */
36-
({
39+
{
3740
docs: {
38-
routeBasePath: '/',
41+
routeBasePath: '/docs',
3942
sidebarCollapsible: true,
40-
sidebarPath: require.resolve('./sidebars.js'),
43+
sidebarPath: './sidebars.js',
4144
// Remove this to remove the "edit this page" links.
4245
// editUrl: 'https://github.com/public-ui/documentation/blob/main/packages/docusaurus/',
4346
// lastVersion: 'current',
@@ -49,23 +52,22 @@ const config = {
4952
// },
5053
},
5154
blog: false,
52-
pages: false,
5355
sitemap: {
5456
changefreq: 'daily',
5557
priority: 0.5,
5658
ignorePatterns: ['/blog/tags/**', '/docs/tags/**'],
5759
filename: 'sitemap.xml',
5860
},
5961
theme: {
60-
customCss: require.resolve('./src/css/custom.css'),
62+
customCss: './src/css/custom.css',
6163
},
62-
}),
64+
},
6365
],
6466
],
6567

6668
themeConfig:
6769
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
68-
({
70+
{
6971
navbar: {
7072
title: 'KoliBri',
7173
logo: {
@@ -78,24 +80,28 @@ const config = {
7880
position: 'left',
7981
dropdownActiveClassDisabled: true,
8082
dropdownItemsAfter: [
83+
{
84+
type: 'html',
85+
className: 'dropdown-archived-versions',
86+
value: '<strong class="dropdown__link">Version 2</strong>',
87+
},
8188
{
8289
type: 'html',
8390
value: '<hr class="dropdown-separator">',
8491
},
8592
{
8693
type: 'html',
8794
className: 'dropdown-archived-versions',
88-
value: '<b>Archive</b>',
95+
value: '<span class="dropdown__link">Version 1</span>',
8996
},
90-
{ to: `${PUBLIC_BASE_URL}docs/2.2/`, label: '2.2' },
9197
],
9298
},
9399
{
94100
label: 'Dokumentation',
95-
to: '/',
101+
to: '/docs',
96102
position: 'left',
97103
},
98-
{ to: `${PUBLIC_BASE_URL}blog`, label: 'Blog', position: 'left' },
104+
{ to: `${PUBLIC_BASE_URL}/blog`, label: 'Blog', position: 'left' },
99105
{ type: 'search', position: 'right' },
100106
// {
101107
// href: 'https://public-ui.github.io/designer',
@@ -120,15 +126,15 @@ const config = {
120126
items: [
121127
{
122128
label: 'Dokumentation',
123-
to: '/',
129+
to: '/docs',
124130
},
125131
{
126132
label: 'Blog',
127-
to: `${PUBLIC_BASE_URL}blog`,
133+
to: `${PUBLIC_BASE_URL}/blog`,
128134
},
129135
{
130136
label: 'Impressum',
131-
to: `${PUBLIC_BASE_URL}docs/impressum`,
137+
to: `${PUBLIC_BASE_URL}/docs/impressum`,
132138
},
133139
],
134140
},
@@ -180,18 +186,23 @@ const config = {
180186
dark: 'forest',
181187
},
182188
},
183-
}),
189+
},
184190
markdown: {
185191
mermaid: true,
186192
},
187193
plugins: [
188194
async () => {
189195
return {
190196
name: 'docusaurus-tailwindcss',
191-
configurePostCss(postcssOptions) {
197+
198+
configurePostCss(postcssOptions: PostCssOptions) {
192199
// Appends TailwindCSS and AutoPrefixer.
193-
postcssOptions.plugins.push(require('tailwindcss'));
194-
postcssOptions.plugins.push(require('autoprefixer'));
200+
if (!Array.isArray(postcssOptions.plugins)) {
201+
postcssOptions.plugins = [];
202+
}
203+
204+
postcssOptions.plugins.push(tailwindcss());
205+
postcssOptions.plugins.push(autoprefixer());
195206
return postcssOptions;
196207
},
197208
};
@@ -239,4 +250,4 @@ const config = {
239250
themes: ['@docusaurus/theme-mermaid'],
240251
};
241252

242-
module.exports = config;
253+
export default config;

0 commit comments

Comments
 (0)