Fixes from the reference site: 404 page unlisted, own-origin media, fillGlobal defaults, switcher docs
- sitemap, llms.txt and the site index leave out the page assigned as the 404 page (unlistedPageIds, exported); it stays when it is also the homepage - buildImagesConfig: in production with R2_PUBLIC_URL empty, allow the site's own /api/media/file/** so next/image no longer answers 400 - fillGlobal: a choice field (select, radio, checkbox, number, date) still at its defaultValue counts as empty; text is never overwritten - docs: LanguageSwitcher renderLabel needs a 'use client' wrapper (i18n.md, ipal-site, ipal-setup, api.md) Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
d992d131a2
commit
3645e61f7d
@@ -6,6 +6,7 @@ import type { I18nConfig } from '../i18n/index.js'
|
||||
import { archiveFieldName } from '../content/index.js'
|
||||
import { buildLocalizedPath, getLocaleCodes, isValidLocale } from '../i18n/index.js'
|
||||
import { resolveLocalized } from '../i18n/resolveLocalized.js'
|
||||
import { unlistedPageIds } from '../pages/unlistedPages.js'
|
||||
|
||||
/** One public, indexable document in one language. */
|
||||
export type SiteIndexEntry = {
|
||||
@@ -154,6 +155,7 @@ export async function collectSiteIndex({
|
||||
}
|
||||
|
||||
const entries: SiteIndexEntry[] = []
|
||||
const unlisted = unlistedPageIds(settings)
|
||||
for (const locale of wanted) {
|
||||
for (const { slug: collection, prefix } of collections) {
|
||||
// An archive collection without an archive page in this locale has no URLs there.
|
||||
@@ -170,6 +172,7 @@ export async function collectSiteIndex({
|
||||
for (const doc of docs) {
|
||||
if (doc._status && doc._status !== 'published') {continue}
|
||||
if (doc.noindex || doc.meta?.noindex) {continue}
|
||||
if (collection === pagesSlug && unlisted.has(doc.id)) {continue}
|
||||
const title = typeof doc.title === 'string' ? doc.title.trim() : ''
|
||||
const slug = typeof doc.slug === 'string' ? doc.slug : ''
|
||||
if (!title || !slug || EXCLUDED_SLUGS.has(slug)) {continue}
|
||||
|
||||
Reference in New Issue
Block a user