diff --git a/docs/concepts/app-wrapper.md b/docs/concepts/app-wrapper.md index 20df8056..28e36640 100644 --- a/docs/concepts/app-wrapper.md +++ b/docs/concepts/app-wrapper.md @@ -23,32 +23,3 @@ export default function App({ Component }: AppProps) { ); } ``` - -There is also a possibility to modify the document template by using special -tags `html`, `Head` or `body`. This can be done in any other Preact component, -but using it in the application wrapper lets you define one common document -template. - -```tsx -// routes/_app.tsx - -import { asset, Head } from "$fresh/runtime.ts"; -import { AppProps } from "$fresh/src/server/types.ts"; - -export default function App({ Component }: AppProps) { - return ( - - - Fresh - - - - - - - ); -} -``` - -Currently, there is no way of overriding default tags/attributes from provided -template. diff --git a/docs/examples/index.md b/docs/examples/index.md index 1bf1978e..7f5c2185 100644 --- a/docs/examples/index.md +++ b/docs/examples/index.md @@ -8,4 +8,4 @@ that you may like in your Fresh project. If there's a specific example you'd like to see here, please open [a GitHub discussion](https://github.com/denoland/fresh/discussions/new?category=ideas). -- [Modifying the `` Element](modifying-the-head-element) +- [Modifying the ``](./examples/modifying-the-head) diff --git a/docs/examples/modifying-the-head-element.md b/docs/examples/modifying-the-head.md similarity index 59% rename from docs/examples/modifying-the-head-element.md rename to docs/examples/modifying-the-head.md index 5700bd46..856544a7 100644 --- a/docs/examples/modifying-the-head-element.md +++ b/docs/examples/modifying-the-head.md @@ -1,16 +1,17 @@ --- description: | - By adding inner components to Fresh's head element, we add inner components to the HTML head element of the web page. + Add components like or <meta> to a <head> tag using Fresh's <Head> component. --- -We can use the `<Head />` component in `$fresh/runtime.ts` to modify the -`<head>` element. By adding inner components to `<Head />`, we add inner -components to the `<head>` element of the web page. Some uses include: +We can use the `<Head />` component in `$fresh/runtime.ts` to add elements as +children of the `<head>` element. By adding elements as children of Fresh's +`<Head />` tag, these automatically get injected into the `<head>` element of +the web page. Some uses include: - Setting the document title using `<title>` - Specifying page metadata using `<meta>` -- Linking to external resources using `<link>` -- Including JavaScript code using `<script>` +- Linking to resources like stylesheets using `<link>` +- Including third-party JavaScript code using `<script>` ```tsx // routes/index.tsx diff --git a/docs/toc.json b/docs/toc.json index fea1bf9c..5f75a76d 100644 --- a/docs/toc.json +++ b/docs/toc.json @@ -39,8 +39,6 @@ }, "examples": { "title": "Examples", - "pages": [ - ["modifying-the-head-element", "Modifying the Head Element"] - ] + "pages": [["modifying-the-head", "Modifying the <head>"]] } }