You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ZCU-PUB/Add a configurable noindex meta tag for item pages
dataquest-dev/dspace-customers#851 - ZCU was asked to keep two bachelor
theses out of search engine results while they stay fully visible and
searchable inside DSpace and on portal.zcu.cz. That is noindex, not
withdraw and not discoverable=false.
Adds a generic mechanism rather than hardcoding those items:
- item.noIndex config list of item UUIDs / handles. Handle URLs, casing and
surrounding whitespace are normalized, so 11025/9501,
http://hdl.handle.net/11025/9501 and the item uuid all match.
- A matching item, or any non-discoverable item, gets
<meta name="robots" content="noindex, noarchive">.
- No nofollow on purpose: crawlers must stay free to follow the bitstream
links so they pick up the X-Robots-Tag served for the files themselves.
- citation_pdf_url is dropped for such items, so Google Scholar is never
handed the full text. All other citation_*/dataset_* tags are kept, so
Zotero, CRIS harvesters and portal.zcu.cz keep working.
Emitted from setDSOMetaTags() via addMetaTag(), which matters twice: the tag
is server-side rendered, so a crawler sees it in the first HTML response
rather than after hydration; and it is registered in the meta tag store, so
clearMetaTags() removes it on the next route change instead of leaking the
noindex onto every subsequently visited page.
Shipped with an EMPTY list. The merged config is transferred to the browser
unsanitized (server-init.service.ts saveAppConfigForCSR), so anything listed
here becomes publicly readable in the HTML source of every page - it would
publish exactly which items were suppressed. The two #851 items are
de-indexed by the companion X-Robots-Tag nginx map in dspace-customers
instead, which is needed for the PDFs anyway.
Guards against a malformed config value: a YAML scalar (noIndex: 11025/9501)
or a numeric entry would otherwise throw from the first statement of
setDSOMetaTags() and strip the title, description and every citation_* tag
from every item, collection and community page in the repository.
Tests: metadata.service.spec.ts 31 SUCCESS (19 pre-existing + 12 new).
Verified load-bearing: reverting the production change turns 6 of them red.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments