Skip to content

Commit

Permalink
Allow robots on single result pages
Browse files Browse the repository at this point in the history
Signed-off-by: Olga Bulat <[email protected]>
  • Loading branch information
obulat committed Jul 29, 2024
1 parent 8768c02 commit b8b84be
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
8 changes: 7 additions & 1 deletion frontend/src/utils/og.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ export const createDetailPageMeta = ({
isSensitive: boolean
}) => {
const head: { meta: Meta } = { meta: [] }
const meta: Meta = []
const meta: Meta = [
{
key: "robots",
name: "robots",
content: "all",
},
]
if (title) {
meta.push({
key: "og:title",
Expand Down
22 changes: 11 additions & 11 deletions frontend/test/playwright/e2e/seo.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { preparePageForTests } from "~~/test/playwright/utils/navigation"
test.describe.configure({ mode: "parallel" })
const DESCRIPTION =
"Search over 800 million free and openly licensed images, photos, audio, and other media types for reuse and remixing."
const ROBOTS = "noindex, nofollow"
const NO_INDEX = "noindex, nofollow"
const DEFAULT_IMAGE = "/openverse-default.jpg"

const pages = {
Expand All @@ -14,28 +14,28 @@ const pages = {
title: "Openly Licensed Images, Audio and More | Openverse",
ogImage: DEFAULT_IMAGE,
ogTitle: "Openverse",
robots: ROBOTS,
robots: NO_INDEX,
},
allSearch: {
url: "/search/?q=birds",
title: "birds | Openverse",
ogImage: DEFAULT_IMAGE,
ogTitle: "Openverse",
robots: ROBOTS,
robots: NO_INDEX,
},
imageSearch: {
url: "/search/image?q=birds",
title: "birds | Openverse",
ogImage: DEFAULT_IMAGE,
ogTitle: "Openverse",
robots: ROBOTS,
robots: NO_INDEX,
},
audioSearch: {
url: "/search/audio?q=birds",
title: "birds | Openverse",
ogImage: DEFAULT_IMAGE,
ogTitle: "Openverse",
robots: ROBOTS,
robots: NO_INDEX,
},
imageDetail: {
url: "/image/da5cb478-c093-4d62-b721-cda18797e3fb",
Expand All @@ -44,7 +44,7 @@ const pages = {
"/v1/images/da5cb478-c093-4d62-b721-cda18797e3fb/thumb/"
),
ogTitle: "bird",
robots: ROBOTS,
robots: "all",
},
audioDetail: {
url: "/audio/7e063ee6-343f-48e4-a4a5-f436393730f6",
Expand All @@ -53,35 +53,35 @@ const pages = {
"/v1/audio/7e063ee6-343f-48e4-a4a5-f436393730f6/thumb/"
),
ogTitle: "I Love My Dog You Love your Cat",
robots: ROBOTS,
robots: "all",
},
about: {
url: "/about",
title: "About Openverse | Openverse",
ogImage: DEFAULT_IMAGE,
ogTitle: "Openverse",
robots: ROBOTS,
robots: NO_INDEX,
},
tag: {
url: "/image/collection?tag=cat",
title: "cat images | Openverse",
ogImage: DEFAULT_IMAGE,
ogTitle: "cat images | Openverse",
robots: ROBOTS,
robots: NO_INDEX,
},
source: {
url: "/image/collection?source=flickr",
title: "Flickr images | Openverse",
ogImage: DEFAULT_IMAGE,
ogTitle: "Flickr images | Openverse",
robots: ROBOTS,
robots: NO_INDEX,
},
creator: {
url: "/image/collection?source=flickr&creator=strogoscope",
title: "strogoscope | Openverse",
ogImage: DEFAULT_IMAGE,
ogTitle: "strogoscope | Openverse",
robots: ROBOTS,
robots: NO_INDEX,
},
}
test.describe("page metadata", () => {
Expand Down

0 comments on commit b8b84be

Please sign in to comment.