Skip to content

chore: update all playground links to use shorter format #1

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

Open
wants to merge 118 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
a35b5de
Fix casing of Sass (#2151)
roydukkey Jan 6, 2023
30e1a70
Update utility-types.md (#2152)
reidjs Jan 6, 2023
fed5e19
fix: change a singular noun to plural (#2156)
de-oz Jan 8, 2023
0fc2880
Disable VueJobs widget (#2147)
IsraelOrtuno Jan 8, 2023
7295166
Add more API examples for `watch()` (#2155)
skirtles-code Jan 8, 2023
7b8e101
Reword the opening sentence about declaring events (#2148)
skirtles-code Jan 8, 2023
6ba8270
Minor changes suggested by Prettier (#2146)
skirtles-code Jan 8, 2023
10bfe93
Composition API example of SFC (#2145)
skirtles-code Jan 8, 2023
5e44eeb
Immediate watchers with the Composition API (#2144)
skirtles-code Jan 8, 2023
95aabcf
Add caveats around mixing `<script setup>` and `<script>` (#2149)
skirtles-code Jan 8, 2023
9dd81cd
Add an API entry for `<template>` (#2154)
skirtles-code Jan 8, 2023
e39b5d1
Move component v-model to its own page (#2153)
skirtles-code Jan 8, 2023
a679e81
Document PropType usage with the Composition API (#2157)
skirtles-code Jan 10, 2023
a543171
several small grammar improvements (#2062)
lefht Jan 10, 2023
7b7b4a9
Fix grammar (#2122)
de-oz Jan 10, 2023
1c7055e
new partner: epicmax
yyx990803 Jan 10, 2023
80d2eb5
Add a clarifying comment to a watcher example (#2162)
skirtles-code Jan 10, 2023
196e817
Fix the modal example transition in Firefox (#2163)
skirtles-code Jan 11, 2023
da629b6
Update accessibility.md (#2164)
theSwankyNinja Jan 11, 2023
812dca4
move Damian to emeriti
yyx990803 Jan 12, 2023
124a5f7
remove newsletter links
yyx990803 Jan 12, 2023
a67f1c5
chore: update Nuxt infos (#2166)
atinux Jan 12, 2023
b589d97
Fix wording (#2165)
de-oz Jan 12, 2023
bbca757
newsletters
yyx990803 Jan 15, 2023
86d0a38
add a bottom nav
yyx990803 Jan 15, 2023
95de4cb
setup analytics for sponsor/partner links
yyx990803 Jan 17, 2023
8d63436
docs: update Anthony's info (#2171)
antfu Jan 17, 2023
7884764
update tracking
yyx990803 Jan 18, 2023
817b53e
chore: add missing anchors (#2172)
jay-es Jan 18, 2023
9716e36
Update props.md, fix tiny grammatical error (#2175)
Sabientje65 Jan 18, 2023
a1371b0
Update reactivity-transform.md (#2176)
douglas06mp Jan 18, 2023
24a53b9
Apollo-Vue order changed and text fixes (#2177)
tugcekucukoglu Jan 19, 2023
87c98a3
Fix styleguide - part 2 (#2161)
NataliaTepluhina Jan 19, 2023
3ff3732
partner updates
yyx990803 Jan 21, 2023
b193a13
fix: typo (#2184)
de-oz Jan 24, 2023
67545c1
add contact on sponsor page
yyx990803 Jan 25, 2023
71247b5
fix: typo computed (#2189)
edimitchel Jan 27, 2023
5abf40b
add code style to v-model in src/guide/components/v-model.md (#2192)
wxsms Jan 28, 2023
c978453
docs: fix aria-labelledby example. (#2195)
ByMykel Jan 29, 2023
62bee1f
docs: hyphenate 'real world' when used as an adjective (#2194)
de-oz Jan 29, 2023
db62d3c
update monterail url
yyx990803 Jan 30, 2023
198a796
fix: typo (#2198)
xfq Jan 31, 2023
c36e251
Add missing heading anchors (#2178)
skirtles-code Jan 31, 2023
dd57dce
docs: fix Prop interface type error in example (#2191)
olfek Feb 1, 2023
7e2f358
Revert "docs: fix Prop interface type error in example (#2191)" (#2200)
bencodezen Feb 1, 2023
38b3baa
Fix Vue Mastery link (#2196)
tutorialcode Feb 2, 2023
1cd64a8
epicmax -> platinum
yyx990803 Feb 6, 2023
e2c54b9
improve all partner listing
yyx990803 Feb 6, 2023
fb50503
missed element in TypeScript interface (#2204)
AloisSeckar Feb 7, 2023
4f2e4ce
Add link to Vue School video lesson (#2212)
danielkellyio Feb 7, 2023
67f81a0
update french translation URL
yyx990803 Feb 7, 2023
a3eb853
Fix broken link (#2218)
xfq Feb 8, 2023
ead4aa2
update references to volar
yyx990803 Feb 8, 2023
a3e76cc
Fix broken link in docs (#2223)
Nicolascrd Feb 8, 2023
25d30c5
fix(reactivity): template render result (#2222)
Sunny-117 Feb 8, 2023
d08e661
fix(reactivity-fundamentals): Ref Unwrapping (#2205)
gaxrai Feb 9, 2023
93caf53
Make SiteMap.vue compatible with translations (#2214)
skirtles-code Feb 9, 2023
8df5f60
docs: update not about firefox support for import maps (#2224)
dekatron Feb 9, 2023
2b8b4b5
Update quick-start.md (#2181)
wahid-moh Feb 10, 2023
f4ff204
Fix reference to `defineComponent` type tests (#2226)
fqp Feb 13, 2023
8f9e959
ensure script setup recommendation can be seen when linked from api page
yyx990803 Feb 16, 2023
9c1c4ca
fix: typing component refs (#2210)
Ap3rtur3 Feb 19, 2023
0631aa5
docs(guide-extra): change terminal to `vue-termui` link (#2229)
huynl-96 Feb 19, 2023
382dcd9
missing exclamation marks in examples (#2230)
AloisSeckar Feb 19, 2023
4895c57
Fix vue-tsc link (#2231)
yivi Feb 19, 2023
b243505
Revert "fix: typing component refs (#2210)" (#2235)
NataliaTepluhina Feb 19, 2023
51a019c
add section on connection to signals
yyx990803 Feb 22, 2023
5cc0b37
fix: remove netlify template explorer link (#2239)
edimitchel Feb 22, 2023
cbd9de2
fix: remove custom-renderer.md from extra topics section (#2241)
tlagoda Feb 22, 2023
d8305e7
replace Vuex with Pinia (#2237)
Feb 22, 2023
bb3469c
deprecate Reactivity Transform
yyx990803 Feb 23, 2023
d0bd349
update to signals section
yyx990803 Feb 24, 2023
f64cf09
typo fix: useSignal -> createSignal
yyx990803 Feb 24, 2023
55fafe7
update section on runtime vs compile time reactivity
yyx990803 Feb 24, 2023
eb162a6
Update reactivity-in-depth.md (#2246)
mmalicki Feb 24, 2023
a990513
remove unused title for Custom Renderer (#2252)
tlagoda Feb 26, 2023
e1df70d
fix: add missing id keys (#2255)
edimitchel Feb 28, 2023
63e0246
re-arrange VueSchoolLink like on other pages (#2243)
AloisSeckar Feb 28, 2023
634ad1f
update parnter info
yyx990803 Feb 28, 2023
5cfc2a4
bump vitepress + use dynamic routes for partners
yyx990803 Feb 28, 2023
1bc0434
remove use of reactivity transform
yyx990803 Mar 1, 2023
5944441
Update reactivity-transform.md (#2259)
wxsms Mar 1, 2023
79a9751
chore: use clean URL for internal links
yyx990803 Mar 3, 2023
a19d4a6
chore: use preview instead of serve command
yyx990803 Mar 3, 2023
05e66ef
chore: more internal clean URL fixes
yyx990803 Mar 3, 2023
9ee0774
update partners
yyx990803 Mar 4, 2023
60d2c93
Fixed single typo (#2264)
bitdaw Mar 4, 2023
42cd031
internal clean URLs (#2265)
AloisSeckar Mar 4, 2023
fdd7a7e
Split long comments in code snippet into two lines (#2267)
peterhauke Mar 5, 2023
2b064f6
chore: fix broken url (#2271)
jay-es Mar 7, 2023
14509cb
partner edits
yyx990803 Mar 8, 2023
630692a
bump vitepress
yyx990803 Mar 8, 2023
b9e1f41
Add script to show the Free Weekend banner from Vue School (#2274)
nicodevs Mar 9, 2023
6ae943f
bump theme
yyx990803 Mar 9, 2023
bf04a7c
Fix a typo in ElasticHeader.vue (#2277)
midiidev Mar 9, 2023
09edd7a
Fix staggered list transition demo (#2281)
skirtles-code Mar 11, 2023
6b91389
Add mention of using a key with Transition (#2250)
skirtles-code Mar 11, 2023
7bfbea4
Fix minor language errors (#2268)
peterhauke Mar 11, 2023
bb9b3f7
Update render-function.md (#2272)
wxsms Mar 11, 2023
8cfefd2
Fix animated ElasticHeader demo (#2282)
skirtles-code Mar 11, 2023
d209fc7
Remove excess words and fix minor language issues (#2266)
peterhauke Mar 11, 2023
36f2cff
bump vitepress
yyx990803 Mar 13, 2023
b77752b
bump theme + vitepress
yyx990803 Mar 14, 2023
13280e5
bump theme for mobile dropdown (requires vitepress alpha.60+)
yyx990803 Mar 15, 2023
e7d19fb
give special sponsor explicit size
yyx990803 Mar 17, 2023
4a1208b
bump @vue/repl (fix Safari error log)
yyx990803 Mar 17, 2023
8f8a720
chore: tweak home style
yyx990803 Mar 17, 2023
f1a3abc
bump theme + make example output button visible on mobile
yyx990803 Mar 17, 2023
127093f
Styles: Responsive for Preference Switch (#2285)
sergiopani Mar 18, 2023
1faadee
Change Ukrainian translation as completed (#2289)
matrunchyk Mar 23, 2023
de6053c
Using ComponentPublicInstance with template refs (#2251)
skirtles-code Mar 24, 2023
53d03fa
fix: wrong stable version (#2302)
philfontaine Mar 27, 2023
0ecd513
feat: French translation is complete! (#2292)
edimitchel Mar 27, 2023
859e90a
partner update
yyx990803 Mar 27, 2023
ae8b361
Update template-syntax.md (#2301)
freemedom Mar 30, 2023
76b0fea
fix: replaced comment in SVG example
NataliaTepluhina Mar 30, 2023
7c35d5c
chore: sfc.vuejs.org -> play.vuejs.org
yyx990803 Apr 6, 2023
ecff810
chore: update all playground links to use shorter format
yyx990803 Apr 6, 2023
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
14 changes: 7 additions & 7 deletions .github/contributing/writing-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ Writing documentation is an exercise in empathy. We're not describing an objecti
- Cognitive capacity is **depleted more slowly** when we help them feel consistently smart, powerful, and curious. Breaking things down into digestible pieces and minding the flow of the document can help keep them in this state.
- **Always try to see from the user's perspective.** When we understand something thoroughly, it becomes obvious to us. This is called _the curse of knowledge_. In order to write good documentation, try to remember what you first needed to know when learning this concept. What jargon did you need to learn? What did you misunderstand? What took a long time to really grasp? Good documentation meets users where they are. It can be helpful to practice explaining the concept to people in person before.
- **Describe the _problem_ first, then the solution.** Before showing how a feature works, it's important to explain why it exists. Otherwise, users won't have the context to know if this information is important to them (is it a problem they experience?) or what prior knowledge/experience to connect it to.
- **While writing, don't be afraid to ask questions**, _especially_ if you're afraid they might be "dumb". Being vulnerable is hard, but it's the only way for us to more fully understand what we need to explain.
- **Be involved in feature discussions.** The best APIs come from documentation-driven development, where we build features that are easy to explain, rather than trying to figure out how to explain them later. Asking questions (especially "dumb" questions) earlier often helps reveal confusions, inconsistencies, and problematic behavior before a breaking change would be required to fix them.
- **While writing, don't be afraid to ask questions**, _especially_ if you're afraid that your questions might be "foolish". Being vulnerable is hard, but it's the only way for us to more fully understand what we need to explain.
- **Be involved in feature discussions.** The best APIs come from documentation-driven development, where we build features that are easy to explain, rather than trying to figure out how to explain them later. Asking questions (especially "foolish" questions) earlier often helps reveal confusions, inconsistencies, and problematic behavior before a breaking change would be required to fix them.

## Organization

- **Installation/Integration**: Provide a thorough overview of how to integrate the software into as many different kinds of projects as necessary.
- **Introduction/Getting Started**:
- Provide a less than 10 minute overview of the problems the project solves and why it exists.
- Provide a less than 30 minute overview of the problems the project solves and how, including when and why to use the project and some simple code examples. At the end, link to both to Installation page and the beginning of the Essentials Guide.
- Provide a less than 30 minute overview of the problems the project solves and how, including when and why to use the project and some simple code examples. At the end, link to both the Installation page and the beginning of the Essentials Guide.
- **Guide**: Make users feel smart, powerful, and curious, then maintain this state so that users maintain the motivation and cognitive capacity to keep learning more. Guide pages are meant to be read sequentially, so should generally be ordered from the highest to lowest power/effort ratio.
- **Essentials**: It should take no longer than 5 hours to read the Essentials, though shorter is better. Its goal is to provide the 20% of knowledge that will help users handle 80% of use cases. Essentials can link to more advanced guides and the API, though, in most cases, you should avoid such links. When they are provided, you need also provide a context so users are aware if they should follow this link on their first reading. Otherwise, many users end up exhausting their cognitive capacity link-hopping, trying to fully learn every aspect of a feature before moving on, and as a result, never finish that first read-through of the Essentials. Remember that a smooth read is more important than being thorough. We want to give people the information they need to avoid a frustrating experience, but they can always come back and read further, or Google a less common problem when they encounter it.
- **Advanced**: While the Essentials helps people handle ~80% of use cases, subsequent guides help get users to 95% of use cases, plus more detailed information on non-essential features (e.g. transitions, animations), more complex convenience features (e.g. mixins, custom directives), and dev experience improvements (e.g. JSX, plugins). The final 5% of use cases that are more niche, complex, and/or prone to abuse will be left to the cookbook and API reference, which can be linked to from these advanced guides.
Expand Down Expand Up @@ -59,9 +59,9 @@ Writing documentation is an exercise in empathy. We're not describing an objecti
- **When referencing a directly following example, use a colon (`:`) to end a sentence**, rather than a period (`.`).
- **Use the Oxford comma** (e.g. "a, b, and c" instead of "a, b and c"). ![Why the Oxford comma is important](./oxford-comma.jpg)
- Source: [The Serial (Oxford) Comma: When and Why To Use It](https://www.inkonhand.com/2015/10/the-serial-oxford-comma-when-and-why-to-use-it/)
- **When referencing the name of a project, use the name that project refers to itself as.** For example, "webpack" and "npm" should both use lowercase as that's how their documentation refers to them.
- **When referencing the name of a project, use the name that the project refers to itself as.** For example, "webpack" and "npm" should both use lowercase as that's how their documentation refers to them.
- **Use Title Case for headings** - at least for now, since it's what we use through the rest of the docs. There's research suggesting that sentence case (only first word of the heading starts with a capital) is actually superior for legibility and also reduces the cognitive overhead for documentation writers, since they don't have to try to remember whether to capitalize words like "and", "with", and "about".
- **Don't use emojis (except in discussions).** Emojis are cute and friendly, but they can be a distraction in documentation and some emoji even convey different meanings in different cultures.
- **Don't use emojis (except in discussions).** Emojis are cute and friendly, but they can be a distraction in documentation and some emojis even convey different meanings in different cultures.

## Iteration & Communication

Expand All @@ -87,9 +87,9 @@ Writing documentation is an exercise in empathy. We're not describing an objecti

We have some dedicated styles to denote something that's worth highlighting in a particular way. These are captured [on this page](https://vitepress.vuejs.org/guide/markdown.html#custom-containers). **They are to be used sparingly.**

There is a certain temptation to abuse these styles, as one can simply add a change inside a callout. However, this breaks up the flow of reading for the user, and thus, should only be used in special circumstances. Wherever possible, we should attempt to create a narrative and flow within the page to respect the readers cognitive load.
There is a certain temptation to abuse these styles, as one can simply add a change inside a callout. However, this breaks up the flow of reading for the user and should only be used in special circumstances. Wherever possible, we should attempt to create a narrative and flow within the page to respect the reader's cognitive load.

Under no circumstances should 2 alerts be used next to one another, it's a sign that we're not able to explain context well enough.
Under no circumstances should two alerts be used next to one another, it's a sign that we're not able to explain context well enough.

### Contributing

Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ pnpm-global
# rollup.js default build output
dist/

# vuepress build output
.vuepress/dist
# vitepress build output
.vitepress/dist
.vitepress/cache

# Serverless directories
.serverless/
Expand Down
37 changes: 22 additions & 15 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { defineConfigWithTheme } from 'vitepress'
import type { Config as ThemeConfig } from '@vue/theme'
import baseConfig from '@vue/theme/config'
import { headerPlugin } from './headerMdPlugin'
import { jobsPlugin } from './jobsMdPlugin'

const nav: ThemeConfig['nav'] = [
{
Expand Down Expand Up @@ -33,7 +32,7 @@ const nav: ThemeConfig['nav'] = [
},
{
text: 'Playground',
link: 'https://sfc.vuejs.org'
link: 'https://play.vuejs.org'
},
{
text: 'Ecosystem',
Expand Down Expand Up @@ -88,8 +87,8 @@ const nav: ThemeConfig['nav'] = [
items: [
{ text: 'Blog', link: 'https://blog.vuejs.org/' },
{ text: 'Twitter', link: 'https://twitter.com/vuejs' },
{ text: 'Newsletter', link: 'https://news.vuejs.org/' },
{ text: 'Events', link: 'https://events.vuejs.org/' }
{ text: 'Events', link: 'https://events.vuejs.org/' },
{ text: 'Newsletters', link: '/ecosystem/newsletters' }
]
}
]
Expand Down Expand Up @@ -189,6 +188,7 @@ export const sidebar: ThemeConfig['sidebar'] = {
},
{ text: 'Props', link: '/guide/components/props' },
{ text: 'Events', link: '/guide/components/events' },
{ text: 'Component v-model', link: '/guide/components/v-model' },
{
text: 'Fallthrough Attributes',
link: '/guide/components/attrs'
Expand Down Expand Up @@ -314,15 +314,10 @@ export const sidebar: ThemeConfig['sidebar'] = {
text: 'Animation Techniques',
link: '/guide/extras/animation'
},
{
text: 'Reactivity Transform',
link: '/guide/extras/reactivity-transform'
}
// {
// text: 'Building a Library for Vue',
// link: '/guide/extras/building-a-library'
// },
// { text: 'Custom Renderers', link: '/guide/extras/custom-renderer' },
// {
// text: 'Vue for React Devs',
// link: '/guide/extras/vue-for-react-devs'
Expand Down Expand Up @@ -563,7 +558,6 @@ export default defineConfigWithTheme<ThemeConfig>({
description: 'Vue.js - The Progressive JavaScript Framework',
srcDir: 'src',
srcExclude: ['tutorial/**/description.md'],
scrollOffset: 'header',

head: [
['meta', { name: 'theme-color', content: '#3c8772' }],
Expand Down Expand Up @@ -599,6 +593,13 @@ export default defineConfigWithTheme<ThemeConfig>({
'data-spa': 'auto',
defer: ''
}
],
[
'script',
{
src: 'https://vueschool.io/banner.js?affiliate=vuejs&type=top',
async: 'true'
}
]
],

Expand All @@ -619,6 +620,16 @@ export default defineConfigWithTheme<ThemeConfig>({
text: '日本語',
repo: 'https://github.com/vuejs-translations/docs-ja'
},
{
link: 'https://ua.vuejs.org',
text: 'Українська',
repo: 'https://github.com/vuejs-translations/docs-uk'
},
{
link: 'https://fr.vuejs.org',
text: 'Français',
repo: 'https://github.com/vuejs-translations/docs-fr'
},
{
link: '/translations/',
text: 'Help Us Translate!',
Expand Down Expand Up @@ -662,7 +673,7 @@ export default defineConfigWithTheme<ThemeConfig>({

markdown: {
config(md) {
md.use(headerPlugin).use(jobsPlugin)
md.use(headerPlugin)
}
},

Expand Down Expand Up @@ -692,9 +703,5 @@ export default defineConfigWithTheme<ThemeConfig>({
json: {
stringify: true
}
},

vue: {
reactivityTransform: true
}
})
6 changes: 4 additions & 2 deletions .vitepress/theme/components/Banner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
* 2. uncomment and update BANNER_ID in ../../inlined-scripts/restorePreferences.ts
* 3. update --vt-banner-height if necessary
*/
import { ref } from 'vue'

const open = ref(true)

let open = $ref(true)
/**
* Call this if the banner is dismissible
*/
function dismiss() {
open = false
open.value = false
document.documentElement.classList.add('banner-dismissed')
localStorage.setItem(`vue-docs-banner-${__VUE_BANNER_ID__}`, 'true')
}
Expand Down
25 changes: 18 additions & 7 deletions .vitepress/theme/components/Home.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { onMounted } from 'vue'
import NewsLetter from './NewsLetter.vue'
import SiteMap from './SiteMap.vue'
// import NewsLetter from './NewsLetter.vue'
import { load, data, base } from './sponsors'
import SponsorsGroup from './SponsorsGroup.vue'
import VueMasteryModal from './VueMasteryModal.vue'
Expand All @@ -22,7 +23,7 @@ onMounted(async () => {
user interfaces.
</p>
<p class="actions">
<vue-mastery-modal />
<VueMasteryModal />
<a class="get-started" href="/guide/introduction.html">
Get Started
<svg
Expand All @@ -47,10 +48,19 @@ onMounted(async () => {
<template v-for="{ url, img, name, description } of data.special">
<a :href="url" target="_blank" rel="sponsored noopener">
<picture v-if="img.endsWith('png')">
<source type="image/avif" :srcset="`${base}/images/${img.replace(/\.png$/, '.avif')}`" />
<source
type="image/avif"
:srcset="`${base}/images/${img.replace(/\.png$/, '.avif')}`"
/>
<img :src="`${base}/images/${img}`" :alt="name" />
</picture>
<img v-else :src="`${base}/images/${img}`" :alt="name" />
<img
width="168"
height="42"
v-else
:src="`${base}/images/${img}`"
:alt="name"
/>
</a>
<span>{{ description }}</span>
</template>
Expand Down Expand Up @@ -88,7 +98,8 @@ onMounted(async () => {
<SponsorsGroup tier="gold" placement="landing" />
</section>

<NewsLetter />
<SiteMap />
<!-- <NewsLetter /> -->
</template>

<style scoped>
Expand Down Expand Up @@ -268,7 +279,7 @@ html:not(.dark) .accent,

@media (max-width: 576px) {
#hero {
padding: 64px 32px;
padding: 56px 32px;
}
.description {
font-size: 16px;
Expand All @@ -291,7 +302,7 @@ html:not(.dark) .accent,
padding: 20px 36px;
}
.actions a {
margin: 0.5em 0;
margin: 18px 0;
}
}

Expand Down
18 changes: 12 additions & 6 deletions .vitepress/theme/components/PreferenceSwitch.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { VTSwitch, VTIconChevronDown } from '@vue/theme'
import { useRoute } from 'vitepress'
import { inject, Ref } from 'vue'
import { ref, computed, inject, Ref } from 'vue'
import {
preferCompositionKey,
preferComposition,
Expand All @@ -10,15 +10,15 @@ import {
} from './preferences'

const route = useRoute()
const show = $computed(() =>
const show = computed(() =>
/^\/(guide|tutorial|examples|style-guide)\//.test(route.path)
)
const showSFC = $computed(() => !/^\/guide|style-guide/.test(route.path))
const showSFC = computed(() => !/^\/guide|style-guide/.test(route.path))

let isOpen = $ref(true)
let isOpen = ref(true)

const toggleOpen = () => {
isOpen = !isOpen
isOpen.value = !isOpen.value
}

const removeOutline = (e: Event) => {
Expand Down Expand Up @@ -168,7 +168,13 @@ function useToggleFn(

.switch-container {
display: flex;
align-items: center;
align-items: center;
}

@media(max-width: 959px){
.switch-container {
padding: 0 1em;
}
}

.switch-container:nth-child(2) {
Expand Down
67 changes: 67 additions & 0 deletions .vitepress/theme/components/SiteMap.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<script setup lang="ts">
import { VTLink } from '@vue/theme'
import { useData } from 'vitepress'

const data = useData()
const nav = data.site.value.themeConfig.nav
const ecosystem = nav.find((i: any) => i.activeMatch?.includes('ecosystem'))
const items = nav
.filter((i: any) => i !== ecosystem && i.items)
.concat(ecosystem.items)
</script>

<template>
<section id="sitemap">
<div class="container">
<div class="sitemap-col" v-for="col in items">
<h4>{{ col.text }}</h4>
<ul>
<li v-for="row in col.items">
<VTLink :href="row.link">{{ row.text }}</VTLink>
</li>
</ul>
</div>
</div>
</section>
</template>

<style>
#sitemap {
background: var(--vt-c-bg-soft);
}

#sitemap .container {
max-width: 900px;
margin: 0 auto;
columns: 1;
padding: 24px 32px;
}

@media (min-width: 768px) {
#sitemap .container {
columns: 2;
}
}

@media (min-width: 1024px) {
#sitemap .container {
columns: 3;
}
}

#sitemap h4 {
font-weight: 500;
color: var(--vt-c-text-1);
margin-bottom: 0.25em;
}

.sitemap-col {
margin-bottom: 2em;
break-inside: avoid;
}

#sitemap .vt-link {
font-size: 0.9em;
color: var(--vt-c-text-2);
}
</style>
Loading