Skip to content

Commit

Permalink
Merge pull request #1097 from VKCOM/fix/github-pages
Browse files Browse the repository at this point in the history
Fix/GitHub pages
  • Loading branch information
8coon authored Oct 16, 2024
2 parents d7e16ee + 1bc67d1 commit 41fd3ac
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/static/meta/favicon.ico" />
<link rel="icon" href="/vkui-tokens/static/meta/favicon.ico" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Webpack React description" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no, user-scalable=no, viewport-fit=cover"
/>
<link rel="apple-touch-icon" href="/static/meta/apple-touch-icon.png" />
<link rel="apple-touch-icon" href="/vkui-tokens/static/meta/apple-touch-icon.png" />
<title>VKUI Tokens documentation</title>
</head>
<body>
Expand Down
6 changes: 3 additions & 3 deletions docs/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ const articles = [

const router = createBrowserRouter([
{
path: "/",
path: "/vkui-tokens",
element: <Tokens />,
},
{
path: "/articles",
path: "/vkui-tokens/articles",
element: <Articles items={articles} />
},
...articles
.filter((article) => !!article.slug)
.map((article) => (
{
path: `/articles/${article.slug}`,
path: `/vkui-tokens/articles/${article.slug}`,
element: <Articles items={articles} contentsHtml={article.contents}/>
}
)),
Expand Down
4 changes: 2 additions & 2 deletions docs/src/components/layouts/shared/AsideMenu/AsideMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function AsideMenu(props: AsideMenuProps) {
if (item.slug) {
return (
<div className="aside-menu-item" key={item.title}>
<Link to={`/articles/${item.slug}`}>{item.title}</Link>
<Link to={`/vkui-tokens/articles/${item.slug}`}>{item.title}</Link>
</div>
);
} else {
Expand All @@ -41,7 +41,7 @@ export function AsideMenu(props: AsideMenuProps) {
})}

<Spacing size={32}/>
<Link to="/">← К таблице токенов</Link>
<Link to="/vkui-tokens">← К таблице токенов</Link>
</Card>
</aside>
);
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/pages/Tokens/TokensHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const TokensHeader: FC = () => {
</div>
<div className="flex items-center" style={styles.linkContainer}>
<Icon16HelpOutline style={{ color: '#99A2AD', marginRight: 6 }}/>
<RouterLink to="/articles/new-theme" style={{textDecoration: 'none'}}>
<RouterLink to="/vkui-tokens/articles/new-theme" style={{textDecoration: 'none'}}>
<Link>
Документация
</Link>
Expand Down
8 changes: 8 additions & 0 deletions docs/webpack/webpack.client.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export default function (env, argv) {
}),
new HtmlWebpackPlugin({
template: './public/index.html',
publicPath: '/vkui-tokens/'
}),
new WebpackNotifierPlugin({ alwaysNotify: false }),
new CopyWebpackPlugin({
Expand All @@ -82,6 +83,13 @@ export default function (env, argv) {
hot: true,
open: true,
historyApiFallback: true,
proxy: [
{
context: ["/vkui-tokens/assets"],
target: "http://localhost:3000",
pathRewrite: { "^/vkui-tokens/(.*)": "/$1" },
},
]
},
};
};

0 comments on commit 41fd3ac

Please sign in to comment.