Skip to content

Commit fe2c95c

Browse files
chore: release 1.5.0 (#1899)
1 parent bc89844 commit fe2c95c

File tree

9 files changed

+50
-319
lines changed

9 files changed

+50
-319
lines changed

docs/canary/concepts/app-wrapper.md

-106
This file was deleted.

docs/canary/concepts/updating.md

-128
This file was deleted.

docs/canary/examples/modifying-the-head.md

-79
This file was deleted.
File renamed without changes.

docs/latest/concepts/updating.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ To run the auto updater, run the following command from the root of your
4242
project:
4343

4444
```sh Terminal
45-
$ deno run -A -r https://fresh.deno.dev/update .
45+
$ deno run -A -r https://fresh.deno.dev/update
4646
```
4747

4848
You will be prompted to confirm the changes that will be made to your project.
File renamed without changes.

docs/latest/examples/modifying-the-head.md

+41
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,44 @@ export default function Home() {
3636
);
3737
}
3838
```
39+
40+
## Avoiding duplicate tags
41+
42+
You might end up with duplicate tags, when multiple `<Head />` components are
43+
rendered on the same page. This can happen when you render `<Head />` in a route
44+
and another `<Head />` in another component for example.
45+
46+
```tsx
47+
// routes/page-a.tsx
48+
<Head>
49+
<meta name="og:title" content="This is a title" />
50+
</Head>
51+
52+
// components/MyTitle.tsx
53+
<Head>
54+
<meta name="og:title" content="Other title" />
55+
</Head>
56+
```
57+
58+
To ensure that the tag is not duplicated, Fresh supports setting the `key` prop.
59+
By giving matching elements the same `key` prop, only the last one will be
60+
rendered.
61+
62+
```diff
63+
// routes/page-a.tsx
64+
<Head>
65+
- <meta name="og:title" content="This is a title" />
66+
+ <meta name="og:title" content="This is a title" key="title" />
67+
</Head>
68+
69+
// components/MyTitle.tsx
70+
<Head>
71+
- <meta name="og:title" content="Other title" />
72+
+ <meta name="og:title" content="Other title" key="title" />
73+
</Head>
74+
```
75+
76+
The rendered page will only include the `<meta>`-tag with `"Other title"`.
77+
78+
> [info]: The `<title>`-tag is automatically deduplicated, even without a `key`
79+
> prop.

0 commit comments

Comments
 (0)