Skip to content

Commit

Permalink
adding kiwixAPI to each article
Browse files Browse the repository at this point in the history
  • Loading branch information
bakshiutkarsha committed Aug 19, 2020
1 parent 5a1d86c commit 72b6273
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
File renamed without changes.
12 changes: 6 additions & 6 deletions src/util/saveArticles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -797,16 +797,16 @@ async function templateArticle(parsoidDoc: DominoElement, moduleDependencies: an
styleDependenciesList: string[],
};

const jsDependencies = jsDependenciesList.length !== 0
? jsDependenciesList.map((oneJsDep) => genHeaderScript(config, oneJsDep, articleId)) : []

jsDependencies.push(genHeaderScript(config, 'kiwixAPI.js', articleId));

const htmlTemplateDoc = domino.createDocument(
htmlTemplateCode(articleId)
.replace('__ARTICLE_CANONICAL_LINK__', genCanonicalLink(config, mw.webUrl.href, articleId))
.replace('__ARTICLE_CONFIGVARS_LIST__', jsConfigVars !== '' ? genHeaderScript(config, 'jsConfigVars', articleId) : '')
.replace(
'__ARTICLE_JS_LIST__',
jsDependenciesList.length !== 0
? jsDependenciesList.map((oneJsDep) => genHeaderScript(config, oneJsDep, articleId)).join('\n')
: '',
)
.replace('__ARTICLE_JS_LIST__', jsDependencies.join('\n'))
.replace(
'__ARTICLE_CSS_LIST__',
styleDependenciesList.length !== 0
Expand Down

0 comments on commit 72b6273

Please sign in to comment.