Skip to content

Commit

Permalink
Don't mirror 'Story' namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
kelson42 committed Oct 1, 2023
1 parent 190cd26 commit d2768ef
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/MediaWiki.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,18 +227,22 @@ class MediaWiki {
const num = entry.id
const allowedSubpages = 'subpages' in entry
const isContent = type === 'namespaces' ? !!(entry.content || util.contains(addNamespaces, num)) : !!(entry.content !== undefined || util.contains(addNamespaces, num))
const isBlacklisted = name === 'Story' // 'Story' Wikipedia namespace is content, but not indgestable by Parsoid https://github.com/openzim/mwoffliner/issues/1853
const canonical = entry.canonical ? entry.canonical : ''
const details = { num, allowedSubpages, isContent }

/* Namespaces in local language */
this.namespaces[util.lcFirst(name)] = details
this.namespaces[util.ucFirst(name)] = details

/* Namespaces in English (if available) */
if (canonical) {
this.namespaces[util.lcFirst(canonical)] = details
this.namespaces[util.ucFirst(canonical)] = details
}

/* Is content to mirror */
if (isContent) {
if (isContent && !isBlacklisted) {
this.namespacesToMirror.push(name)
}
})
Expand Down

0 comments on commit d2768ef

Please sign in to comment.