-
The statically generated site currently does not currently offer search functionality. Whilst we could rely to a degree on search engines to index the Apertis website (for example by using the provided integration of Google Custom Search Engine) but it is expected that the website will be used as the basis for more taylored sites by users of Apertis that may be implemented out of the reach of the search engines indexing and thus localised search is required. Remove the Google search integration in the theme and instead integrate local search based on the approach documented here: https://gist.github.com/eddiewebb/735feb48f50f0ddd65ae5606a1cb41ae#layouts_defaultsearchhtml Signed-off-by:
Martyn Welch <martyn.welch@collabora.com>
The statically generated site currently does not currently offer search functionality. Whilst we could rely to a degree on search engines to index the Apertis website (for example by using the provided integration of Google Custom Search Engine) but it is expected that the website will be used as the basis for more taylored sites by users of Apertis that may be implemented out of the reach of the search engines indexing and thus localised search is required. Remove the Google search integration in the theme and instead integrate local search based on the approach documented here: https://gist.github.com/eddiewebb/735feb48f50f0ddd65ae5606a1cb41ae#layouts_defaultsearchhtml Signed-off-by:
Martyn Welch <martyn.welch@collabora.com>
title: "Search Results"
sitemap:
priority : 0.1
layout: "search"
This file exists solely to respond to /search URL with the related search
layout template.
No content shown here is rendered, all content is based in the template layouts/page/search.html
Setting a very low sitemap priority will tell search engines this is not important content.
This implementation uses Fusejs, jquery and mark.js
Initial setup
Search depends on additional output content type of JSON in config.toml ``` [outputs] home = ["HTML", "JSON"] ```
Searching additional fileds
To search additional fields defined in front matter, you must add it in 2 places.
Edit layouts/_default/index.JSON
This exposes the values in /index.json
i.e. add category
```
...
"contents":{{ .Content | plainify | jsonify }}
{{ if .Params.tags }},
"tags":{{ .Params.tags | jsonify }}{{end}},
"categories" : {{ .Params.categories | jsonify }},
...
```
Edit fuse.js options to Search
static/js/search.js
```
keys: [
"title",
"contents",
"tags",
"categories"
]
```