Skip to content

Commit

Permalink
Fix broken doc link on "Read More" button on SQLite driver dependency…
Browse files Browse the repository at this point in the history
… installation message (#1331)

* Support documentation page redirection (fix #1330)
  • Loading branch information
gjsjohnmurray committed May 22, 2024
1 parent 2d9f934 commit e29275b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export type Frontmatter = {
dir?: 'ltr' | 'rtl';
ogLocale?: string;
lang?: string;
redirect?: string;
};

export const KNOWN_LANGUAGES = {
Expand Down
23 changes: 23 additions & 0 deletions docs/src/layouts/Redirect.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
import * as CONFIG from '../config';
type Props = {
frontmatter: CONFIG.Frontmatter;
};
const { frontmatter } = Astro.props as Props;
---

<html dir={frontmatter.dir ?? 'ltr'} lang={frontmatter.lang ?? 'en-us'} class="initial">
<head>
{frontmatter.redirect ? (
<meta
http-equiv="refresh"
content={ `0; url=${ frontmatter.redirect }` }
/>
) : null}
</head>

<body>
</body>
</html>
2 changes: 1 addition & 1 deletion docs/src/pages/en/contributing/documentation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Here is the process for improving this documentation.

1. Fork the repository.
2. Clone your fork.
3. Open the project workspace (`vscode-sqltools.code-workspace`) withj VS Code.
3. Open the project workspace (`vscode-sqltools.code-workspace`) with VS Code.
4. Create a branch from the `dev` branch.
5. Expand the `docs` root folder.
6. Edit pages. For example this page is at `src/pages/en/contributing/documentation.mdx` within `docs`
Expand Down
5 changes: 5 additions & 0 deletions docs/src/pages/en/drivers/sqlite.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: SQLite redirect page for Read More button of Dependency Manager dialog
layout: ../../../layouts/Redirect.astro
redirect: sq-lite
---

0 comments on commit e29275b

Please sign in to comment.