Skip to content

Commit

Permalink
✨ Remove empty navbar from DOM
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Jan 23, 2020
1 parent c200ce5 commit c1f9f8a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@staart/site",
"version": "1.12.7",
"version": "1.12.8",
"module": "dist/module.js",
"main": "dist/index.js",
"bin": "./dist/index.js",
Expand Down
1 change: 1 addition & 0 deletions src/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ const generatePage = async (path: string, content: string) => {
)
data[key] = await render(data[key], key !== "content");
}
if (!data.navBar) delete data.navBar;
data.css = await getCss();
data.script = await getScript();
const result = template(data);
Expand Down
4 changes: 2 additions & 2 deletions src/templates/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ <h1>{{ title }}</h1>
</a>
</div>
</div>
<nav>
{{#if navBar}}<nav>
<div class="container">
{{{ navBar }}}
</div>
</nav>
</nav>{{/if}}
</header>

0 comments on commit c1f9f8a

Please sign in to comment.