Skip to content

Commit

Permalink
chore: bump deps & upgrade linter
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Sep 27, 2023
1 parent 5eff3ad commit 2fbb2b6
Show file tree
Hide file tree
Showing 38 changed files with 928 additions and 747 deletions.
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

11 changes: 0 additions & 11 deletions .eslintrc

This file was deleted.

58 changes: 30 additions & 28 deletions .playground/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,40 @@ const locale = i18n.locale
const languageOptions = [
[
{ label: 'English', click() { setLanguage('en') } },
{ label: 'French', click () { setLanguage('fr') }}
]
{ label: 'French', click() { setLanguage('fr') } },
],
]
const siteConfig = useSiteConfig({
name: 'Sitemap'
name: 'Sitemap',
})
</script>

<template>
<div class="flex flex-col min-h-screen">
<header class="sticky top-0 z-50 w-full backdrop-blur flex-none border-b border-gray-900/10 dark:border-gray-50/[0.06] bg-white/75 dark:bg-gray-900/75">
<UContainer class="py-3">
<div class="flex items-center justify-between">
<NuxtLink to="/" class="flex items-end gap-1.5 font-bold text-xl text-gray-900 dark:text-white">
<Icon name="logos:nuxt-icon" class="w-8 h-8" />
Nuxt
<div class="text-primary-500 dark:text-primary-400">{{ siteConfig.name }}</div>
</NuxtLink>
<UDropdown :items="languageOptions" :popper="{ placement: 'bottom-start' }">
<UButton color="white" :label="locale" trailing-icon="i-heroicons-chevron-down-20-solid" />
</UDropdown>
</div>
</UContainer>
</header>
<main class="min-h-full h-full flex-grow">
<UContainer class="mt-4">
<NuxtPage />
</UContainer>
</main>
<footer class="text-sm text-gray-700 flex justify-center items-center py-5">
Made by <UAvatar src="https://avatars.githubusercontent.com/u/5326365?v=4" size="xs" class="w-5 h-5 mx-1" /> Harlan Wilton
</footer>
</div>
<div class="flex flex-col min-h-screen">
<header class="sticky top-0 z-50 w-full backdrop-blur flex-none border-b border-gray-900/10 dark:border-gray-50/[0.06] bg-white/75 dark:bg-gray-900/75">
<UContainer class="py-3">
<div class="flex items-center justify-between">
<NuxtLink to="/" class="flex items-end gap-1.5 font-bold text-xl text-gray-900 dark:text-white">
<Icon name="logos:nuxt-icon" class="w-8 h-8" />
Nuxt
<div class="text-primary-500 dark:text-primary-400">
{{ siteConfig.name }}
</div>
</NuxtLink>
<UDropdown :items="languageOptions" :popper="{ placement: 'bottom-start' }">
<UButton color="white" :label="locale" trailing-icon="i-heroicons-chevron-down-20-solid" />
</UDropdown>
</div>
</UContainer>
</header>
<main class="min-h-full h-full flex-grow">
<UContainer class="mt-4">
<NuxtPage />
</UContainer>
</main>
<footer class="text-sm text-gray-700 flex justify-center items-center py-5">
Made by <UAvatar src="https://avatars.githubusercontent.com/u/5326365?v=4" size="xs" class="w-5 h-5 mx-1" /> Harlan Wilton
</footer>
</div>
</template>

42 changes: 21 additions & 21 deletions .playground/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default defineNuxtConfig({
'@nuxtjs/i18n',
'@nuxt/content',
'@nuxthq/ui',
'nuxt-icon'
'nuxt-icon',
],
ignorePrefix: 'ignore-',
i18n: {
Expand All @@ -21,18 +21,18 @@ export default defineNuxtConfig({
routes: [
'/should-be-in-sitemap',
'/foo.bar/',
'/test.doc'
'/test.doc',
],
failOnError: false,
},
},
content: {
documentDriven: {
path: '/content'
path: '/content',
},
},
site: {
url: 'https://nuxtseo.com'
url: 'https://nuxtseo.com',
},

// app: {
Expand All @@ -57,7 +57,7 @@ export default defineNuxtConfig({
defaultSitemapsChunkSize: 10,
sitemaps: {
posts: {
include: ['/blog/**']
include: ['/blog/**'],
},
pages: {
dynamicUrlsApiEndpoint: '/api/sitemap-foo',
Expand All @@ -69,37 +69,37 @@ export default defineNuxtConfig({
alternatives: [
{
href: '/fr/about',
hreflang: 'fr'
}
hreflang: 'fr',
},
],
images: [
{
loc: 'https://example.com/image-3.jpg',
},
]
}
]
],
},
],
},
index: [
{ sitemap: 'https://www.odysseytraveller.com/sitemap-pages.xml' }
]
}
{ sitemap: 'https://www.odysseytraveller.com/sitemap-pages.xml' },
],
},
},
routeRules: {
'/secret': {
index: false
index: false,
},
'/users-test/*': {
sitemap: {
lastmod: new Date(2023, 1, 21, 4, 50, 52),
changefreq: 'weekly',
priority: 0.3,
images: []
}
images: [],
},
},
'/should-not-be-in-sitemap/*': {},
'/about-redirect': {
redirect: '/about'
redirect: '/about',
},
'/about': {
sitemap: {
Expand All @@ -112,9 +112,9 @@ export default defineNuxtConfig({
},
{
loc: 'https://example.com/image2.jpg',
}
]
}
},
],
},
},
}
},
})
2 changes: 1 addition & 1 deletion .playground/pages/.ignored/test.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<template>
<div>shouldn't be added</div>
<div>shouldn't be added</div>
</template>
2 changes: 1 addition & 1 deletion .playground/pages/[...slug].vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<template>
<p>{{ $route.params.slug }}</p>
<p>{{ $route.params.slug }}</p>
</template>
1 change: 1 addition & 0 deletions .playground/pages/about.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script lang="ts" setup>
</script>

<template>
<div>
About page
Expand Down
2 changes: 1 addition & 1 deletion .playground/pages/blog.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<template>
<div>temp</div>
<div>temp</div>
</template>
2 changes: 1 addition & 1 deletion .playground/pages/blog/[id].vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<template>
<div>Hello world</div>
<div>Hello world</div>
</template>
2 changes: 1 addition & 1 deletion .playground/pages/blog/categories.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<template>
<div>temp</div>
<div>temp</div>
</template>
2 changes: 1 addition & 1 deletion .playground/pages/blog/index.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<template>
<div>temp</div>
<div>temp</div>
</template>
2 changes: 1 addition & 1 deletion .playground/pages/blog/tags.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<template>
<div>temp</div>
<div>temp</div>
</template>
2 changes: 1 addition & 1 deletion .playground/pages/blog/tags/edit.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<template>
<div>edit</div>
<div>edit</div>
</template>
2 changes: 1 addition & 1 deletion .playground/pages/blog/tags/new.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<template>
<div>new</div>
<div>new</div>
</template>
2 changes: 1 addition & 1 deletion .playground/pages/foo.bar.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<template>
<div>foo.bar</div>
<div>foo.bar</div>
</template>
2 changes: 1 addition & 1 deletion .playground/pages/ignore-foo.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<template>
<div>foo</div>
<div>foo</div>
</template>
40 changes: 28 additions & 12 deletions .playground/pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,38 @@
<script setup lang="ts">
</script>

<template>
<div>
<h1 class="text-2xl mt-10 mb-5">Sitemap</h1>
<div class="grid grid-cols-2 gap-5 max-w-[900px] mx-auto">
<NuxtLink to="/ignore-foo">ignore-foo</NuxtLink>
<NuxtLink to="/new-page">new page</NuxtLink>
<NuxtLink to="/about">about</NuxtLink>
<NuxtLink to="/secret">secret</NuxtLink>
<NuxtLink to="/users-prerender">dynamic pre-render link</NuxtLink>
<NuxtLink to="/blog">blog</NuxtLink>
<div>
<h1 class="text-2xl mt-10 mb-5">
Sitemap
</h1>
<div class="grid grid-cols-2 gap-5 max-w-[900px] mx-auto">
<NuxtLink to="/ignore-foo">
ignore-foo
</NuxtLink>
<NuxtLink to="/new-page">
new page
</NuxtLink>
<NuxtLink to="/about">
about
</NuxtLink>
<NuxtLink to="/secret">
secret
</NuxtLink>
<NuxtLink to="/users-prerender">
dynamic pre-render link
</NuxtLink>
<NuxtLink to="/blog">
blog
</NuxtLink>
</div>
</div>
</div>
</template>

<style scoped>
a {
display: block;
margin: 0 0 10px 0;
text-decoration: underline;
}
</style>
<script setup lang="ts">
</script>
1 change: 1 addition & 0 deletions .playground/pages/secret.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script lang="ts" setup>
</script>

<template>
<div>
<div>
Expand Down
2 changes: 1 addition & 1 deletion .playground/pages/users-[group]/[id].vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<template>
<div>Hello world</div>
<div>Hello world</div>
</template>
2 changes: 1 addition & 1 deletion .playground/pages/users-[group]/index.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<template>
<div>Hello world</div>
<div>Hello world</div>
</template>
6 changes: 3 additions & 3 deletions .playground/server/api/_sitemap-urls.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { defineEventHandler } from 'h3'

export default defineEventHandler(e => {
export default defineEventHandler((e) => {
const posts = Array.from({ length: 5 }, (_, i) => i + 1)
return [
'/users-lazy/1',
'/users-lazy/2',
'/users-lazy/3',
...posts.map(post => ({
loc: `/blog/post-${post}`
}))
loc: `/blog/post-${post}`,
})),
]
})
6 changes: 3 additions & 3 deletions .playground/server/api/multi-sitemap-sources/bar.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { defineEventHandler } from 'h3'

export default defineEventHandler(e => {
export default defineEventHandler((e) => {
const posts = Array.from({ length: 5 }, (_, i) => i + 1)
return [
...posts.map(post => ({
loc: `/bar/${post}`
}))
loc: `/bar/${post}`,
})),
]
})
6 changes: 3 additions & 3 deletions .playground/server/api/multi-sitemap-sources/foo.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { defineEventHandler } from 'h3'

export default defineEventHandler(e => {
export default defineEventHandler((e) => {
const posts = Array.from({ length: 5 }, (_, i) => i + 1)
return [
...posts.map(post => ({
loc: `/foo/${post}`
}))
loc: `/foo/${post}`,
})),
]
})
2 changes: 1 addition & 1 deletion .playground/server/api/sitemap-bar.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineEventHandler } from 'h3'

export default defineEventHandler(e => {
export default defineEventHandler((e) => {
return [
'/bar/1',
'/bar/2',
Expand Down
2 changes: 1 addition & 1 deletion .playground/server/api/sitemap-foo.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineEventHandler } from 'h3'

export default defineEventHandler(e => {
export default defineEventHandler((e) => {
return [
'/foo/1',
'/foo/2',
Expand Down
6 changes: 3 additions & 3 deletions .playground/server/routes/__sitemap.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { defineEventHandler } from 'h3'

export default defineEventHandler(e => {
export default defineEventHandler((e) => {
const posts = Array.from({ length: 3 }, (_, i) => i + 1)
return [
...posts.map(post => ({
loc: `/blog/${post}`
}))
loc: `/blog/${post}`,
})),
]
})
Loading

0 comments on commit 2fbb2b6

Please sign in to comment.