ZCU-PUB/Add a configurable noindex meta tag for item pages - #1410
Open
milanmajchrak wants to merge 1 commit into
Open
ZCU-PUB/Add a configurable noindex meta tag for item pages#1410milanmajchrak wants to merge 1 commit into
milanmajchrak wants to merge 1 commit into
Conversation
Adds item.noIndex - a list of item uuids or handles whose item page gets <meta name="robots" content="noindex, noarchive"> and has its citation_pdf_url dropped. Non-discoverable items get the tag too. Server-side rendered, so crawlers see the tag in the first HTML response. Emitted via addMetaTag() so clearMetaTags() removes it on the next route change instead of leaking it onto every page visited afterwards. No nofollow: crawlers should keep following bitstream links to pick up the X-Robots-Tag served for the files. Ships with an empty list on purpose - this config is transferred to the browser unsanitized, so entries would be publicly readable in every page's HTML. Guards on Array.isArray() because a misconfigured scalar would otherwise throw from the first statement of setDSOMetaTags() and strip the meta tags off every page. Tests: metadata.service.spec.ts 31 SUCCESS (19 existing + 12 new); reverting the production change turns 6 of them red. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
milanmajchrak
force-pushed
the
zcu-pub/fe-noindex-meta-tag
branch
from
July 30, 2026 11:39
71d7f3c to
36056a8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 1 of dataquest-dev/dspace-customers#851
Adds
item.noIndex— a list of item uuids or handles whose item page gets<meta name="robots" content="noindex, noarchive">and has itscitation_pdf_urldropped.Non-discoverable items get the tag too. Handle URLs, casing and whitespace are normalized.
addMetaTag(), soclearMetaTags()removes it on the next route change instead ofleaking the noindex onto every page visited afterwards. A spec asserts the store dispatch.
nofollow: crawlers should keep following bitstream links to pick up theX-Robots-Tagserved for the files themselves.
Ships with an empty list. This config is transferred to the browser unsanitized
(
server-init.service.tssaveAppConfigForCSR), so entries would be publicly readable in everypage's HTML — i.e. it would publish which items were suppressed. The two items from the issue are
handled by the nginx counterpart instead, which is needed for the PDFs anyway. Use the list only
where publishing the identifiers is fine.
Guards on
Array.isArray()andtypeof id === 'string': a scalarnoIndex: 123456789/42passes alengthcheck and would then throw from the first statement ofsetDSOMetaTags(), stripping thetitle, description and all
citation_*tags off every page in the repository.Tests
metadata.service.spec.ts— 31 SUCCESS (19 existing + 12 new). Reverting the production changeturns 6 of them red, so they are load-bearing. Also green:
tsc --noEmiton app/spec/servertsconfigs,
madge --circular, eslint on all touched files, and a 64-spec regression sweep over theother
MetadataServiceconsumers.Counterpart — required
dataquest-dev/dspace-customers#857. This PR covers landing pages only; a PDF cannot carry a
<meta>tag, so the files need theX-Robots-Tagheader.Deploy
config.ymlis baked into the image, so this needs a rebuild and redeploy ofcustomer-zcu-pub—which will also release #1390, #1401 and #1403. Verify repeatedly after the restart: pm2 runs 9
workers, each with its own bot cache.
Not covered here
noindexwaits for a recrawl.GSC is per-property, so
naos-be.zcu.czneeds its own or the file URLs cannot be removed.robots.txt Disallowas a substitute: it blocks the crawl that delivers thenoindex, freezing existing index entries.Disallow: /handleis already there and worthchecking in GSC — it prevents already-indexed
/handle/URLs from ever being cleaned.noindexis not access control.🤖 Generated with Claude Code