Skip to content
Merged
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
5 changes: 0 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"cheerio": "^0.22.0",
"chokidar": "^3.3.0",
"commander": "^3.0.2",
"ejs": "^3.0.1",
"fastmatter": "^2.1.1",
"figlet": "^1.2.4",
"find-up": "^4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Page.js
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ Page.prototype.generate = function (builtFiles) {
this.buildPageNav();

return fs.outputFileAsync(this.resultPath, htmlBeautify(
this.template(this.prepareTemplateData()),
this.template.render(this.prepareTemplateData()),
{ indent_size: 2 },
));
})
Expand Down
4 changes: 2 additions & 2 deletions src/Site.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const cheerio = require('cheerio');
const ejs = require('ejs');
Comment thread
yamgent marked this conversation as resolved.
const fs = require('fs-extra-promise');
const ghpages = require('gh-pages');
const ignore = require('ignore');
Expand Down Expand Up @@ -112,7 +111,8 @@ function Site(rootPath, outputPath, onePagePath, forceReload = false, siteConfig

// Page template path
this.pageTemplatePath = path.join(__dirname, PAGE_TEMPLATE_NAME);
this.pageTemplate = ejs.compile(fs.readFileSync(this.pageTemplatePath, 'utf8'));
const env = nunjucks.configure({ autoescape: false });
this.pageTemplate = nunjucks.compile(fs.readFileSync(this.pageTemplatePath, 'utf8'), env);
this.pages = [];

// Other properties
Expand Down
2 changes: 1 addition & 1 deletion src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ module.exports = {
FOOTER_PATH: '_markbind/footers/footer.md',
INDEX_MARKDOWN_FILE: 'index.md',
MARKBIND_PLUGIN_PREFIX: 'markbind-plugin-',
PAGE_TEMPLATE_NAME: 'page.ejs',
PAGE_TEMPLATE_NAME: 'page.njk',
PROJECT_PLUGIN_FOLDER_NAME: '_markbind/plugins',
SITE_CONFIG_NAME: 'site.json',
SITE_DATA_NAME: 'siteData.json',
Expand Down
59 changes: 0 additions & 59 deletions src/page.ejs

This file was deleted.

68 changes: 68 additions & 0 deletions src/page.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<!DOCTYPE html>
<html>
<head>
{{ headFileTopContent }}
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="{{ markBindVersion }}">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ title }}</title>
<link rel="stylesheet" href="{{ asset.bootstrap }}">
<link rel="stylesheet" href="{{ asset.bootstrapVue }}">
<link rel="stylesheet" href="{{ asset.fontAwesome }}">
<link rel="stylesheet" href="{{ asset.glyphicons }}">
<link rel="stylesheet" href="{{ asset.highlight }}">
<link rel="stylesheet" href="{{ asset.markbind }}">
{%- if asset.pluginLinks %}
{%- for link in asset.pluginLinks %}
{{ link }}
{%- endfor %}
{%- endif %}
<link rel="stylesheet" href="{{ asset.layoutStyle }}">
{%- if siteNav %}
<link rel="stylesheet" href="{{ asset.siteNavCss }}">
{%- endif %}
{%- if pageNav %}
<link rel="stylesheet" href="{{ asset.pageNavCss }}">
{%- endif %}
{{ headFileBottomContent }}
{%- if faviconUrl %}
<link rel="icon" href="{{ faviconUrl }}">
{%- endif %}
</head>
<body {% if pageNav %} data-spy="scroll" data-target="#page-nav" data-offset="100" {% endif %}>
<div id="app">
{{ headerHtml }}
<div id="flex-body">
{{ siteNavHtml }}
{{ content }}
{{ pageNavHtml }}
</div>
{{ footerHtml }}
</div>
</body>
<script src="{{ asset.vue }}"></script>
<script src="{{ asset.vueStrap }}"></script>
<script src="{{ asset.bootstrapUtilityJs }}"></script>
<script src="{{ asset.polyfillJs }}"></script>
<script src="{{ asset.bootstrapVueJs }}"></script>
<script>
const baseUrl = '{{ baseUrl }}'
const enableSearch = {{ enableSearch }}
</script>
<script src="{{ asset.setup }}"></script>

{%- if asset.externalScripts %}
{%- for script in asset.externalScripts %}
<script src="{{ script }}"></script>
{%- endfor %}
{%- endif %}

{%- if asset.pluginScripts %}
{%- for script in asset.pluginScripts %}
{{ script }}
{%- endfor %}
{%- endif %}

<script src="{{ asset.layoutScript }}"></script>
</html>
Loading