Skip to content

Commit

Permalink
commonjs sensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
pirog committed Apr 2, 2024
1 parent d50d7a2 commit 8676944
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
7 changes: 3 additions & 4 deletions components/VPLSponsors.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
</template>

<script setup>
import {load} from 'js-yaml';
import yaml from 'js-yaml';
import {computed, onMounted, ref} from 'vue';
import {useData} from 'vitepress';
Expand Down Expand Up @@ -97,13 +98,11 @@ onMounted(async () => {
const url = new URL(data.value);
const response = await fetch(url.href);
console.log(response);
// allow special file extension handling
switch (extname(url.pathname)) {
case '.yaml':
case '.yml':
data.value = load(await response.text());
data.value = yaml.load(await response.text());
break;
default:
data.value = await response.json();
Expand Down
24 changes: 13 additions & 11 deletions docs/components/sponsors.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@ description: Learn about the VitePress Default Theme + global Sponsors component
sponsors:
text: your logo?
link: https://lando.dev/sponsor
data:
- name: stark
id: stark
url: https://en.wikipedia.org/wiki/Stark_Industries
logo: https://upload.wikimedia.org/wikipedia/commons/7/7d/Stark_Industries.png
type: half
- name: wayne
id: wayne
url: https://en.wikipedia.org/wiki/Wayne_Enterprises
logo: https://upload.wikimedia.org/wikipedia/commons/3/32/Wayne_Enterprises_%28DC_Comics_fictional_logo%29.png
type: half
data: https://raw.githubusercontent.com/lando/lando/main/patriots.yaml
#data: https://raw.githubusercontent.com/lando/lando/main/package.json
# data:
# - name: stark
# id: stark
# url: https://en.wikipedia.org/wiki/Stark_Industries
# logo: https://upload.wikimedia.org/wikipedia/commons/7/7d/Stark_Industries.png
# type: half
# - name: wayne
# id: wayne
# url: https://en.wikipedia.org/wiki/Wayne_Enterprises
# logo: https://upload.wikimedia.org/wikipedia/commons/3/32/Wayne_Enterprises_%28DC_Comics_fictional_logo%29.png
# type: half
---

# Sponsors
Expand Down

0 comments on commit 8676944

Please sign in to comment.