Repository navigation
Mark the generated deploy site unlisted when a publication is - #1273
Open
oscarlevin wants to merge 1 commit into
Open
oscarlevin wants to merge 1 commit into
oscarlevin wants to merge 1 commit into
Conversation
When the publication file of any deployed target sets html/@unlisted="yes", the landing site Pelican generates on deploy carries the same robots meta element core puts on the pages of an unlisted publication. A custom site can override this with ptx-unlisted in site.ptx. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Companion to PreTeXtBook/pretext#3339, which adds
html/@unlistedto the publication file. Withunlisted="yes", core puts<meta name="robots" content="noindex, nofollow, noai, noimageai">on every page it writes.This PR repeats that request on the landing site the CLI generates with Pelican during
pretext deploy.Target.publication_unlisted()reads/publication/html/@unlistedstraight from the target's publication file, aspublication_csl_settings()does. No publisher-variable report is needed.stage_deployment()setsPTX_UNLISTED = "yes". The landing page links to every target, so leaving it listed would lead crawlers straight to the unlisted one. The log names the target that caused it.base.htmlemits the robots meta element whenPTX_UNLISTED == "yes". Article and page templates inherit it throughsuper().<ptx-unlisted>yes|no</ptx-unlisted>insite.ptx(orPTX_UNLISTEDinsite.json), which wins over the publication files.robots.txt: on GitHub Pages project sites the staged folder isn't the site root.Dependency on core
The CLI code doesn't call core for this; it only reads an attribute. But until
CORE_COMMITis bumped to a commit containing PreTeXtBook/pretext#3339:unlisted, so publication-file validation will flag it;It's best merged together with, or after, that core bump.
Tests
test_stage_unlisted_siteintests/test_project.pystages a Pelican site forunlisted="yes","no", and an unset attribute, and checks for the meta element. It's skipped when Pelican isn't installed.🤖 Generated with Claude Code