A development host is kept out of search engines without IAPL_NOINDEX (developmentNoindex, default on)
Separate from the mail rule so that it can be taken or left. A site whose address matches
iapl({ developmentHosts }) - built in: *.dev.netscale.pl - is noindex with no env: robots.txt disallows
everything, pages carry noindex, IndexNow sends nothing, buildSecurityHeaders() adds X-Robots-Tag. Nothing
kept a development copy out of search engines until now unless somebody set the variable.
- iapl({ developmentNoindex: false }) switches it off for the project, IAPL_NOINDEX=0 for one environment
- buildSecurityHeaders({ developmentHosts, serverUrl }): next.config runs before the plugin
- the mail rule keeps its own two signals: the development pattern, and the variable itself
- changelog "what changes on upgrade", deployment.md, security.md, AGENT.md, skills
Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.2
parent
14abf369da
commit
bc3aac249f
@@ -42,3 +42,21 @@ export function matchDevelopmentHost(host: null | string | undefined, patterns:
|
||||
/** Is `host` a development address (`matchDevelopmentHost` as a yes or no)? */
|
||||
export const isDevelopmentHost = (host: null | string | undefined, patterns: readonly string[] = DEFAULT_DEVELOPMENT_HOSTS): boolean =>
|
||||
matchDevelopmentHost(host, patterns) !== null
|
||||
|
||||
// What `iapl({ developmentHosts, developmentNoindex })` set for this process — read by the helpers that run
|
||||
// without a Payload config at hand (robots, metadata, IndexNow). `next.config` runs before the plugin: there,
|
||||
// `buildSecurityHeaders({ developmentHosts })` takes the same list when the project changed it.
|
||||
let configured: { hosts?: readonly string[]; noindex?: boolean } = {}
|
||||
|
||||
/** Called by the plugin with its options; a later call replaces the earlier one. */
|
||||
export function configureDevelopmentHosts(options: { hosts?: readonly string[]; noindex?: boolean } = {}): void {
|
||||
configured = { ...(options.hosts ? { hosts: [...options.hosts] } : {}), ...(options.noindex === false ? { noindex: false } : {}) }
|
||||
}
|
||||
|
||||
/**
|
||||
* The patterns whose hosts are kept out of search engines by default: the plugin's development hosts, or
|
||||
* `false` when the project switched that off (`iapl({ developmentNoindex: false })`).
|
||||
*/
|
||||
export function noindexDevelopmentHosts(): false | readonly string[] {
|
||||
return configured.noindex === false ? false : (configured.hosts ?? DEFAULT_DEVELOPMENT_HOSTS)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user