diff --git a/index.html b/index.html index adad602..f3d23a4 100644 --- a/index.html +++ b/index.html @@ -45,7 +45,7 @@ "description": "A zero-HTML TypeScript framework for building web and native user interfaces.", "potentialAction": { "@type": "SearchAction", - "target": "https://typecomposer.com/#/docs/{search_term_string}", + "target": "https://typecomposer.com/docs/{search_term_string}", "query-input": "required name=search_term_string" } } @@ -72,4 +72,4 @@ - \ No newline at end of file + diff --git a/public/.htaccess b/public/.htaccess index 978b4af..dbcd975 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -1,9 +1,11 @@ -# Ativa o módulo de reescrita de URLs +# SPA fallback: rewrite all non-file, non-directory requests to index.html +# This enables browser-history (HTML5 pushState) routing for clean URLs like +# /docs/skills, /docs/getting-started, /playground, etc. RewriteEngine On -# Se o recurso solicitado não for um arquivo (-f) nem um diretório (-d) +# Allow direct access to real files (assets, robots.txt, sitemap.xml, etc.) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d -# Redireciona todas as requisições para index.html -RewriteRule ^.*$ /index.html [L,QSA] \ No newline at end of file +# Rewrite everything else to the SPA entry point +RewriteRule ^.*$ /index.html [L,QSA] diff --git a/public/llms.txt b/public/llms.txt index 66bffc1..37b79cb 100644 --- a/public/llms.txt +++ b/public/llms.txt @@ -10,41 +10,41 @@ TypeComposer lets you compose UIs entirely in TypeScript — no JSX, no HTML tem - **Reactivity** — `ref`, `refBoolean`, `refNumber`, `refString`, `refList`, `refMap`, `refSet`, `computed` — reactive primitives that update the DOM automatically. - **Layout** — `VBox`, `HBox`, `BorderPanel` — flexbox-based layout components. - **Elements** — `DivElement`, `ButtonElement`, `InputElement`, `LabelElement`, `SpanElement`, `HeadingElement`, `TableElement`. -- **Router** — Hash-based SPA router with typed route definitions. `Router.create({ history: "hash", routes: [...] })`. +- **Router** — Browser-history SPA router with typed route definitions. `Router.create({ history: "browser", routes: [...] })`. - **RouterView** — Outlet component that renders the matched child route. - **Dependency Injection** — Built-in DI container; inject services into components via constructor. - **Agent Skills** — Integration guide for using TypeComposer apps as AI agent skills. ## Docs -- [Why TypeComposer?](https://typecomposer.com/#/docs/home) -- [Getting Started](https://typecomposer.com/#/docs/getting-started) -- [Component](https://typecomposer.com/#/docs/components/component) -- [Template](https://typecomposer.com/#/docs/components/template) -- [Lifecycle](https://typecomposer.com/#/docs/components/lifecycle-docs) -- [Dependency Injection](https://typecomposer.com/#/docs/dependency-injection) -- [ref](https://typecomposer.com/#/docs/reactivity/ref) -- [refBoolean](https://typecomposer.com/#/docs/reactivity/refboolean) -- [refNumber](https://typecomposer.com/#/docs/reactivity/refnumber) -- [refString](https://typecomposer.com/#/docs/reactivity/refstring) -- [refList](https://typecomposer.com/#/docs/reactivity/reflist) -- [refMap](https://typecomposer.com/#/docs/reactivity/refmap) -- [refSet](https://typecomposer.com/#/docs/reactivity/refset) -- [computed](https://typecomposer.com/#/docs/reactivity/computed) -- [Router](https://typecomposer.com/#/docs/router) -- [RouterView](https://typecomposer.com/#/docs/router-view) -- [BorderPanel](https://typecomposer.com/#/docs/layout/border-panel) -- [VBox](https://typecomposer.com/#/docs/layout/vbox) -- [HBox](https://typecomposer.com/#/docs/layout/hbox) -- [Div](https://typecomposer.com/#/docs/elements/div) -- [Button](https://typecomposer.com/#/docs/elements/button) -- [Input](https://typecomposer.com/#/docs/elements/input) -- [Label](https://typecomposer.com/#/docs/elements/label) -- [Table](https://typecomposer.com/#/docs/elements/table) -- [Span](https://typecomposer.com/#/docs/elements/span) -- [Heading](https://typecomposer.com/#/docs/elements/heading) -- [Agent Skills](https://typecomposer.com/#/docs/skills) -- [Playground](https://typecomposer.com/#/playground) +- [Why TypeComposer?](https://typecomposer.com/docs/home) +- [Getting Started](https://typecomposer.com/docs/getting-started) +- [Component](https://typecomposer.com/docs/components/component) +- [Template](https://typecomposer.com/docs/components/template) +- [Lifecycle](https://typecomposer.com/docs/components/lifecycle-docs) +- [Dependency Injection](https://typecomposer.com/docs/dependency-injection) +- [ref](https://typecomposer.com/docs/reactivity/ref) +- [refBoolean](https://typecomposer.com/docs/reactivity/refboolean) +- [refNumber](https://typecomposer.com/docs/reactivity/refnumber) +- [refString](https://typecomposer.com/docs/reactivity/refstring) +- [refList](https://typecomposer.com/docs/reactivity/reflist) +- [refMap](https://typecomposer.com/docs/reactivity/refmap) +- [refSet](https://typecomposer.com/docs/reactivity/refset) +- [computed](https://typecomposer.com/docs/reactivity/computed) +- [Router](https://typecomposer.com/docs/router) +- [RouterView](https://typecomposer.com/docs/router-view) +- [BorderPanel](https://typecomposer.com/docs/layout/border-panel) +- [VBox](https://typecomposer.com/docs/layout/vbox) +- [HBox](https://typecomposer.com/docs/layout/hbox) +- [Div](https://typecomposer.com/docs/elements/div) +- [Button](https://typecomposer.com/docs/elements/button) +- [Input](https://typecomposer.com/docs/elements/input) +- [Label](https://typecomposer.com/docs/elements/label) +- [Table](https://typecomposer.com/docs/elements/table) +- [Span](https://typecomposer.com/docs/elements/span) +- [Heading](https://typecomposer.com/docs/elements/heading) +- [Agent Skills](https://typecomposer.com/docs/skills) +- [Playground](https://typecomposer.com/playground) ## GitHub @@ -52,4 +52,4 @@ TypeComposer lets you compose UIs entirely in TypeScript — no JSX, no HTML tem - [typecomposer/docs](https://github.com/TypeComposer/docs) — documentation site - [typecomposer/plugin](https://github.com/TypeComposer/plugin) — Vite plugin - [typecomposer/create](https://github.com/TypeComposer/create) — CLI scaffolding -- [typecomposer/ssr](https://github.com/TypeComposer/ssr) — SSR / hydration \ No newline at end of file +- [typecomposer/ssr](https://github.com/TypeComposer/ssr) — SSR / hydration diff --git a/public/sitemap.xml b/public/sitemap.xml index 7a1443f..9adc528 100644 --- a/public/sitemap.xml +++ b/public/sitemap.xml @@ -9,157 +9,157 @@ - https://typecomposer.com/#/docs/home + https://typecomposer.com/docs/home weekly 0.9 - https://typecomposer.com/#/docs/getting-started + https://typecomposer.com/docs/getting-started weekly 0.9 - https://typecomposer.com/#/docs/skills + https://typecomposer.com/docs/skills monthly 0.6 - https://typecomposer.com/#/docs/components/component + https://typecomposer.com/docs/components/component weekly 0.8 - https://typecomposer.com/#/docs/components/template + https://typecomposer.com/docs/components/template weekly 0.8 - https://typecomposer.com/#/docs/components/lifecycle-docs + https://typecomposer.com/docs/components/lifecycle-docs weekly 0.7 - https://typecomposer.com/#/docs/dependency-injection + https://typecomposer.com/docs/dependency-injection weekly 0.8 - https://typecomposer.com/#/docs/reactivity/ref + https://typecomposer.com/docs/reactivity/ref weekly 0.8 - https://typecomposer.com/#/docs/reactivity/refboolean + https://typecomposer.com/docs/reactivity/refboolean weekly 0.7 - https://typecomposer.com/#/docs/reactivity/refnumber + https://typecomposer.com/docs/reactivity/refnumber weekly 0.7 - https://typecomposer.com/#/docs/reactivity/refstring + https://typecomposer.com/docs/reactivity/refstring weekly 0.7 - https://typecomposer.com/#/docs/reactivity/reflist + https://typecomposer.com/docs/reactivity/reflist weekly 0.7 - https://typecomposer.com/#/docs/reactivity/refmap + https://typecomposer.com/docs/reactivity/refmap weekly 0.7 - https://typecomposer.com/#/docs/reactivity/refset + https://typecomposer.com/docs/reactivity/refset weekly 0.7 - https://typecomposer.com/#/docs/reactivity/computed + https://typecomposer.com/docs/reactivity/computed weekly 0.7 - https://typecomposer.com/#/docs/router + https://typecomposer.com/docs/router weekly 0.8 - https://typecomposer.com/#/docs/router-view + https://typecomposer.com/docs/router-view weekly 0.7 - https://typecomposer.com/#/docs/layout/border-panel + https://typecomposer.com/docs/layout/border-panel weekly 0.7 - https://typecomposer.com/#/docs/layout/vbox + https://typecomposer.com/docs/layout/vbox weekly 0.7 - https://typecomposer.com/#/docs/layout/hbox + https://typecomposer.com/docs/layout/hbox weekly 0.7 - https://typecomposer.com/#/docs/elements/div + https://typecomposer.com/docs/elements/div weekly 0.6 - https://typecomposer.com/#/docs/elements/button + https://typecomposer.com/docs/elements/button weekly 0.6 - https://typecomposer.com/#/docs/elements/input + https://typecomposer.com/docs/elements/input weekly 0.6 - https://typecomposer.com/#/docs/elements/label + https://typecomposer.com/docs/elements/label weekly 0.6 - https://typecomposer.com/#/docs/elements/table + https://typecomposer.com/docs/elements/table weekly 0.6 - https://typecomposer.com/#/docs/elements/span + https://typecomposer.com/docs/elements/span weekly 0.6 - https://typecomposer.com/#/docs/elements/heading + https://typecomposer.com/docs/elements/heading weekly 0.6 - https://typecomposer.com/#/playground + https://typecomposer.com/playground monthly 0.5 - \ No newline at end of file + diff --git a/src/router/router.ts b/src/router/router.ts index 1a08868..7695d2e 100644 --- a/src/router/router.ts +++ b/src/router/router.ts @@ -7,7 +7,7 @@ import { HomePage } from "@/pages/Home"; loadDocs().finally(() => { Router.create({ - history: "hash", + history: "browser", routes: [ { path: "/", component: HomePage }, { diff --git a/src/utils/seo.ts b/src/utils/seo.ts index 83d49be..56e125d 100644 --- a/src/utils/seo.ts +++ b/src/utils/seo.ts @@ -1,11 +1,11 @@ /** * SEO utilities — update and <meta name="description"> on each route - * transition. Since this is a hash-router SPA with no SSR, these updates help - * browser history titles, social preview when JS runs, and AI crawlers that - * execute JS (e.g. Googlebot, GPTBot after rendering). + * transition. * - * Canonical stays fixed at https://typecomposer.com/ in index.html because - * hash fragments are not real URLs; there is no per-page canonical benefit. + * With browser-history routing every route is a real URL, so Googlebot and + * other crawlers can index /docs/skills, /docs/getting-started, etc. directly. + * The static <link rel="canonical"> in index.html covers the root; per-route + * canonicals are declared in the sitemap rather than injected at runtime. */ interface PageMeta { @@ -84,7 +84,7 @@ const PAGE_META: Record<string, PageMeta> = { }, "docs/router": { title: "Router", - description: "TypeComposer's built-in hash router — define typed routes, nested routes, wildcards, and redirects in pure TypeScript.", + description: "TypeComposer's built-in router — define typed routes, nested routes, wildcards, and redirects in pure TypeScript.", }, "docs/router-view": { title: "RouterView", @@ -133,7 +133,8 @@ const PAGE_META: Record<string, PageMeta> = { }; /** - * Update <title> and <meta name="description"> for the given router pathname. + * Update <title> and <meta name="description"> for the given router pathname + * (e.g. "docs/skills"). * Call this from BaseView constructor or onConnected whenever the route changes. */ export function updatePageMeta(pathname: string): void { diff --git a/vite.config.js b/vite.config.js index fee80f9..d1fb2fd 100644 --- a/vite.config.js +++ b/vite.config.js @@ -34,7 +34,9 @@ export default defineConfig({ "@": path.resolve(__dirname, "./src"), }, }, - base: "./", + // Use absolute base "/" so asset paths resolve correctly with browser-history + // routing (e.g. /docs/skills loads assets from /assets/*, not /docs/assets/*). + base: "/", css: { preprocessorOptions: { scss: {