| | |
| | | } |
| | | |
| | | const redir = (id, term) => { |
| | | window.location.href = "{{.Site.BaseURL}}" + `${id}#:~:text=${encodeURIComponent(term)}` |
| | | window.location.href = "{{.Site.BaseURL}}" + `${id.toLowerCase()}#:~:text=${encodeURIComponent(term)}` |
| | | } |
| | | |
| | | const fetch = id => ({ |
| | |
| | | return [...results[0].result] |
| | | } |
| | | } |
| | | const allIds = [...getByField('title'), ...getByField('content')] |
| | | const finalResults = allIds.map(fetch) |
| | | const allIds = new Set([...getByField('title'), ...getByField('content')]) |
| | | const finalResults = [...allIds].map(fetch) |
| | | |
| | | // display |
| | | if (finalResults.length === 0) { |
| | |
| | | }) |
| | | }) |
| | | |
| | | </script> |
| | | </script> |