mirror of
https://github.com/thangisme/notes.git
synced 2025-01-03 03:36:34 -05:00
commit
850a8fe256
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,4 +4,3 @@
|
|||||||
_site
|
_site
|
||||||
Gemfile.lock
|
Gemfile.lock
|
||||||
node_modules
|
node_modules
|
||||||
.jekyll-metadata
|
|
||||||
|
@ -27,6 +27,11 @@ exclude: ["node_modules/", "*.gemspec", "*.gem", "Gemfile", "Gemfile.lock", "pac
|
|||||||
# Enable or disable the site search
|
# Enable or disable the site search
|
||||||
search_enabled: true
|
search_enabled: true
|
||||||
|
|
||||||
|
# Set the search token separator
|
||||||
|
search_tokenizer_separator: /[\s\-/]+/
|
||||||
|
# For hyphenated-word search:
|
||||||
|
# search_tokenizer_separator: /[\s/]+/
|
||||||
|
|
||||||
# Enable or disable heading anchors
|
# Enable or disable heading anchors
|
||||||
heading_anchors: true
|
heading_anchors: true
|
||||||
|
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
<a href="{{ node.url | absolute_url }}" class="navigation-list-link{% if page.url == node.url %} active{% endif %}">{{ node.title }}</a>
|
<a href="{{ node.url | absolute_url }}" class="navigation-list-link{% if page.url == node.url %} active{% endif %}">{{ node.title }}</a>
|
||||||
{%- if node.has_children -%}
|
{%- if node.has_children -%}
|
||||||
{%- if page.url == node.url or page.parent == node.title or page.grand_parent == node.title -%}
|
|
||||||
{%- assign children_list = site.html_pages | where: "parent", node.title | sort:"nav_order" -%}
|
{%- assign children_list = site.html_pages | where: "parent", node.title | sort:"nav_order" -%}
|
||||||
<ul class="navigation-list-child-list ">
|
<ul class="navigation-list-child-list ">
|
||||||
{%- for child in children_list -%}
|
{%- for child in children_list -%}
|
||||||
@ -20,7 +19,6 @@
|
|||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
<a href="{{ child.url | absolute_url }}" class="navigation-list-link{% if page.url == child.url %} active{% endif %}">{{ child.title }}</a>
|
<a href="{{ child.url | absolute_url }}" class="navigation-list-link{% if page.url == child.url %} active{% endif %}">{{ child.title }}</a>
|
||||||
{%- if child.has_children -%}
|
{%- if child.has_children -%}
|
||||||
{%- if page.url == child.url or page.parent == child.title -%}
|
|
||||||
{%- assign grand_children_list = site.html_pages | where: "parent", child.title | sort:"nav_order" -%}
|
{%- assign grand_children_list = site.html_pages | where: "parent", child.title | sort:"nav_order" -%}
|
||||||
<ul class="navigation-list-child-list">
|
<ul class="navigation-list-child-list">
|
||||||
{%- for grand_child in grand_children_list -%}
|
{%- for grand_child in grand_children_list -%}
|
||||||
@ -30,12 +28,10 @@
|
|||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
</ul>
|
</ul>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
{%- endif -%}
|
|
||||||
</li>
|
</li>
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
</ul>
|
</ul>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
{%- endif -%}
|
|
||||||
</li>
|
</li>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
{%- endunless -%}
|
{%- endunless -%}
|
||||||
|
@ -53,7 +53,12 @@ function initSearch() {
|
|||||||
// Success!
|
// Success!
|
||||||
var data = JSON.parse(request.responseText);
|
var data = JSON.parse(request.responseText);
|
||||||
|
|
||||||
|
{% if site.search_tokenizer_separator != nil %}
|
||||||
|
lunr.tokenizer.separator = {{ site.search_tokenizer_separator }}
|
||||||
|
{% else %}
|
||||||
lunr.tokenizer.separator = /[\s\-/]+/
|
lunr.tokenizer.separator = /[\s\-/]+/
|
||||||
|
{% end %}
|
||||||
|
|
||||||
var index = lunr(function () {
|
var index = lunr(function () {
|
||||||
this.ref('id');
|
this.ref('id');
|
||||||
this.field('title', { boost: 200 });
|
this.field('title', { boost: 200 });
|
||||||
|
@ -35,6 +35,10 @@ logo: "/assets/images/just-the-docs.png"
|
|||||||
# Enable or disable the site search
|
# Enable or disable the site search
|
||||||
# Supports true (default) or false
|
# Supports true (default) or false
|
||||||
search_enabled: true
|
search_enabled: true
|
||||||
|
|
||||||
|
# Enable support for hyphenated search words:
|
||||||
|
search_tokenizer_separator: /[\s/]+/
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Aux links
|
## Aux links
|
||||||
|
@ -59,6 +59,15 @@ In your site's `_config.yml`, enable search:
|
|||||||
search_enabled: true
|
search_enabled: true
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The default is for hyphens to separate tokens in search terms:
|
||||||
|
`gem-based` is equivalent to `gem based`, matching either word.
|
||||||
|
To allow search for hyphenated words:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# Set the search token separator
|
||||||
|
search_tokenizer_separator: /[\s/]+/
|
||||||
|
```
|
||||||
|
|
||||||
## Hiding pages from search
|
## Hiding pages from search
|
||||||
|
|
||||||
Sometimes you might have a page that you don't want to be indexed for the search nor to show up in search results, e.g, a 404 page. To exclude a page from search, add the `search_exclude: true` parameter to the page's YAML front matter:
|
Sometimes you might have a page that you don't want to be indexed for the search nor to show up in search results, e.g, a 404 page. To exclude a page from search, add the `search_exclude: true` parameter to the page's YAML front matter:
|
||||||
|
Loading…
Reference in New Issue
Block a user