Skip to content

Commit

Permalink
docs: update theme
Browse files Browse the repository at this point in the history
  • Loading branch information
brenoepics committed Feb 19, 2024
1 parent 921b92c commit 33c8cd9
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 77 deletions.
27 changes: 8 additions & 19 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { DefaultTheme, defineConfig } from 'vitepress'
import { defineConfigWithTheme, DefaultTheme } from 'vitepress'
import { replaceTextPlugin } from './replaceTextPlugin'
import { AT4J_VERSION, AT4JRelease } from './repository'
import baseConfig from 'vitepress-carbon/config'
import type { ThemeConfig } from 'vitepress-carbon/config'

const REPO_VERSION: string = await AT4J_VERSION()

Expand Down Expand Up @@ -83,7 +85,8 @@ export const sidebar = {
]
}

export default defineConfig({
export default defineConfigWithTheme<ThemeConfig>({
extends: baseConfig,
lang: 'en-US',
title: 'AT4J',
description: 'AT4J - Azure Translator for Java',
Expand Down Expand Up @@ -112,11 +115,13 @@ export default defineConfig({
provider: 'local'
},

outline: [2, 3],

socialLinks: [
{
icon: {
svg: '<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Postman</title><path fill="#EF5B25" d="M13.527.099C6.955-.744.942 3.9.099 10.473c-.843 6.572 3.8 12.584 10.373 13.428 6.573.843 12.587-3.801 13.428-10.374C24.744 6.955 20.101.943 13.527.099zm2.471 7.485a.855.855 0 0 0-.593.25l-4.453 4.453-.307-.307-.643-.643c4.389-4.376 5.18-4.418 5.996-3.753zm-4.863 4.861l4.44-4.44a.62.62 0 1 1 .847.903l-4.699 4.125-.588-.588zm.33.694l-1.1.238a.06.06 0 0 1-.067-.032.06.06 0 0 1 .01-.073l.645-.645.512.512zm-2.803-.459l1.172-1.172.879.878-1.979.426a.074.074 0 0 1-.085-.039.072.072 0 0 1 .013-.093zm-3.646 6.058a.076.076 0 0 1-.069-.083.077.077 0 0 1 .022-.046h.002l.946-.946 1.222 1.222-2.123-.147zm2.425-1.256a.228.228 0 0 0-.117.256l.203.865a.125.125 0 0 1-.211.117h-.003l-.934-.934-.294-.295 3.762-3.758 1.82-.393.874.874c-1.255 1.102-2.971 2.201-5.1 3.268zm5.279-3.428h-.002l-.839-.839 4.699-4.125a.952.952 0 0 0 .119-.127c-.148 1.345-2.029 3.245-3.977 5.091zm3.657-6.46l-.003-.002a1.822 1.822 0 0 1 2.459-2.684l-1.61 1.613a.119.119 0 0 0 0 .169l1.247 1.247a1.817 1.817 0 0 1-2.093-.343zm2.578 0a1.714 1.714 0 0 1-.271.218h-.001l-1.207-1.207 1.533-1.533c.661.72.637 1.832-.054 2.522zM18.855 6.05a.143.143 0 0 0-.053.157.416.416 0 0 1-.053.45.14.14 0 0 0 .023.197.141.141 0 0 0 .084.03.14.14 0 0 0 .106-.05.691.691 0 0 0 .087-.751.138.138 0 0 0-.194-.033z"/></svg>' },
svg: '<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Postman</title><path fill="#EF5B25" d="M13.527.099C6.955-.744.942 3.9.099 10.473c-.843 6.572 3.8 12.584 10.373 13.428 6.573.843 12.587-3.801 13.428-10.374C24.744 6.955 20.101.943 13.527.099zm2.471 7.485a.855.855 0 0 0-.593.25l-4.453 4.453-.307-.307-.643-.643c4.389-4.376 5.18-4.418 5.996-3.753zm-4.863 4.861l4.44-4.44a.62.62 0 1 1 .847.903l-4.699 4.125-.588-.588zm.33.694l-1.1.238a.06.06 0 0 1-.067-.032.06.06 0 0 1 .01-.073l.645-.645.512.512zm-2.803-.459l1.172-1.172.879.878-1.979.426a.074.074 0 0 1-.085-.039.072.072 0 0 1 .013-.093zm-3.646 6.058a.076.076 0 0 1-.069-.083.077.077 0 0 1 .022-.046h.002l.946-.946 1.222 1.222-2.123-.147zm2.425-1.256a.228.228 0 0 0-.117.256l.203.865a.125.125 0 0 1-.211.117h-.003l-.934-.934-.294-.295 3.762-3.758 1.82-.393.874.874c-1.255 1.102-2.971 2.201-5.1 3.268zm5.279-3.428h-.002l-.839-.839 4.699-4.125a.952.952 0 0 0 .119-.127c-.148 1.345-2.029 3.245-3.977 5.091zm3.657-6.46l-.003-.002a1.822 1.822 0 0 1 2.459-2.684l-1.61 1.613a.119.119 0 0 0 0 .169l1.247 1.247a1.817 1.817 0 0 1-2.093-.343zm2.578 0a1.714 1.714 0 0 1-.271.218h-.001l-1.207-1.207 1.533-1.533c.661.72.637 1.832-.054 2.522zM18.855 6.05a.143.143 0 0 0-.053.157.416.416 0 0 1-.053.45.14.14 0 0 0 .023.197.141.141 0 0 0 .084.03.14.14 0 0 0 .106-.05.691.691 0 0 0 .087-.751.138.138 0 0 0-.194-.033z"/></svg>'
},
link: 'https://www.postman.com/maintenance-astronaut-2993290/workspace/brenoepics/collection/18589822-dfe7a640-9b94-47a8-b19f-46cb9cc8843e?action=share&creator=18589822'
},
{ icon: 'github', link: 'https://github.com/brenoepics/at4j' }
Expand All @@ -134,28 +139,12 @@ export default defineConfig({
},

markdown: {
theme: 'github-dark',
config(md) {
md.use(replaceTextPlugin, 'AT4J-VERSION', REPO_VERSION)
}
},

vite: {
optimizeDeps: {
include: ['gsap', 'dynamics.js'],
exclude: ['@vue/repl']
},
// @ts-ignore
ssr: {
external: ['@vue/repl']
},
server: {
host: true,
fs: {
// for when developing with locally linked theme
allow: ['../..']
}
},
build: {
minify: 'terser',
chunkSizeWarningLimit: Infinity
Expand Down
19 changes: 2 additions & 17 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,2 @@
// https://vitepress.dev/guide/custom-theme
import { h } from 'vue'
import type { Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import './styles/index.css'

export default {
extends: DefaultTheme,
Layout: () => {
return h(DefaultTheme.Layout, null, {
// https://vitepress.dev/guide/extending-default-theme#layout-slots
})
},
enhanceApp({ app, router, siteData }) {
// ...
}
} satisfies Theme
import { VPCarbon } from 'vitepress-carbon'
export default VPCarbon
1 change: 0 additions & 1 deletion docs/.vitepress/theme/styles/index.css

This file was deleted.

15 changes: 0 additions & 15 deletions docs/.vitepress/theme/styles/utilities.css

This file was deleted.

5 changes: 5 additions & 0 deletions docs/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module 'vitepress-carbon/config' {
import { UserConfig } from 'vitepress'
const config: () => Promise<UserConfig>
export default config
}
22 changes: 1 addition & 21 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"engines": {
"node": ">=14.0.0"
},
"type": "module",
"scripts": {
"dev": "vitepress",
Expand All @@ -10,28 +7,11 @@
},
"dependencies": {
"axios": "^1.6.7",
"dynamics.js": "^1.1.5",
"gsap": "^3.9.0",
"vitepress": "1.0.0-rc.33",
"vue": "^3.4.0"
"vitepress-carbon": "^1.0.0"
},
"devDependencies": {
"@types/markdown-it": "^12.2.3",
"@types/node": "^20.10.1",
"terser": "^5.14.2"
},
"pnpm": {
"overrides": {
"@vitejs/plugin-vue": "5.0.0-beta.1"
},
"peerDependencyRules": {
"ignoreMissing": [
"@algolia/client-search",
"react",
"react-dom",
"@types/react",
"search-insights"
]
}
}
}
5 changes: 1 addition & 4 deletions docs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
"allowJs": true,
"strict": true,
"jsx": "preserve",
"baseUrl": ".",
"paths": {
"@theme/*": [".vitepress/theme/*"]
}
"baseUrl": "."
},
"include": ["env.d.ts", "src/**/*", ".vitepress/**/*"]
}

0 comments on commit 33c8cd9

Please sign in to comment.