mirror of
https://github.com/LukeSmithxyz/based.cooking.git
synced 2025-02-17 09:45:16 +00:00
Merge branch 'dosisod-use-html-data-attribs'
This commit is contained in:
commit
eadba0b80b
@ -35,8 +35,8 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
|
||||
// for each recipe hide all but matched
|
||||
recipes.forEach(recipe => {
|
||||
const recipeName = recipe.textContent.toLowerCase();
|
||||
const isMatch = searchTerms.every(term => recipeName.includes(term));
|
||||
const searchString = `${recipe.textContent} ${recipe.dataset.tags}`.toLowerCase();
|
||||
const isMatch = searchTerms.every(term => searchString.includes(term));
|
||||
|
||||
recipe.hidden = !isMatch;
|
||||
recipe.classList.toggle("matched-recipe", hasFilter && isMatch);
|
||||
|
@ -1,5 +1,5 @@
|
||||
<ul id=artlist>
|
||||
{{range.Site.RegularPages}}
|
||||
<li><a href="{{.Permalink}}">{{.Title}}<span style="display:none">{{.Params.Tags}}</span></a></li>
|
||||
<li data-tags="{{.Params.Tags}}"><a href="{{.Permalink}}">{{.Title}}</a></li>
|
||||
{{end}}
|
||||
</ul>
|
||||
|
Loading…
x
Reference in New Issue
Block a user