From ae23dbcf98a74efc778147d34e84e23ca0d908ad Mon Sep 17 00:00:00 2001 From: Yoav Ganbar Date: Thu, 26 Oct 2023 22:00:25 +0300 Subject: [PATCH] docs: improve SEO with descriptions (#5360) --- .../docs/src/routes/docs/(qwikcity)/action/index.mdx | 1 + .../docs/(qwikcity)/advanced/complex-forms/index.mdx | 2 ++ .../advanced/content-security-policy/index.mdx | 2 ++ .../src/routes/docs/(qwikcity)/advanced/menu/index.mdx | 2 ++ .../(qwikcity)/advanced/request-handling/index.mdx | 10 ++++++---- .../routes/docs/(qwikcity)/advanced/routing/index.mdx | 3 +++ .../routes/docs/(qwikcity)/advanced/sitemaps/index.mdx | 2 ++ .../advanced/speculative-module-fetching/index.mdx | 1 + .../docs/(qwikcity)/advanced/static-assets/index.mdx | 2 ++ packages/docs/src/routes/docs/(qwikcity)/api/index.mdx | 4 +++- .../docs/src/routes/docs/(qwikcity)/caching/index.mdx | 4 +++- .../src/routes/docs/(qwikcity)/endpoints/index.mdx | 3 ++- .../src/routes/docs/(qwikcity)/env-variables/index.mdx | 3 ++- .../docs/(qwikcity)/guides/best-practices/index.mdx | 2 ++ .../src/routes/docs/(qwikcity)/guides/bundle/index.mdx | 4 +++- .../src/routes/docs/(qwikcity)/guides/mdx/index.mdx | 2 ++ .../docs/(qwikcity)/guides/qwik-nutshell/index.mdx | 2 ++ .../docs/(qwikcity)/guides/react-cheat-sheet/index.mdx | 3 +++ .../routes/docs/(qwikcity)/guides/redirects/index.mdx | 2 ++ .../docs/(qwikcity)/guides/serialization/index.mdx | 2 ++ .../(qwikcity)/guides/static-site-generation/index.mdx | 2 ++ .../routes/docs/(qwikcity)/html-attributes/index.mdx | 2 ++ .../docs/src/routes/docs/(qwikcity)/routing/index.mdx | 1 + 23 files changed, 52 insertions(+), 9 deletions(-) diff --git a/packages/docs/src/routes/docs/(qwikcity)/action/index.mdx b/packages/docs/src/routes/docs/(qwikcity)/action/index.mdx index d2c3b7ba71d..e4ed5725ae8 100644 --- a/packages/docs/src/routes/docs/(qwikcity)/action/index.mdx +++ b/packages/docs/src/routes/docs/(qwikcity)/action/index.mdx @@ -1,5 +1,6 @@ --- title: RouteAction$ | QwikCity +description: Learn about actions in QwikCity, allowing form submissions, and performing side effects such as writing to a database or sending an email. contributors: - manucorporat - cunzaizhuyi diff --git a/packages/docs/src/routes/docs/(qwikcity)/advanced/complex-forms/index.mdx b/packages/docs/src/routes/docs/(qwikcity)/advanced/complex-forms/index.mdx index 551a4b4ab9e..72a729e0e26 100644 --- a/packages/docs/src/routes/docs/(qwikcity)/advanced/complex-forms/index.mdx +++ b/packages/docs/src/routes/docs/(qwikcity)/advanced/complex-forms/index.mdx @@ -1,7 +1,9 @@ --- title: Complex Forms | Advanced +description: Learn how to create complex forms with arrays and objects. contributors: - ulic75 + - hamatoyogi --- # Complex Forms diff --git a/packages/docs/src/routes/docs/(qwikcity)/advanced/content-security-policy/index.mdx b/packages/docs/src/routes/docs/(qwikcity)/advanced/content-security-policy/index.mdx index 3cda9d574ea..d41a058acf5 100644 --- a/packages/docs/src/routes/docs/(qwikcity)/advanced/content-security-policy/index.mdx +++ b/packages/docs/src/routes/docs/(qwikcity)/advanced/content-security-policy/index.mdx @@ -1,8 +1,10 @@ --- title: Content Security Policy | Advanced +description: Learn how to create a content security policy (CSP) to keep your Qwik app safe. contributors: - tzdesign - jordanw66 + - hamatoyogi --- # Content Security Policy diff --git a/packages/docs/src/routes/docs/(qwikcity)/advanced/menu/index.mdx b/packages/docs/src/routes/docs/(qwikcity)/advanced/menu/index.mdx index 5a0f64ff6c3..53f469297b6 100644 --- a/packages/docs/src/routes/docs/(qwikcity)/advanced/menu/index.mdx +++ b/packages/docs/src/routes/docs/(qwikcity)/advanced/menu/index.mdx @@ -1,5 +1,6 @@ --- title: Menu | Advanced +description: How to use menus to define site navigation. contributors: - manucorporat - adamdbradley @@ -10,6 +11,7 @@ contributors: - jakovljevic-mladen - cunzaizhuyi - AnthonyPAlicea + - hamatoyogi --- # Menu diff --git a/packages/docs/src/routes/docs/(qwikcity)/advanced/request-handling/index.mdx b/packages/docs/src/routes/docs/(qwikcity)/advanced/request-handling/index.mdx index f0313c76341..eca49b90df9 100644 --- a/packages/docs/src/routes/docs/(qwikcity)/advanced/request-handling/index.mdx +++ b/packages/docs/src/routes/docs/(qwikcity)/advanced/request-handling/index.mdx @@ -1,26 +1,28 @@ --- title: Request Handling | Advanced +description: How to handle requests in Qwik City, including REST endpoints, and middlewares. contributors: - adamdbradley - manucorporat - mhevery + - hamatoyogi --- # Request handling Each `layout.ts` and `index.ts` file inside the `src/routes` directory has the ability to access the current HTTP request, response, and URL. This allows you to retrieve and modify data, and even respond with custom content. -Qwik City implements a middleware system based on the hirarchy of the `src/routes` directory. The middleware system is used to handle HTTP requests and responses and is available to pages, layouts, and [endpoints](/docs/(qwikcity)/middleware/index.mdx). +Qwik City implements a middleware system based on the hirarchy of the `src/routes` directory. The middleware system is used to handle HTTP requests and responses and is available to pages, layouts, and [endpoints](/docs/(qwikcity)/endpoints/index.mdx). -Each route can add HTTP request and response handlers, allowing developers to retrieve and modify data. The handlers can also be used by [endpoints](/docs/(qwikcity)/middleware/index.mdx), which only respond with data rather than a page's HTML. +Each route can add HTTP request and response handlers, allowing developers to retrieve and modify data. The handlers can also be used by [endpoints](/docs/(qwikcity)/endpoints/index.mdx), which only respond with data rather than a page's HTML. This feature enables you to handle any request event, have side effects on the request pipeline, just before you render the component and respond with custom content. It is available to pages, layouts and endpoint routes, but not on regular components. ## Request and Response Handlers -On pages, layouts, and [endpoints](/docs/(qwikcity)/middleware/index.mdx), we can access request data by implementing request handler functions such as `onGet`, `onPost`, `onPut`, etc. These functions are executed according to the [HTTP method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) used for this route. +On pages, layouts, and [endpoints](/docs/(qwikcity)/endpoints/index.mdx), we can access request data by implementing request handler functions such as `onGet`, `onPost`, `onPut`, etc. These functions are executed according to the [HTTP method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) used for this route. -Additionally, an `onRequest` function can be used to handle any request method, rather than a specific one. For example, if both `onGet` and `onRequest` is provided, for a `GET` request, the `onGet` will be called. However, in this scenario, if a `POST` request method came in, then the `onRequest` handler would be called since an `onPost` was not provided. +Additionally, an `onRequest` function can be used to handle any request method, rather than a specific one, in the form of a [middleware](/docs/(qwikcity)/middleware/index.mdx). For example, if both `onGet` and `onRequest` is provided, for a `GET` request, the `onGet` will be called. However, in this scenario, if a `POST` request method came in, then the `onRequest` handler would be called since an `onPost` was not provided. The `onRequest` is available as a catch-all to any request methods that do not have a specific method. ```tsx diff --git a/packages/docs/src/routes/docs/(qwikcity)/advanced/routing/index.mdx b/packages/docs/src/routes/docs/(qwikcity)/advanced/routing/index.mdx index 3c8eb571e29..48dcddd21d7 100644 --- a/packages/docs/src/routes/docs/(qwikcity)/advanced/routing/index.mdx +++ b/packages/docs/src/routes/docs/(qwikcity)/advanced/routing/index.mdx @@ -1,4 +1,6 @@ --- +title: Advanced Routing | Qwik City +description: Learn about advanced routing in Qwik City, including 404 page handling, grouped layouts, named layouts, nested layouts, and plugin.ts files. contributors: - manucorporat - adamdbradley @@ -6,6 +8,7 @@ contributors: - the-r3aper7 - mhevery - jakovljevic-mladen + - hamatoyogi --- # Advanced Routing diff --git a/packages/docs/src/routes/docs/(qwikcity)/advanced/sitemaps/index.mdx b/packages/docs/src/routes/docs/(qwikcity)/advanced/sitemaps/index.mdx index 3576cfe3ca4..1f9bd61483a 100644 --- a/packages/docs/src/routes/docs/(qwikcity)/advanced/sitemaps/index.mdx +++ b/packages/docs/src/routes/docs/(qwikcity)/advanced/sitemaps/index.mdx @@ -1,7 +1,9 @@ --- title: Generating Sitemaps | Advanced +description: Learn how to generate a sitemap for your site in Qwik City. contributors: - adamdbradley + - hamatoyogi --- # Generating Sitemaps diff --git a/packages/docs/src/routes/docs/(qwikcity)/advanced/speculative-module-fetching/index.mdx b/packages/docs/src/routes/docs/(qwikcity)/advanced/speculative-module-fetching/index.mdx index 66c63a79be8..e01b718f4e6 100644 --- a/packages/docs/src/routes/docs/(qwikcity)/advanced/speculative-module-fetching/index.mdx +++ b/packages/docs/src/routes/docs/(qwikcity)/advanced/speculative-module-fetching/index.mdx @@ -1,5 +1,6 @@ --- title: Speculative Module Fetching | Advanced +description: Learn how Qwik handles loading bundles in the background and filling the cache with Speculative Module Fetching. contributors: - ulic75 - mhevery diff --git a/packages/docs/src/routes/docs/(qwikcity)/advanced/static-assets/index.mdx b/packages/docs/src/routes/docs/(qwikcity)/advanced/static-assets/index.mdx index 5573c2b1e93..f71a17c2c2a 100644 --- a/packages/docs/src/routes/docs/(qwikcity)/advanced/static-assets/index.mdx +++ b/packages/docs/src/routes/docs/(qwikcity)/advanced/static-assets/index.mdx @@ -1,11 +1,13 @@ --- title: Static Assets | Advanced +description: How to serve static assets in your Qwik app. contributors: - manucorporat - Oyemade - mhevery - adamdbradley - the-r3aper7 + - hamatoyogi --- # Static Assets diff --git a/packages/docs/src/routes/docs/(qwikcity)/api/index.mdx b/packages/docs/src/routes/docs/(qwikcity)/api/index.mdx index 705fd1c2551..b128f394973 100644 --- a/packages/docs/src/routes/docs/(qwikcity)/api/index.mdx +++ b/packages/docs/src/routes/docs/(qwikcity)/api/index.mdx @@ -1,5 +1,6 @@ --- -title: API reference | QwikCity +title: API reference | Qwik City +description: Qwik City API reference. contributors: - manucorporat - adamdbradley @@ -14,6 +15,7 @@ contributors: - Mhmdrza - ulic75 - mhevery + - hamatoyogi --- # API reference diff --git a/packages/docs/src/routes/docs/(qwikcity)/caching/index.mdx b/packages/docs/src/routes/docs/(qwikcity)/caching/index.mdx index 322cc5908d2..54ee9cfb638 100644 --- a/packages/docs/src/routes/docs/(qwikcity)/caching/index.mdx +++ b/packages/docs/src/routes/docs/(qwikcity)/caching/index.mdx @@ -1,9 +1,11 @@ --- -title: Caching | QwikCity +title: Caching | Qwik City +description: Learn how to handle caching in your Qwik City app to keep your site as fast as possible. contributors: - steve8708 - harishkrishnan24 - maiieul + - hamatoyogi --- # Caching Responses diff --git a/packages/docs/src/routes/docs/(qwikcity)/endpoints/index.mdx b/packages/docs/src/routes/docs/(qwikcity)/endpoints/index.mdx index accf3cd8269..f1aaa4cf92b 100644 --- a/packages/docs/src/routes/docs/(qwikcity)/endpoints/index.mdx +++ b/packages/docs/src/routes/docs/(qwikcity)/endpoints/index.mdx @@ -1,5 +1,6 @@ --- -title: Endpoints | QwikCity +title: Endpoints | Qwik City +description: Endpoints are middleware functions used to control and return data in various formats like RESTful API, GraphQL API, JSON, XML, reverse proxy, or other API types. contributors: - adamdbradley - manucorporat diff --git a/packages/docs/src/routes/docs/(qwikcity)/env-variables/index.mdx b/packages/docs/src/routes/docs/(qwikcity)/env-variables/index.mdx index c2d023eb700..2bebcaaed45 100644 --- a/packages/docs/src/routes/docs/(qwikcity)/env-variables/index.mdx +++ b/packages/docs/src/routes/docs/(qwikcity)/env-variables/index.mdx @@ -1,5 +1,6 @@ --- -title: Environment variables | QwikCity +title: Environment variables | Qwik City +description: Qwik apps can read environment variables in two main ways build-time variables and server-side variables. contributors: - manucorporat - the-r3aper7 diff --git a/packages/docs/src/routes/docs/(qwikcity)/guides/best-practices/index.mdx b/packages/docs/src/routes/docs/(qwikcity)/guides/best-practices/index.mdx index abeaa7cd8fc..4768607f16b 100644 --- a/packages/docs/src/routes/docs/(qwikcity)/guides/best-practices/index.mdx +++ b/packages/docs/src/routes/docs/(qwikcity)/guides/best-practices/index.mdx @@ -1,5 +1,6 @@ --- title: Best Practices | Guides +description: Learn the best practices for Qwik, a guide for understanding how to use Qwik to its full potential. contributors: - mhevery - the-r3aper7 @@ -12,6 +13,7 @@ contributors: - un33k - egmaleta - mugan86 + - hamatoyogi --- # Best Practices diff --git a/packages/docs/src/routes/docs/(qwikcity)/guides/bundle/index.mdx b/packages/docs/src/routes/docs/(qwikcity)/guides/bundle/index.mdx index 1a6820ef161..6224d6794d7 100644 --- a/packages/docs/src/routes/docs/(qwikcity)/guides/bundle/index.mdx +++ b/packages/docs/src/routes/docs/(qwikcity)/guides/bundle/index.mdx @@ -1,7 +1,9 @@ --- title: Bundle Optimization | Guides +description: Learn about bundle optimization in Qwik, a JavaScript framework for building web applications. This guide explains how to optimize your code by co-locating symbols and chunks, and provides examples of how to create and use symbols in your source code. Follow along with the code snippets and try them out in the included CodeSandbox demo. contributors: - mhevery + - hamatoyogi --- import CodeSandbox from '../../../../../components/code-sandbox/index.tsx'; @@ -137,7 +139,7 @@ To collect symbol usage from a running application: 3. Open the console and type `symbols` to see the list of symbols used. Used that information to update the `vite.config.ts` file. -> **NOTE:** We are looking into creating better ways of collecting this information in the future. +> **NOTE:** We are looking into creating better ways of collecting this information in the future. (See [Insights](/docs/labs/insights/index.mdx).) > **NOTE:** Symbols hashes are designed to be stable even across many compilations. However, if the code undergoes complex refactoring it is possible for the hash to change. This will not break the application, but it may cause the symbol to be moved to a different sub-optimal chunk until runtime analytics can be collected again. diff --git a/packages/docs/src/routes/docs/(qwikcity)/guides/mdx/index.mdx b/packages/docs/src/routes/docs/(qwikcity)/guides/mdx/index.mdx index 1deb89b23cf..6dc4fbdd3af 100644 --- a/packages/docs/src/routes/docs/(qwikcity)/guides/mdx/index.mdx +++ b/packages/docs/src/routes/docs/(qwikcity)/guides/mdx/index.mdx @@ -1,5 +1,6 @@ --- title: Markdown and MDX | Guides +description: Learn how to use Markdown and MDX in Qwik City. contributors: - manucorporat - adamdbradley @@ -9,6 +10,7 @@ contributors: - cunzaizhuyi - the-r3aper7 - zanettin + - hamatoyogi --- # MDX diff --git a/packages/docs/src/routes/docs/(qwikcity)/guides/qwik-nutshell/index.mdx b/packages/docs/src/routes/docs/(qwikcity)/guides/qwik-nutshell/index.mdx index d9dc6382444..62d65a80dbd 100644 --- a/packages/docs/src/routes/docs/(qwikcity)/guides/qwik-nutshell/index.mdx +++ b/packages/docs/src/routes/docs/(qwikcity)/guides/qwik-nutshell/index.mdx @@ -1,9 +1,11 @@ --- title: Qwik in a nutshell | Introduction +description: Learn the general concepts of Qwik in this shoet introduction guide. contributors: - manucorporat - AnthonyPAlicea - the-r3aper7 + - hamatoyogi --- # Qwik in a nutshell diff --git a/packages/docs/src/routes/docs/(qwikcity)/guides/react-cheat-sheet/index.mdx b/packages/docs/src/routes/docs/(qwikcity)/guides/react-cheat-sheet/index.mdx index 27bd96b97d1..5ec928b4bec 100644 --- a/packages/docs/src/routes/docs/(qwikcity)/guides/react-cheat-sheet/index.mdx +++ b/packages/docs/src/routes/docs/(qwikcity)/guides/react-cheat-sheet/index.mdx @@ -1,5 +1,7 @@ --- title: Qwik for React developers +description: Learn the difference between React and Qwik in this handy cheat sheet. + contributors: - the-r3aper7 - ChibiBlasphem @@ -14,6 +16,7 @@ contributors: - AnthonyPAlicea - mhevery - nsdonato + - hamatoyogi --- # React Vs Qwik diff --git a/packages/docs/src/routes/docs/(qwikcity)/guides/redirects/index.mdx b/packages/docs/src/routes/docs/(qwikcity)/guides/redirects/index.mdx index 4a73d6d2773..08ca53335a1 100644 --- a/packages/docs/src/routes/docs/(qwikcity)/guides/redirects/index.mdx +++ b/packages/docs/src/routes/docs/(qwikcity)/guides/redirects/index.mdx @@ -1,9 +1,11 @@ --- title: Redirects | Guides +description: Learn how to use redirects in Qwik City. contributors: - adamdbradley - manucorporat - mhevery + - hamatoyogi --- # Redirects diff --git a/packages/docs/src/routes/docs/(qwikcity)/guides/serialization/index.mdx b/packages/docs/src/routes/docs/(qwikcity)/guides/serialization/index.mdx index d77f636b456..97762916c69 100644 --- a/packages/docs/src/routes/docs/(qwikcity)/guides/serialization/index.mdx +++ b/packages/docs/src/routes/docs/(qwikcity)/guides/serialization/index.mdx @@ -1,11 +1,13 @@ --- title: Serialization and Serialization Boundaries | Guides +description: Learn about serialization and serialization boundaries in Qwik, the process of converting data into a format that can be stored or transmitted. contributors: - fabien0102 - wuweiweiwu - manucorporat - adamdbradley - voluntadpear + - hamatoyogi --- # `$` Boundaries diff --git a/packages/docs/src/routes/docs/(qwikcity)/guides/static-site-generation/index.mdx b/packages/docs/src/routes/docs/(qwikcity)/guides/static-site-generation/index.mdx index 0858aa3cc6a..0dac0a9089d 100644 --- a/packages/docs/src/routes/docs/(qwikcity)/guides/static-site-generation/index.mdx +++ b/packages/docs/src/routes/docs/(qwikcity)/guides/static-site-generation/index.mdx @@ -1,9 +1,11 @@ --- title: Static Site Generation (SSG) Overview | Guides +description: Learn how static site generation (SSG) works in Qwik City. contributors: - adamdbradley - AnthonyPAlicea - mhevery + - hamatoyogi --- # Static Site Generation (SSG) Overview diff --git a/packages/docs/src/routes/docs/(qwikcity)/html-attributes/index.mdx b/packages/docs/src/routes/docs/(qwikcity)/html-attributes/index.mdx index e72d10d36da..48cc66b5ea8 100644 --- a/packages/docs/src/routes/docs/(qwikcity)/html-attributes/index.mdx +++ b/packages/docs/src/routes/docs/(qwikcity)/html-attributes/index.mdx @@ -1,7 +1,9 @@ --- title: HTML attributes | QwikCity +description: Learn how to add attributes to the html tag, in order to add "lang" or other custom attributes. contributors: - bab2683 + - hamatoyogi --- # HTML attributes diff --git a/packages/docs/src/routes/docs/(qwikcity)/routing/index.mdx b/packages/docs/src/routes/docs/(qwikcity)/routing/index.mdx index c1f8ea418d0..e12ff55b101 100644 --- a/packages/docs/src/routes/docs/(qwikcity)/routing/index.mdx +++ b/packages/docs/src/routes/docs/(qwikcity)/routing/index.mdx @@ -1,5 +1,6 @@ --- title: Routing | Qwik City +description: Learn about routing in Qwik City which is like other file-system based such as Next.js, SvelteKit, SolidStart or Remix. contributors: - manucorporat - nnelgxorz