Create a new page based on search
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
38764b278a
commit
f96bf8e8f8
|
@ -111,8 +111,9 @@ search(searchInput).then(searcher => {
|
||||||
}
|
}
|
||||||
$('#autocomplete').show()
|
$('#autocomplete').show()
|
||||||
let result = searcher.search(query)
|
let result = searcher.search(query)
|
||||||
|
const newpage = query.replace(' ', '_')
|
||||||
var template = document.getElementById('result-template').innerHTML;
|
var template = document.getElementById('result-template').innerHTML;
|
||||||
var rendered = Mustache.render(template, {results: result}, {}, ['[[', ']]']);
|
var rendered = Mustache.render(template, {page: newpage, results: result}, {}, ['[[', ']]']);
|
||||||
let autocomplete = document.getElementById('autocomplete');
|
let autocomplete = document.getElementById('autocomplete');
|
||||||
autocomplete.innerHTML = rendered;
|
autocomplete.innerHTML = rendered;
|
||||||
}, 500)
|
}, 500)
|
||||||
|
|
|
@ -259,6 +259,7 @@
|
||||||
[[#results]]
|
[[#results]]
|
||||||
<li><a href="/[[ref]]">[[title]]</a></li>
|
<li><a href="/[[ref]]">[[title]]</a></li>
|
||||||
[[/results]]
|
[[/results]]
|
||||||
|
<ll><a href="/edit/[[page]]">Create a page</a></ll>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user