mirror of
https://github.com/tcsenpai/obsidiangarden_netlify.git
synced 2025-06-06 04:35:20 +00:00
Use dghomelink as toggle for navbar
This commit is contained in:
parent
eee9e9aa5f
commit
9f477fb3ab
@ -1,10 +1,18 @@
|
||||
<nav class="navbar">
|
||||
<div class="navbar-inner">
|
||||
<a href="/" style="text-decoration: none;">
|
||||
<h1>{{meta.siteName}}</h1>
|
||||
</a>
|
||||
{%if settings.dgHomeLink === true%}
|
||||
<nav class="navbar">
|
||||
<div class="navbar-inner">
|
||||
<a href="/" style="text-decoration: none;">
|
||||
<h1>{{meta.siteName}}</h1>
|
||||
</a>
|
||||
</div>
|
||||
{% if settings.dgEnableSearch === true%}
|
||||
{% include "components/searchButton.njk" %}
|
||||
{%endif%}
|
||||
</nav>
|
||||
{%else%}
|
||||
<div class="empty-navbar" >
|
||||
{% if settings.dgEnableSearch === true%}
|
||||
{% include "components/searchButton.njk" %}
|
||||
{%endif%}
|
||||
</div>
|
||||
{% if settings.dgEnableSearch === true%}
|
||||
{% include "components/searchButton.njk" %}
|
||||
{%endif%}
|
||||
</nav>
|
||||
{%endif%}
|
@ -1,20 +1,23 @@
|
||||
require("dotenv").config()
|
||||
const lunrjs = require('lunr');
|
||||
const path = require('path');
|
||||
|
||||
function createIndex(posts) {
|
||||
return lunrjs(function() {
|
||||
return lunrjs(function () {
|
||||
this.ref('id');
|
||||
this.field('title');
|
||||
this.field('content');
|
||||
this.field('date');
|
||||
|
||||
posts.forEach((p,idx) => {
|
||||
posts.forEach((p, idx) => {
|
||||
p.id = idx;
|
||||
this.add(p);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
const data = require('../../netlify/functions/search/data.json');
|
||||
const index = createIndex(data);
|
||||
require('fs').writeFileSync(path.join(__dirname, '../../netlify/functions/search/index.json'), JSON.stringify(index));
|
||||
if (process.env.dgEnableSearch) {
|
||||
const data = require('../../netlify/functions/search/data.json');
|
||||
const index = createIndex(data);
|
||||
require('fs').writeFileSync(path.join(__dirname, '../../netlify/functions/search/index.json'), JSON.stringify(index));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user