Skip to content

Commit

Permalink
config: add support for default keyword in tabs
Browse files Browse the repository at this point in the history
Specifying `tab default` will allow defaulting to this tab on page
load.
  • Loading branch information
lifehackerhansol committed Sep 24, 2024
1 parent cd0e131 commit 87a2ac6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ export default defineConfig({
render: (tokens, idx) => {
const token = tokens[idx];
if (token.nesting === 1) {
return `<Tab name="${token.info.match(/^ ?tab\s+(.*)$/)[1]}">`;
let tokenData = token.info.match(/^ ?tab\s(default\s)?(.*)$/);
let isDefault = typeof tokenData[1] !== 'undefined';
console.log(isDefault);
let name = tokenData[2];
return `<Tab name="${name}" ${isDefault ? "default=true" : ""}>`;
} else {
return `</Tab>\n`;
}
Expand Down
2 changes: 1 addition & 1 deletion docs/recover-vwii-ioses-channels.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ You will be provided with various options. It is recommended to first attempt re

::::: tabs

:::: tab Advanced options
:::: tab default Advanced options

### Advanced options

Expand Down
2 changes: 1 addition & 1 deletion docs/unblock-updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ If you are running Aroma and have deleted the update folder, you need to disable

::::: tabs

:::: tab Removing Aroma Autoboot
:::: tab default Removing Aroma Autoboot

### Removing Aroma Autoboot

Expand Down

0 comments on commit 87a2ac6

Please sign in to comment.