Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Nov 24, 2024
1 parent c8311c3 commit ff91caf
Show file tree
Hide file tree
Showing 22 changed files with 393 additions and 419 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ The Nuxt SEO module is an all-in-one SEO solution for Nuxt. It combines 6 SEO mo
</table>
</p>


## Installation

Install `@nuxtjs/seo` dependency to your project:
Expand Down
21 changes: 10 additions & 11 deletions docs/app/components/Logo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
</script>

<template>
<svg height="22" viewBox="0 0 1204 200" fill="none" xmlns="http://www.w3.org/2000/svg">
<path class="slide-right" d="M377 200C379.16 200 381 198.209 381 196V103C381 103 386 112 395 127L434 194C435.785 197.74 439.744 200 443 200H470V50H443C441.202 50 439 51.4941 439 54V148L421 116L385 55C383.248 51.8912 379.479 50 376 50H350V200H377Z" fill="currentColor" />
<path class="slide-right" d="M726 92H739C742.314 92 745 89.3137 745 86V60H773V92H800V116H773V159C773 169.5 778.057 174 787 174H800V200H783C759.948 200 745 185.071 745 160V116H726V92Z" fill="currentColor" />
<path class="slide-right" d="M591 92V154C591 168.004 585.742 179.809 578 188C570.258 196.191 559.566 200 545 200C530.434 200 518.742 196.191 511 188C503.389 179.809 498 168.004 498 154V92H514C517.412 92 520.769 92.622 523 95C525.231 97.2459 526 98.5652 526 102V154C526 162.059 526.457 167.037 530 171C533.543 174.831 537.914 176 545 176C552.217 176 555.457 174.831 559 171C562.543 167.037 563 162.059 563 154V102C563 98.5652 563.769 96.378 566 94C567.96 91.9107 570.028 91.9599 573 92C573.411 92.0055 574.586 92 575 92H591Z" fill="currentColor" />
<path class="slide-right" d="M676 144L710 92H684C680.723 92 677.812 93.1758 676 96L660 120L645 97C643.188 94.1758 639.277 92 636 92H611L645 143L608 200H634C637.25 200 640.182 196.787 642 194L660 167L679 195C680.818 197.787 683.75 200 687 200H713L676 144Z" fill="currentColor" />
<path class="pop" d="M168 200H279C282.542 200 285.932 198.756 289 197C292.068 195.244 295.23 193.041 297 190C298.77 186.959 300.002 183.51 300 179.999C299.998 176.488 298.773 173.04 297 170.001L222 41C220.23 37.96 218.067 35.7552 215 34C211.933 32.2448 207.542 31 204 31C200.458 31 197.067 32.2448 194 34C190.933 35.7552 188.77 37.96 187 41L168 74L130 9.99764C128.228 6.95784 126.068 3.75491 123 2C119.932 0.245087 116.542 0 113 0C109.458 0 106.068 0.245087 103 2C99.9323 3.75491 96.7717 6.95784 95 9.99764L2 170.001C0.226979 173.04 0.00154312 176.488 1.90993e-06 179.999C-0.0015393 183.51 0.229648 186.959 2 190C3.77035 193.04 6.93245 195.244 10 197C13.0675 198.756 16.4578 200 20 200H90C117.737 200 137.925 187.558 152 164L186 105L204 74L259 168H186L168 200ZM89 168H40L113 42L150 105L125.491 147.725C116.144 163.01 105.488 168 89 168Z" fill="#00DC82" />
<path class="slide-right" d="M892 200C881.746 200 873.788 197.911 866 194C858.212 189.959 851.543 184.169 847 177C842.587 169.7 840.389 161.646 840 152H868C868.649 159.039 870.717 163.959 875 168C879.413 172.041 885.861 174 893 174C899.62 174 904.106 172.737 908 170C912.024 167.263 914 164.084 914 159C914 155.48 913.336 152.086 911 150C908.793 147.784 906.375 146.173 903 145C899.625 143.827 894.23 142.564 888 141C878.784 138.784 870.971 136.477 865 134C859.159 131.393 854.283 127.605 850 122C845.717 116.395 844 108.777 844 99C844 91.5698 845.976 84.8659 850 79C854.024 73.1341 859.861 68.2589 867 65C874.139 61.6108 881.914 60 891 60C900.735 60 909.601 61.4805 917 65C924.528 68.5196 929.846 73.4823 934 80C938.283 86.5177 940.74 94.3967 941 103H913C912.481 97.5251 910.894 93.1285 907 90C903.106 86.7411 897.49 85 891 85C885.289 85 880.375 86.5233 877 89C873.625 91.4767 872 94.959 872 99C872 102.78 873.664 105.784 876 108C878.336 110.216 881.366 111.696 885 113C888.634 114.173 893.64 115.566 900 117C909.346 119.216 916.159 121.654 922 124C927.841 126.346 932.846 130.395 937 136C941.283 141.475 944 148.354 944 158C944 166.473 941.283 173.743 937 180C932.717 186.257 926.788 191.611 919 195C911.342 198.389 902.124 200 892 200Z" fill="#00DC82" />
<path class="slide-right" d="M1056 200H961V60H1054V87H990V116H1041V141H990V173H1056V200Z" fill="#00DC82" />
<path class="slide-right" d="M1134 200C1120.76 200 1108.64 196.996 1098 191C1087.49 184.873 1080.1 176.559 1074 166C1068.03 155.311 1065 143.296 1065 130C1065 116.704 1068.03 104.559 1074 94C1080.1 83.311 1088.49 74.9963 1099 69C1109.64 62.8734 1120.76 60 1134 60C1147.11 60 1159.49 62.8734 1170 69C1180.64 74.9963 1189.03 83.311 1195 94C1201.1 104.559 1204 116.704 1204 130C1204 143.296 1201.1 155.311 1195 166C1189.03 176.559 1180.64 184.873 1170 191C1159.49 196.996 1147.11 200 1134 200ZM1134 174C1141.66 174 1148.9 172.78 1155 169C1161.23 165.089 1165.63 159.778 1169 153C1172.5 146.222 1174 138.473 1174 130C1174 121.527 1172.5 113.778 1169 107C1165.63 100.222 1161.23 94.9106 1155 91C1148.9 87.0894 1141.66 85 1134 85C1126.34 85 1120.1 87.0894 1114 91C1107.9 94.9106 1102.5 100.222 1099 107C1095.63 113.778 1094 121.527 1094 130C1094 138.473 1095.63 146.222 1099 153C1102.5 159.778 1107.9 165.089 1114 169C1120.1 172.78 1126.34 174 1134 174Z" fill="#00DC82" />
</svg>
<svg height="22" viewBox="0 0 1204 200" fill="none" xmlns="http://www.w3.org/2000/svg">
<path class="slide-right" d="M377 200C379.16 200 381 198.209 381 196V103C381 103 386 112 395 127L434 194C435.785 197.74 439.744 200 443 200H470V50H443C441.202 50 439 51.4941 439 54V148L421 116L385 55C383.248 51.8912 379.479 50 376 50H350V200H377Z" fill="currentColor" />
<path class="slide-right" d="M726 92H739C742.314 92 745 89.3137 745 86V60H773V92H800V116H773V159C773 169.5 778.057 174 787 174H800V200H783C759.948 200 745 185.071 745 160V116H726V92Z" fill="currentColor" />
<path class="slide-right" d="M591 92V154C591 168.004 585.742 179.809 578 188C570.258 196.191 559.566 200 545 200C530.434 200 518.742 196.191 511 188C503.389 179.809 498 168.004 498 154V92H514C517.412 92 520.769 92.622 523 95C525.231 97.2459 526 98.5652 526 102V154C526 162.059 526.457 167.037 530 171C533.543 174.831 537.914 176 545 176C552.217 176 555.457 174.831 559 171C562.543 167.037 563 162.059 563 154V102C563 98.5652 563.769 96.378 566 94C567.96 91.9107 570.028 91.9599 573 92C573.411 92.0055 574.586 92 575 92H591Z" fill="currentColor" />
<path class="slide-right" d="M676 144L710 92H684C680.723 92 677.812 93.1758 676 96L660 120L645 97C643.188 94.1758 639.277 92 636 92H611L645 143L608 200H634C637.25 200 640.182 196.787 642 194L660 167L679 195C680.818 197.787 683.75 200 687 200H713L676 144Z" fill="currentColor" />
<path class="pop" d="M168 200H279C282.542 200 285.932 198.756 289 197C292.068 195.244 295.23 193.041 297 190C298.77 186.959 300.002 183.51 300 179.999C299.998 176.488 298.773 173.04 297 170.001L222 41C220.23 37.96 218.067 35.7552 215 34C211.933 32.2448 207.542 31 204 31C200.458 31 197.067 32.2448 194 34C190.933 35.7552 188.77 37.96 187 41L168 74L130 9.99764C128.228 6.95784 126.068 3.75491 123 2C119.932 0.245087 116.542 0 113 0C109.458 0 106.068 0.245087 103 2C99.9323 3.75491 96.7717 6.95784 95 9.99764L2 170.001C0.226979 173.04 0.00154312 176.488 1.90993e-06 179.999C-0.0015393 183.51 0.229648 186.959 2 190C3.77035 193.04 6.93245 195.244 10 197C13.0675 198.756 16.4578 200 20 200H90C117.737 200 137.925 187.558 152 164L186 105L204 74L259 168H186L168 200ZM89 168H40L113 42L150 105L125.491 147.725C116.144 163.01 105.488 168 89 168Z" fill="#00DC82" />
<path class="slide-right" d="M892 200C881.746 200 873.788 197.911 866 194C858.212 189.959 851.543 184.169 847 177C842.587 169.7 840.389 161.646 840 152H868C868.649 159.039 870.717 163.959 875 168C879.413 172.041 885.861 174 893 174C899.62 174 904.106 172.737 908 170C912.024 167.263 914 164.084 914 159C914 155.48 913.336 152.086 911 150C908.793 147.784 906.375 146.173 903 145C899.625 143.827 894.23 142.564 888 141C878.784 138.784 870.971 136.477 865 134C859.159 131.393 854.283 127.605 850 122C845.717 116.395 844 108.777 844 99C844 91.5698 845.976 84.8659 850 79C854.024 73.1341 859.861 68.2589 867 65C874.139 61.6108 881.914 60 891 60C900.735 60 909.601 61.4805 917 65C924.528 68.5196 929.846 73.4823 934 80C938.283 86.5177 940.74 94.3967 941 103H913C912.481 97.5251 910.894 93.1285 907 90C903.106 86.7411 897.49 85 891 85C885.289 85 880.375 86.5233 877 89C873.625 91.4767 872 94.959 872 99C872 102.78 873.664 105.784 876 108C878.336 110.216 881.366 111.696 885 113C888.634 114.173 893.64 115.566 900 117C909.346 119.216 916.159 121.654 922 124C927.841 126.346 932.846 130.395 937 136C941.283 141.475 944 148.354 944 158C944 166.473 941.283 173.743 937 180C932.717 186.257 926.788 191.611 919 195C911.342 198.389 902.124 200 892 200Z" fill="#00DC82" />
<path class="slide-right" d="M1056 200H961V60H1054V87H990V116H1041V141H990V173H1056V200Z" fill="#00DC82" />
<path class="slide-right" d="M1134 200C1120.76 200 1108.64 196.996 1098 191C1087.49 184.873 1080.1 176.559 1074 166C1068.03 155.311 1065 143.296 1065 130C1065 116.704 1068.03 104.559 1074 94C1080.1 83.311 1088.49 74.9963 1099 69C1109.64 62.8734 1120.76 60 1134 60C1147.11 60 1159.49 62.8734 1170 69C1180.64 74.9963 1189.03 83.311 1195 94C1201.1 104.559 1204 116.704 1204 130C1204 143.296 1201.1 155.311 1195 166C1189.03 176.559 1180.64 184.873 1170 191C1159.49 196.996 1147.11 200 1134 200ZM1134 174C1141.66 174 1148.9 172.78 1155 169C1161.23 165.089 1165.63 159.778 1169 153C1172.5 146.222 1174 138.473 1174 130C1174 121.527 1172.5 113.778 1169 107C1165.63 100.222 1161.23 94.9106 1155 91C1148.9 87.0894 1141.66 85 1134 85C1126.34 85 1120.1 87.0894 1114 91C1107.9 94.9106 1102.5 100.222 1099 107C1095.63 113.778 1094 121.527 1094 130C1094 138.473 1095.63 146.222 1099 153C1102.5 159.778 1107.9 165.089 1114 169C1120.1 172.78 1126.34 174 1134 174Z" fill="#00DC82" />
</svg>
</template>

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
// convert to typescript props
const props = withDefaults(defineProps<{
withDefaults(defineProps<{
colorMode?: 'dark' | 'light'
title?: string
description?: string
Expand Down
9 changes: 5 additions & 4 deletions docs/app/layouts/learn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ const { data: nav } = await useAsyncData(`docs-nav-learn`, () => queryCollection
const mappedChildren = children.reduce((acc, item) => {
if (!acc[item.path]) {
acc[item.path] = item
} else {
}
else {
acc[item.path] = defu(acc[item.path], item)
// filter the children, they shouldn't contain the item.path
}
return acc
}, {})
return mapPath(Object.values(mappedChildren)).map(item => item.children.map(c => ({ icon: 'i-ph-dot-outline-duotone', ...c,})))
return mapPath(Object.values(mappedChildren)).map(item => item.children.map(c => ({ icon: 'i-ph-dot-outline-duotone', ...c })))
},
})
Expand Down Expand Up @@ -73,8 +74,8 @@ const breadcrumbs = useBreadcrumbItems({
</div>
</div>
<div class="space-y-5">
<div v-for="section in nav">
<UContentNavigation :navigation="section" />
<div v-for="(section, key) in nav" :key="key">
<UContentNavigation :navigation="section" />
</div>
</div>
</div>
Expand Down
48 changes: 21 additions & 27 deletions docs/app/pages/announcement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ const humanPublishedDate = new Date(page.value.publishedAt).toLocaleDateString('
day: 'numeric',
})
const humanUpdatedDate = new Date(page.value.updatedAt).toLocaleDateString('en-US', {
year: 'numeric',
month: 'long',
day: 'numeric',
})
useSeoMeta({
ogType: 'article',
author: 'Harlan Wilton',
Expand Down Expand Up @@ -67,29 +61,29 @@ useSchemaOrg([
</script>

<template>
<div class="max-w-[66ch]">
<UPageHeader v-bind="page" :ui="{ title: 'text-center text-balance xl:leading-normal min-w-full', description: 'text-center ' }">
<div class="flex justify-center gap-5 mt-5">
<div class="flex items-center gap-2 text-gray-300">
<NuxtLink to="https://x.com/harlan_zw" class="hover:underline inline-flex items-center gap-2">
<img alt="Harlan Wilton" src="https://avatars.githubusercontent.com/u/5326365?v=4" class="w-6 h-6 rounded-full">
Harlan Wilton
</NuxtLink>
<div class="max-w-[66ch]">
<UPageHeader v-bind="page" :ui="{ title: 'text-center text-balance xl:leading-normal min-w-full', description: 'text-center ' }">
<div class="flex justify-center gap-5 mt-5">
<div class="flex items-center gap-2 text-gray-300">
<NuxtLink to="https://x.com/harlan_zw" class="hover:underline inline-flex items-center gap-2">
<img alt="Harlan Wilton" src="https://avatars.githubusercontent.com/u/5326365?v=4" class="w-6 h-6 rounded-full">
Harlan Wilton
</NuxtLink>
</div>
<span v-if="page.readTime" class="font-semibold text-gray-500">{{ page.readTime }} read</span>
</div>
<span v-if="page.readTime" class="font-semibold text-gray-500">{{ page.readTime }} read</span>
</div>
</UPageHeader>
</UPageHeader>

<UPageBody prose class="pb-0">
<div>
<div class="flex justify-between">
<div v-if="page.publishedAt" class="text-gray-500">
Published
<time :datetime="page.publishedAt">{{ humanPublishedDate }}</time>
<UPageBody prose class="pb-0">
<div>
<div class="flex justify-between">
<div v-if="page.publishedAt" class="text-gray-500">
Published
<time :datetime="page.publishedAt">{{ humanPublishedDate }}</time>
</div>
</div>
</div>
</div>
<ContentRenderer v-if="page.body" :value="page" />
</UPageBody>
</div>
<ContentRenderer v-if="page.body" :value="page" />
</UPageBody>
</div>
</template>
6 changes: 2 additions & 4 deletions docs/app/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ onMounted(() => {
})
})
useServerHead({
link: [
{
Expand Down Expand Up @@ -725,8 +724,8 @@ const graphData = computed(() => {
</p>
<div class="gap-2 mx-auto text-center grid grid-cols-12">
<span v-for="(c, index) in stats.uniqueContributors || []" :key="index" class="inline-flex items-center justify-center shrink-0 select-none overflow-hidden rounded-full align-middle bg-[--ui-bg-elevated] size-8 text-base">
<NuxtImg class="h-full w-full rounded-[inherit] object-cover" :alt="`GitHub User ${c}`" size="xl" height="45" width="45" loading="lazy" :src="`https://avatars.githubusercontent.com/u/${c}?s=80&v=4`" />
</span>
<NuxtImg class="h-full w-full rounded-[inherit] object-cover" :alt="`GitHub User ${c}`" size="xl" height="45" width="45" loading="lazy" :src="`https://avatars.githubusercontent.com/u/${c}?s=80&v=4`" />
</span>
</div>
</div>
</div>
Expand Down Expand Up @@ -927,4 +926,3 @@ const graphData = computed(() => {
</section>
</div>
</template>

2 changes: 1 addition & 1 deletion docs/app/pages/learn/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const { data: nav } = await useAsyncData(`learn`, () => queryCollectionNavigatio
<Ads />
</div>
<div class="space-y-5">
<div v-for="item in nav[0].children">
<div v-for="(item, key) in nav[0].children" :key="key">
<NuxtLink :to="item.path" class="relative inline-flex transition-all hover:shadow-lg flex-col rounded-lg font-bold border bg-gradient-to-r from-sky-700/10 to-blue-700/20 border-sky-700/20 px-5 py-3 gap-1">
<div class="z-1 flex flex-col justify-between h-full">
<div>
Expand Down
1 change: 0 additions & 1 deletion docs/app/pages/releases.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,3 @@ const HighlightedVersion = defineComponent({
</section>
</div>
</template>

1 change: 0 additions & 1 deletion docs/content/learn-todo/3.routes-and-rendering/0.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ publishedAt: 2024-10-25
updatedAt: 2024-10-25
icon: i-tabler-slashes
---

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ While trailing slashes don't directly impact SEO rankings, they can create techn
The solution is simple: pick one format and stick to it by [redirecting](/learn/controlling-crawlers/redirects) the other and set
[canonical URLs](/learn/controlling-crawlers/canonical-urls).


## Vue Router

By default, all routes in Vue Router are case-insensitive and match routes with or without trailing slashes. For example, `/users` will match:
Expand All @@ -51,7 +50,6 @@ const router = createRouter({
})
```


## Quick Implementation

In Vue, you can control trailing slash behavior through router configuration:
Expand Down
2 changes: 0 additions & 2 deletions docs/content/learn-todo/launch-and-listen/0.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ updatedAt: 2024-10-25
icon: i-carbon-recording
---


Captures both deployment and monitoring phases
Memorable alliteration
Maps perfectly to the content:
Expand All @@ -17,7 +16,6 @@ Production URLs
Deployment checks
Performance baselines


Listen

Monitoring indexing
Expand Down
2 changes: 0 additions & 2 deletions docs/content/learn/0.mastering-meta/descriptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ keywords:

Meta descriptions don't directly impact rankings, however, they can influence click-through rates by giving users context about your page's content.


```html
<meta name="description" content="Learn how to implement meta descriptions in Vue & Nuxt. Includes reactive content, SEO best practices, and social sharing tips.">
```
Expand Down Expand Up @@ -63,7 +62,6 @@ useSeoMeta({
description: () => post.value.description
})
</script>
```

## Open Graph Description `'og:description'`{lang="ts"}
Expand Down
5 changes: 2 additions & 3 deletions docs/content/learn/0.mastering-meta/open-graph.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ There are [60+ possible OG tags](https://ogp.me/) but most have specific use cas
<meta property="og:url" content="https://mysite.com/page">
```


### Quick Tips

1. **Images matter**: A good og:image can double your click-through rate, they must be an absolute URL and at least 1200x600px.
Expand All @@ -36,7 +35,7 @@ There are [60+ possible OG tags](https://ogp.me/) but most have specific use cas

## Implementation in Vue

You should handle your OG tags with [`useSeoMeta()`{lang="ts"}](https://unhead.unjs.io/usage/composables/use-seo-meta),
You should handle your OG tags with [`useSeoMeta()`{lang="ts"}](https://unhead.unjs.io/usage/composables/use-seo-meta),
this handles the use `property` attribute, which can be easy to forget.

```ts
Expand All @@ -63,7 +62,7 @@ Some rules:
- Use `og:image:alt` for accessibility

There are several other properties, including them can be useful to ensure
the image is being displayed correctly.
the image is being displayed correctly.

```ts
useSeoMeta({
Expand Down
Loading

0 comments on commit ff91caf

Please sign in to comment.