Skip to content

Commit b8b84be

Browse files
committed
Allow robots on single result pages
Signed-off-by: Olga Bulat <[email protected]>
1 parent 8768c02 commit b8b84be

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

frontend/src/utils/og.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ export const createDetailPageMeta = ({
1616
isSensitive: boolean
1717
}) => {
1818
const head: { meta: Meta } = { meta: [] }
19-
const meta: Meta = []
19+
const meta: Meta = [
20+
{
21+
key: "robots",
22+
name: "robots",
23+
content: "all",
24+
},
25+
]
2026
if (title) {
2127
meta.push({
2228
key: "og:title",

frontend/test/playwright/e2e/seo.spec.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { preparePageForTests } from "~~/test/playwright/utils/navigation"
55
test.describe.configure({ mode: "parallel" })
66
const DESCRIPTION =
77
"Search over 800 million free and openly licensed images, photos, audio, and other media types for reuse and remixing."
8-
const ROBOTS = "noindex, nofollow"
8+
const NO_INDEX = "noindex, nofollow"
99
const DEFAULT_IMAGE = "/openverse-default.jpg"
1010

1111
const pages = {
@@ -14,28 +14,28 @@ const pages = {
1414
title: "Openly Licensed Images, Audio and More | Openverse",
1515
ogImage: DEFAULT_IMAGE,
1616
ogTitle: "Openverse",
17-
robots: ROBOTS,
17+
robots: NO_INDEX,
1818
},
1919
allSearch: {
2020
url: "/search/?q=birds",
2121
title: "birds | Openverse",
2222
ogImage: DEFAULT_IMAGE,
2323
ogTitle: "Openverse",
24-
robots: ROBOTS,
24+
robots: NO_INDEX,
2525
},
2626
imageSearch: {
2727
url: "/search/image?q=birds",
2828
title: "birds | Openverse",
2929
ogImage: DEFAULT_IMAGE,
3030
ogTitle: "Openverse",
31-
robots: ROBOTS,
31+
robots: NO_INDEX,
3232
},
3333
audioSearch: {
3434
url: "/search/audio?q=birds",
3535
title: "birds | Openverse",
3636
ogImage: DEFAULT_IMAGE,
3737
ogTitle: "Openverse",
38-
robots: ROBOTS,
38+
robots: NO_INDEX,
3939
},
4040
imageDetail: {
4141
url: "/image/da5cb478-c093-4d62-b721-cda18797e3fb",
@@ -44,7 +44,7 @@ const pages = {
4444
"/v1/images/da5cb478-c093-4d62-b721-cda18797e3fb/thumb/"
4545
),
4646
ogTitle: "bird",
47-
robots: ROBOTS,
47+
robots: "all",
4848
},
4949
audioDetail: {
5050
url: "/audio/7e063ee6-343f-48e4-a4a5-f436393730f6",
@@ -53,35 +53,35 @@ const pages = {
5353
"/v1/audio/7e063ee6-343f-48e4-a4a5-f436393730f6/thumb/"
5454
),
5555
ogTitle: "I Love My Dog You Love your Cat",
56-
robots: ROBOTS,
56+
robots: "all",
5757
},
5858
about: {
5959
url: "/about",
6060
title: "About Openverse | Openverse",
6161
ogImage: DEFAULT_IMAGE,
6262
ogTitle: "Openverse",
63-
robots: ROBOTS,
63+
robots: NO_INDEX,
6464
},
6565
tag: {
6666
url: "/image/collection?tag=cat",
6767
title: "cat images | Openverse",
6868
ogImage: DEFAULT_IMAGE,
6969
ogTitle: "cat images | Openverse",
70-
robots: ROBOTS,
70+
robots: NO_INDEX,
7171
},
7272
source: {
7373
url: "/image/collection?source=flickr",
7474
title: "Flickr images | Openverse",
7575
ogImage: DEFAULT_IMAGE,
7676
ogTitle: "Flickr images | Openverse",
77-
robots: ROBOTS,
77+
robots: NO_INDEX,
7878
},
7979
creator: {
8080
url: "/image/collection?source=flickr&creator=strogoscope",
8181
title: "strogoscope | Openverse",
8282
ogImage: DEFAULT_IMAGE,
8383
ogTitle: "strogoscope | Openverse",
84-
robots: ROBOTS,
84+
robots: NO_INDEX,
8585
},
8686
}
8787
test.describe("page metadata", () => {

0 commit comments

Comments
 (0)