From c3d1e8e4b593b7a1b8a67c2510e68191733cce41 Mon Sep 17 00:00:00 2001 From: Valeri Karpov Date: Thu, 27 Apr 2023 12:44:54 -0400 Subject: [PATCH] docs: avoid using versioned path for wrapMarkdown() JS files --- scripts/website.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/website.js b/scripts/website.js index 0ef9598c708..ec650659034 100644 --- a/scripts/website.js +++ b/scripts/website.js @@ -235,18 +235,18 @@ const files = Object.keys(docsFilemap.fileMap); // api explicitly imported for specific file loading const apiReq = require('../docs/source/api'); -const wrapMarkdown = (md, baseLayout) => ` +const wrapMarkdown = (md, baseLayout, versionedPath) => ` extends ${baseLayout} append style - link(rel="stylesheet", href="#{versions.versionedPath}/docs/css/inlinecpc.css") - script(type="text/javascript" src="#{versions.versionedPath}/docs/js/native.js") + link(rel="stylesheet", href="${versionedPath}/docs/css/inlinecpc.css") + script(type="text/javascript" src="${versionedPath}/docs/js/native.js") style. p { line-height: 1.5em } block content - + :markdown ${md.split('\n').map(line => ' ' + line).join('\n')} @@ -364,7 +364,11 @@ async function pugify(filename, options, isReload = false) { const lines = contents.split('\n'); lines.splice(2, 0, cpc); contents = lines.join('\n'); - contents = wrapMarkdown(contents, path.relative(path.dirname(filename), path.join(cwd, 'docs/layout'))); + contents = wrapMarkdown( + contents, + path.relative(path.dirname(filename), path.join(cwd, 'docs/layout')), + versionObj.versionedPath + ); newfile = filename.replace('.md', '.html'); }