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()
|
||||
let result = searcher.search(query)
|
||||
const newpage = query.replace(' ', '_')
|
||||
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');
|
||||
autocomplete.innerHTML = rendered;
|
||||
}, 500)
|
||||
|
|
|
@ -259,6 +259,7 @@
|
|||
[[#results]]
|
||||
<li><a href="/[[ref]]">[[title]]</a></li>
|
||||
[[/results]]
|
||||
<ll><a href="/edit/[[page]]">Create a page</a></ll>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
|
Loading…
Reference in New Issue
Block a user