Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const RenderMd = require('./md-render.js')
const Logger = require('./logger.js')
const CONFIG = require('./config.js')

const { getSlugger, renderTemplate, getRelativeRootFromPage, relFromSource, bsToFs } = require('./utility.js')
const { getSlugger, renderTemplate, getRelativeRootFromPage, relFromSource, bsToFs, pageUrlFunc } = require('./utility.js')

// Used for saving build information from other files
global.BuildInfo = { }
Expand All @@ -47,6 +47,7 @@ module.exports = () => {
// Build Each File
.pipe(Through2.obj((file, _, cb) => {
let pageId = relFromSource(file.path)
let pageUrl = pageUrlFunc(file.path)
console.time(pageId.green)

let pageFM = FrontMatter(file.contents.toString())
Expand Down Expand Up @@ -79,6 +80,7 @@ module.exports = () => {
page_title: pageTitle,
page_content: pageHtml,
page_path: pageId,
page_url: pageUrl,
root_dir: relPath,
getting_started_toc: masterToc.make(file.path, relPath, "getting_started_toc"),
the_fundamentals_toc: masterToc.make(file.path, relPath, "the_fundamentals_toc"),
Expand Down
8 changes: 7 additions & 1 deletion scripts/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,10 @@ const getSlugger = () => {

const relFromSource = (p) => Path.relative(CONFIG.sourceDir, p)

module.exports = { dirDepth, bsToFs, renderTemplate, getSlugger, getRelativeRootFromPage, relFromSource }
const pageUrlFunc = (p) => {
var str = Path.relative(CONFIG.sourceDir, p);
var new_url = str.replace('.md', '.html');
return new_url;
}

module.exports = { dirDepth, bsToFs, renderTemplate, getSlugger, getRelativeRootFromPage, relFromSource, pageUrlFunc }
2 changes: 2 additions & 0 deletions theme/doc-page-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

<title>{{page_title}} — ExpressionEngine {{current_version}} Documentation</title>

<link rel="canonical" href="https://docs.expressionengine.com/latest/{{page_url}}" />

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3" />

<link rel="stylesheet" href="{{root_dir}}_assets/default.min.css?v=3">
Expand Down