Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add linkage for code-groups in getting-started #1906

Merged
merged 1 commit into from
Feb 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions docs/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,22 @@ If you would like to know more about what you can do within the page, for exampl
If you want to know how to customize how the site looks (Theme), and find out the features VitePress's default theme provides, visit [Theme: Introduction](./theme-introduction).

When your documentation site starts to take shape, be sure to read the [deployment guide](./deploying).

<script setup>
import { inBrowser } from 'vitepress'

if (inBrowser) {
window.addEventListener('click', (e) => {
const el = e.target
if (el.matches('.vp-code-group input')) {
const allGroups = document.querySelectorAll('.vp-code-group')
const group = el.parentElement?.parentElement
const i = Array.from(group?.querySelectorAll('input') || []).indexOf(el)
for (let index = 0; index < allGroups.length; index++) {
if (allGroups[index] === group) continue
allGroups[index].querySelectorAll('input')[i].click()
}
}
})
}
</script>