Skip to content

Commit

Permalink
docs: improve docs seo
Browse files Browse the repository at this point in the history
  • Loading branch information
victorgarciaesgi committed Dec 22, 2024
1 parent 7296cd9 commit e5e5669
Show file tree
Hide file tree
Showing 12 changed files with 1,523 additions and 960 deletions.
39 changes: 29 additions & 10 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { DefaultTheme } from 'vitepress';
import { defineConfig } from 'vitepress';
import { transformerTwoslash } from '@shikijs/vitepress-twoslash';
import type { DefaultTheme, HeadConfig } from 'vitepress';
import { defineConfig } from 'vitepress';
import { groupIconMdPlugin, groupIconVitePlugin } from 'vitepress-plugin-group-icons';

const Nav: DefaultTheme.NavItemWithLink[] = [
Expand Down Expand Up @@ -101,6 +101,8 @@ export default defineConfig({
sitemap: {
hostname: 'https://regle.vercel.app',
},
lastUpdated: true,
cleanUrls: true,
themeConfig: {
logo: {
dark: '/logo-reversed.png',
Expand Down Expand Up @@ -165,6 +167,13 @@ export default defineConfig({
copyright: 'Copyright © 2023-present Victor Garcia',
},
},
transformHead: ({ pageData }) => {
const head: HeadConfig[] = [];

head.push(['meta', { property: 'og:title', content: pageData.frontmatter.title ?? 'Regle' }]);

return head;
},
head: [
['link', { rel: 'icon', href: '/favicon.ico' }],
['meta', { name: 'viewport', content: 'width=device-width, initial-scale=1, maximum-scale=1' }],
Expand All @@ -177,20 +186,24 @@ export default defineConfig({
'vue forms, vue validation library, vue forms typescript, vue model validation, vue zod, vue typescript forms, regle, reglejs, regle vue, regle vue forms, regle vue form',
},
],
['meta', { property: 'og:url', content: 'https://regle.vercel.app/' }],
['meta', { property: 'og:url', content: 'https://regle.vercel.app' }],
['meta', { property: 'og:type', content: 'website' }],
['meta', { property: 'og:title', content: 'Regle' }],
['meta', { property: 'og:site_name', content: 'Regle - Vue form validation' }],
[
'meta',
{
property: 'og:description',
property: 'description',
content: `Regle (from the French word for "rule") is a TypeScript-first form validation library made for Vue 3.
I'm a lover and long-time user of Vuelidate API, so Regle is greatly inspired by it.
Regle is about bringing type safety and great DX for both simple and complex forms.
It's entirely data-driven and headless, allowing the validation logic to mirror your data structure, enabling a clear separation between the UI and validation logic.
Declare your form rules inside a component or a Pinia store and use it wherever you like.`,
It's entirely data-driven and headless, allowing the validation logic to mirror your data structure, enabling a clear separation between the UI and validation logic.`,
},
],
[
'meta',
{
property: 'og:description',
content: `Regle is a TypeScript-first form validation library made for Vue 3.`,
},
],
[
Expand All @@ -201,11 +214,17 @@ export default defineConfig({
},
],
['meta', { name: 'twitter:site', content: '@regle' }],
['meta', { name: 'twitter:domain', content: 'regle.vercel.app' }],
[
'meta',
{ name: 'twitter:description', content: 'Regle is a TypeScript-first form validation library made for Vue 3.' },
],
['meta', { name: 'twitter:url', content: 'https://regle.vercel.app' }],
['meta', { name: 'twitter:card', content: 'summary' }],
['meta', { name: 'google-site-verification', content: 'mYJKnciAjHTdI7nsB2xame8QO61IeKoXCZeGyWGjs-4' }],
],
markdown: {
codeTransformers: [transformerTwoslash({})],
codeTransformers: [transformerTwoslash({}) as any],
theme: 'vitesse-dark',
config(md) {
md.use(groupIconMdPlugin);
Expand Down
37 changes: 19 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,50 +25,51 @@
"docs:preview": "vitepress preview docs"
},
"devDependencies": {
"@playwright/test": "1.49.0",
"@pinia/testing": "0.1.7",
"@playwright/test": "1.49.1",
"@regle/core": "workspace:*",
"@regle/rules": "workspace:*",
"@regle/zod": "workspace:*",
"@shikijs/vitepress-twoslash": "1.24.1",
"@typescript-eslint/eslint-plugin": "8.18.0",
"@typescript-eslint/parser": "8.18.0",
"@shikijs/vitepress-twoslash": "1.24.4",
"@tailwindcss/forms": "0.5.9",
"@types/semver": "7.5.8",
"@typescript-eslint/eslint-plugin": "8.18.1",
"@typescript-eslint/parser": "8.18.1",
"@vitejs/plugin-vue": "5.2.1",
"@vitest/coverage-istanbul": "2.1.8",
"@vitest/coverage-v8": "2.1.8",
"@vue/reactivity": "catalog:",
"@vue/test-utils": "2.4.6",
"@types/semver": "7.5.8",
"bumpp": "9.9.0",
"autoprefixer": "10.4.20",
"bumpp": "9.9.2",
"changelogithub": "0.13.11",
"check-password-strength": "2.0.10",
"cross-env": "7.0.3",
"@pinia/testing": "0.1.7",
"date-fns": "4.1.0",
"eslint": "catalog:",
"eslint-config-prettier": "catalog:",
"eslint-plugin-vue": "catalog:",
"happy-dom": "15.11.7",
"pinia": "catalog:",
"playwright": "1.49.0",
"playwright-core": "1.49.0",
"playwright": "1.49.1",
"playwright-core": "1.49.1",
"postcss": "8.4.49",
"prettier": "catalog:",
"sass": "1.83.0",
"semver": "7.6.3",
"sass": "1.82.0",
"sitemap": "8.0.0",
"tailwindcss": "3.4.17",
"tsup": "catalog:",
"tsx": "4.19.2",
"typescript": "catalog:",
"vitepress": "1.5.0",
"vitepress-plugin-group-icons": "1.3.1",
"vitepress-plugin-group-icons": "1.3.2",
"vitest": "2.1.8",
"vue": "catalog:",
"vue-eslint-parser": "catalog:",
"vue-tsc": "catalog:",
"zod": "3.23.8",
"zx": "8.2.4",
"tsx": "4.19.2",
"tailwindcss": "3.4.16",
"autoprefixer": "10.4.20",
"postcss": "8.4.49",
"@tailwindcss/forms": "0.5.9"
"zod": "3.24.1",
"zx": "8.2.4"
},
"type": "module",
"main": "./dist/module.cjs",
Expand Down
10 changes: 5 additions & 5 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@
},
"devDependencies": {
"@total-typescript/ts-reset": "0.6.1",
"@types/node": "22.9.3",
"@typescript-eslint/eslint-plugin": "8.18.0",
"@typescript-eslint/parser": "8.18.0",
"@types/node": "22.10.2",
"@typescript-eslint/eslint-plugin": "8.18.1",
"@typescript-eslint/parser": "8.18.1",
"@vue/test-utils": "2.4.6",
"bumpp": "9.9.0",
"bumpp": "9.9.2",
"changelogithub": "0.13.11",
"cross-env": "7.0.3",
"eslint": "catalog:",
"eslint-config-prettier": "catalog:",
"eslint-plugin-vue": "catalog:",
"prettier": "catalog:",
"tsup": "catalog:",
"type-fest": "4.30.0",
"type-fest": "4.30.2",
"typescript": "catalog:",
"vitest": "2.1.8",
"vue": "catalog:",
Expand Down
16 changes: 8 additions & 8 deletions packages/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@
"@regle/rules": "workspace:*"
},
"optionalDependencies": {
"@regle/zod": "workspace:*",
"@regle/valibot": "workspace:*"
"@regle/valibot": "workspace:*",
"@regle/zod": "workspace:*"
},
"devDependencies": {
"@nuxt/devtools": "1.6.3",
"@nuxt/eslint-config": "0.7.2",
"@nuxt/devtools": "1.6.4",
"@nuxt/eslint-config": "0.7.4",
"@nuxt/module-builder": "0.8.4",
"@nuxt/schema": "3.14.1592",
"@nuxt/test-utils": "3.15.1",
"@types/node": "22.9.3",
"@types/node": "22.10.2",
"c12": "2.0.1",
"changelogen": "0.5.7",
"eslint": "catalog:",
Expand All @@ -54,13 +54,13 @@
"nuxt": "3.14.1592",
"prettier": "catalog:",
"tsup": "catalog:",
"type-fest": "4.30.0",
"type-fest": "4.30.2",
"typescript": "catalog:",
"unbuild": "3.0.1",
"vitest": "2.1.8",
"vue": "catalog:",
"vue-eslint-parser": "catalog:",
"vue-tsc": "catalog:",
"unbuild": "3.0.1"
"vue-tsc": "catalog:"
},
"publishConfig": {
"access": "public"
Expand Down
8 changes: 4 additions & 4 deletions packages/rules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@
"@regle/core": "workspace:*"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "8.18.0",
"@typescript-eslint/parser": "8.18.0",
"@typescript-eslint/eslint-plugin": "8.18.1",
"@typescript-eslint/parser": "8.18.1",
"@vue/reactivity": "catalog:",
"@vue/test-utils": "2.4.6",
"bumpp": "9.9.0",
"bumpp": "9.9.2",
"changelogithub": "0.13.11",
"cross-env": "7.0.3",
"eslint": "catalog:",
"eslint-config-prettier": "catalog:",
"eslint-plugin-vue": "catalog:",
"prettier": "catalog:",
"tsup": "catalog:",
"type-fest": "4.30.0",
"type-fest": "4.30.2",
"typescript": "catalog:",
"vitest": "2.1.8",
"vue": "catalog:",
Expand Down
12 changes: 6 additions & 6 deletions packages/valibot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
},
"devDependencies": {
"@total-typescript/ts-reset": "0.6.1",
"@types/node": "22.9.3",
"@typescript-eslint/eslint-plugin": "8.18.0",
"@typescript-eslint/parser": "8.18.0",
"@types/node": "22.10.2",
"@typescript-eslint/eslint-plugin": "8.18.1",
"@typescript-eslint/parser": "8.18.1",
"@vue/test-utils": "2.4.6",
"bumpp": "9.9.0",
"bumpp": "9.9.2",
"changelogithub": "0.13.11",
"cross-env": "7.0.3",
"eslint": "catalog:",
Expand All @@ -32,11 +32,11 @@
"tsup": "catalog:",
"type-fest": "catalog:",
"typescript": "catalog:",
"valibot": "1.0.0-beta.9",
"vitest": "2.1.8",
"vue": "catalog:",
"vue-eslint-parser": "catalog:",
"vue-tsc": "catalog:",
"valibot": "1.0.0-beta.9"
"vue-tsc": "catalog:"
},
"type": "module",
"exports": {
Expand Down
10 changes: 5 additions & 5 deletions packages/zod/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
},
"devDependencies": {
"@total-typescript/ts-reset": "0.6.1",
"@types/node": "22.9.3",
"@typescript-eslint/eslint-plugin": "8.18.0",
"@typescript-eslint/parser": "8.18.0",
"@types/node": "22.10.2",
"@typescript-eslint/eslint-plugin": "8.18.1",
"@typescript-eslint/parser": "8.18.1",
"@vue/test-utils": "2.4.6",
"bumpp": "9.9.0",
"bumpp": "9.9.2",
"changelogithub": "0.13.11",
"cross-env": "7.0.3",
"eslint": "catalog:",
Expand All @@ -36,7 +36,7 @@
"vue": "catalog:",
"vue-eslint-parser": "catalog:",
"vue-tsc": "catalog:",
"zod": "3.23.8"
"zod": "3.24.1"
},
"type": "module",
"exports": {
Expand Down
4 changes: 2 additions & 2 deletions playground/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
"@regle/zod": "workspace:*",
"pinia": "^2.2.6",
"typescript": "5.6.3",
"zod": "3.23.8"
"zod": "3.24.1"
},
"devDependencies": {
"nuxt": "^3.14.1592",
"vue": "^3.5.13",
"vue-router": "^4.4.5"
"vue-router": "^4.5.0"
},
"version": "0.4.9"
}
14 changes: 7 additions & 7 deletions playground/vue3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,28 @@
"dependencies": {
"@regle/core": "workspace:*",
"@regle/rules": "workspace:*",
"@regle/valibot": "workspace:*",
"@regle/zod": "workspace:*",
"vue": "catalog:",
"pinia": "2.3.0",
"@regle/valibot": "workspace:*",
"valibot": "1.0.0-beta.9"
"valibot": "1.0.0-beta.9",
"vue": "catalog:"
},
"devDependencies": {
"@andypf/json-viewer": "2.1.7",
"@tsconfig/node20": "^20.1.4",
"@types/node": "^22.9.3",
"@types/node": "^22.10.2",
"@vitejs/plugin-vue": "^5.2.1",
"@vue/eslint-config-prettier": "^10.0.0",
"@vue/eslint-config-typescript": "^14.1.4",
"@vue/tsconfig": "^0.6.0",
"@vue/tsconfig": "^0.7.0",
"eslint": "catalog:",
"eslint-config-prettier": "catalog:",
"eslint-plugin-vue": "catalog:",
"npm-run-all2": "^7.0.1",
"npm-run-all2": "^7.0.2",
"prettier": "catalog:",
"tsup": "catalog:",
"typescript": "catalog:",
"vite": "^5.4.8",
"vite": "^6.0.5",
"vue-eslint-parser": "catalog:",
"vue-tsc": "catalog:"
}
Expand Down
Loading

0 comments on commit e5e5669

Please sign in to comment.