j1-template 2023.7.0 → 2023.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_includes/themes/j1/modules/searcher/procedures/topsearch.proc +2 -1
- data/_includes/themes/j1/procedures/global/create_bs_button.proc +0 -1
- data/_includes/themes/j1/procedures/global/create_word_cloud.proc +3 -2
- data/_includes/themes/j1/procedures/global/date-german.proc +2 -7
- data/_includes/themes/j1/procedures/global/get_category.proc +13 -19
- data/_includes/themes/j1/procedures/global/get_category_item.proc +29 -33
- data/_includes/themes/j1/procedures/global/get_documents_dir.proc +8 -8
- data/_includes/themes/j1/procedures/global/get_page_url.proc +9 -14
- data/_includes/themes/j1/procedures/global/select_color.proc +12 -17
- data/_includes/themes/j1/procedures/global/select_font_size.proc +31 -35
- data/_includes/themes/j1/procedures/global/select_icon_size.proc +38 -40
- data/_includes/themes/j1/procedures/global/select_location.proc +56 -59
- data/_includes/themes/j1/procedures/global/set_base_vars_folders.proc +2 -4
- data/_includes/themes/j1/procedures/global/set_image_block.proc +4 -2
- data/_includes/themes/j1/procedures/global/setup.proc +8 -3
- data/assets/data/masonry.html +13 -13
- data/assets/themes/j1/adapter/js/j1.js +39 -39
- data/assets/themes/j1/adapter/js/masterslider.js +2 -1
- data/assets/themes/j1/adapter/js/slick.js +13 -10
- data/assets/themes/j1/adapter/js/translator.js +62 -58
- data/assets/themes/j1/core/css/themes/unolight/bootstrap.css +70 -0
- data/assets/themes/j1/core/css/themes/unolight/bootstrap.min.css +1 -1
- data/assets/themes/j1/core/js/template.js +1339 -3
- data/assets/themes/j1/core/js/template.min.js +7 -7
- data/assets/themes/j1/core/js/template.min.js.map +1 -1
- data/assets/themes/j1/modules/carousel/css/theme/uno.css +5 -0
- data/assets/themes/j1/modules/carousel/css/theme/uno.min.css +1 -1
- data/assets/themes/j1/modules/masonry/css/theme/readme +1 -0
- data/assets/themes/j1/modules/masterslider/css/theme/uno.css +2 -3
- data/assets/themes/j1/modules/masterslider/css/theme/uno.min.css +1 -1
- data/assets/themes/j1/modules/slick/lightbox/css/theme/uno.css +13 -2
- data/assets/themes/j1/modules/slick/lightbox/css/theme/uno.min.css +1 -1
- data/assets/themes/j1/modules/slick/lightbox/js/slick-lightbox.js +373 -347
- data/assets/themes/j1/modules/slick/slider/css/theme/uno.css +20 -51
- data/assets/themes/j1/modules/slick/slider/css/theme/uno.min.css +2 -2
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/Gemfile +2 -2
- data/lib/starter_web/README.md +5 -5
- data/lib/starter_web/_config.yml +1 -1
- data/lib/starter_web/_data/blocks/banner.yml +8 -9
- data/lib/starter_web/_data/blocks/footer.yml +8 -10
- data/lib/starter_web/_data/modules/masonry.yml +9 -1
- data/lib/starter_web/_data/modules/masterslider.yml +69 -116
- data/lib/starter_web/_data/modules/navigator_menu.yml +58 -51
- data/lib/starter_web/_data/resources.yml +3 -3
- data/lib/starter_web/_data/templates/feed.xml +1 -1
- data/lib/starter_web/_includes/attributes.asciidoc +1 -0
- data/lib/starter_web/_plugins/asciidoctor/callout.rb +2 -2
- data/lib/starter_web/_plugins/asciidoctor/masterslider-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/slick-block.rb +1 -1
- data/lib/starter_web/_plugins/index/lunr.rb +1 -1
- data/lib/starter_web/assets/images/collections/books/biography/a_life_in_questions.jpg +0 -0
- data/lib/starter_web/collections/posts/public/featured/_posts/0000-00-00-welcome-to-j1.adoc.erb +5 -5
- data/lib/starter_web/index.html +6 -6
- data/lib/starter_web/package.json +1 -1
- data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +0 -1
- data/lib/starter_web/pages/public/tools/previewer/preview_bootstrap_theme.adoc +148 -140
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +3 -75
- data/assets/themes/j1/modules/carousel/js/carousel.js +0 -1517
- data/assets/themes/j1/modules/carousel/js/carousel.min.js +0 -57
- data/assets/themes/j1/modules/masonry/css/theme/uno.css +0 -35
- data/assets/themes/j1/modules/masonry/css/theme/uno.min.css +0 -15
- data/assets/themes/j1/modules/speak2me/LICENSE +0 -21
- data/assets/themes/j1/modules/speak2me/js/speak2me.js +0 -947
- data/assets/themes/j1/modules/speak2me/js/speak2me.min.js +0 -26
- data/lib/starter_web/_data/modules/buymeacoffee.yml +0 -30
- data/lib/starter_web/_data/modules/defaults/buymeacoffee.yml +0 -30
- data/lib/starter_web/assets/images/modules/masterslider/slider_5/ms-free-food-restaurant-140x80.jpg +0 -0
- data/lib/starter_web/assets/images/modules/masterslider/slider_5/ms-free-food-restaurant.jpg +0 -0
- data/lib/starter_web/assets/images/modules/masterslider/slider_5/ms-free-food-single-man-140x80.jpg +0 -0
- data/lib/starter_web/assets/images/modules/masterslider/slider_5/ms-free-food-single-man.jpg +0 -0
- data/lib/starter_web/assets/images/modules/masterslider/slider_5/ms-free-food-single-woman-140x80.jpg +0 -0
- data/lib/starter_web/assets/images/modules/masterslider/slider_5/ms-free-food-single-woman.jpg +0 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/attributes.asciidoc +0 -58
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/accordion.asciidoc +0 -34
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/alerts.asciidoc +0 -15
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/badges.asciidoc +0 -9
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/body.asciidoc +0 -14
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/breadcrumbs.asciidoc +0 -14
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/buttons.asciidoc +0 -75
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/cards.asciidoc +0 -22
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/carousel.asciidoc +0 -37
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/close.asciidoc +0 -15
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/code.asciidoc +0 -14
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/color_system.asciidoc +0 -353
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/components.asciidoc +0 -69
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/dropdowns.asciidoc +0 -53
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/figures.asciidoc +0 -5
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/forms.asciidoc +0 -270
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/grid.asciidoc +0 -49
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/links.asciidoc +0 -21
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/list_groups.asciidoc +0 -28
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/modals.asciidoc +0 -43
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/navbar.asciidoc +0 -45
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/navs.asciidoc +0 -28
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/offcanvas.asciidoc +0 -16
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/options.asciidoc +0 -30
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/pagination.asciidoc +0 -40
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/paragraph.asciidoc +0 -5
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/placeholders.asciidoc +0 -5
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/popovers.asciidoc +0 -28
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/position.asciidoc +0 -8
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/progress_bars.asciidoc +0 -12
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/spacing.asciidoc +0 -14
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/spinners.asciidoc +0 -12
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/tables.asciidoc +0 -55
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/thumbnails.asciidoc +0 -9
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/toasts.asciidoc +0 -18
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/tooltips.asciidoc +0 -28
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/typography.asciidoc +0 -115
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/z_index.asciidoc +0 -26
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/tables/_table.asciidoc +0 -9
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/tables/accordion.asciidoc +0 -87
- data/lib/starter_web/pages/public/learn/bs_sass_variables/bs_sass_variables.adoc +0 -267
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/attributes.asciidoc +0 -59
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/documents/100_chapter.asciidoc +0 -541
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/documents/200_chapter.asciidoc +0 -33
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/tables/build_command_options.asciidoc +0 -72
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/tables/files_and_folders.asciidoc +0 -66
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/tables/global_configuration_options.asciidoc +0 -63
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/tables/global_variables.asciidoc +0 -26
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/tables/page_variables.asciidoc +0 -54
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/tables/serve_command_options.asciidoc +0 -45
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/tables/site_variables.asciidoc +0 -59
- data/lib/starter_web/pages/public/learn/core_web_vitals/core_web_vitals.adoc +0 -447
- data/lib/starter_web/pages/public/learn/roundtrip/lunr_search.1.asciidoc +0 -460
- data/lib/starter_web/pages/public/manuals/speak2me.adoc +0 -412
- data/lib/starter_web/pages/public/tools/cheatsheet/gem.adoc +0 -259
- data/lib/starter_web/pages/public/tools/cheatsheet/git.adoc +0 -1462
- data/lib/starter_web/pages/public/tools/cheatsheet/j1.adoc +0 -177
- data/lib/starter_web/pages/public/tools/cheatsheet/yaml.adoc +0 -522
@@ -1,460 +0,0 @@
|
|
1
|
-
---
|
2
|
-
title: Search
|
3
|
-
title_extention: Integrated site search based on Lunr for J1 Template
|
4
|
-
tagline: Lunr For J1
|
5
|
-
|
6
|
-
date: 2020-11-08
|
7
|
-
#last_modified: 2023-01-01
|
8
|
-
|
9
|
-
description: >
|
10
|
-
The search option for the J1 Template is based on the
|
11
|
-
search engine Lunr and is fully integrated with the
|
12
|
-
template system. Lunr is designed to be lightweight
|
13
|
-
yet full-featured to provide users with a great search
|
14
|
-
experience on websites.
|
15
|
-
keywords: >
|
16
|
-
open source, free, template, jekyll, jekyllone, web,
|
17
|
-
sites, static, jamstack, bootstrap,
|
18
|
-
lunr, site search, quick search, find,
|
19
|
-
google, bing
|
20
|
-
|
21
|
-
categories: [ Roundtrip ]
|
22
|
-
tags: [ Module, Site search ]
|
23
|
-
|
24
|
-
image:
|
25
|
-
path: /assets/images/modules/attics/lunr-1280x800.jpg
|
26
|
-
width: 1920
|
27
|
-
height: 1280
|
28
|
-
|
29
|
-
regenerate: false
|
30
|
-
permalink: /pages/public/learn/roundtrip/quicksearch/
|
31
|
-
|
32
|
-
resources: [ animate, clipboard, lightbox, rouge ]
|
33
|
-
resource_options:
|
34
|
-
- attic:
|
35
|
-
slides:
|
36
|
-
- url: /assets/images/modules/attics/lunr-1280x800.jpg
|
37
|
-
alt: Lunr Search Engine
|
38
|
-
---
|
39
|
-
|
40
|
-
// Page Initializer
|
41
|
-
// =============================================================================
|
42
|
-
// Enable the Liquid Preprocessor
|
43
|
-
:page-liquid:
|
44
|
-
|
45
|
-
// Set (local) page attributes here
|
46
|
-
// -----------------------------------------------------------------------------
|
47
|
-
// :page--attr: <attr-value>
|
48
|
-
|
49
|
-
// Load Liquid procedures
|
50
|
-
// -----------------------------------------------------------------------------
|
51
|
-
{% capture load_attributes %}themes/{{site.template.name}}/procedures/global/attributes_loader.proc{%endcapture%}
|
52
|
-
|
53
|
-
// Load page attributes
|
54
|
-
// -----------------------------------------------------------------------------
|
55
|
-
{% include {{load_attributes}} scope="all" %}
|
56
|
-
|
57
|
-
// Page content
|
58
|
-
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
59
|
-
[role="dropcap"]
|
60
|
-
The search option for the J1 Template is based on the search engine _Lunr_
|
61
|
-
and is fully integrated with the Template. _Lunr_ is designed to be lightweight
|
62
|
-
yet full-featured to provide users with a great search experience. Using Lunr for
|
63
|
-
a Jekyll website, there is no need to integrate complex external, server-sided
|
64
|
-
search engines like Google or Bing.
|
65
|
-
|
66
|
-
WARNING: Searching a website using the build-in search engine is different
|
67
|
-
from engines used by _Google_ or Microsoft _Bing_. Those search platforms
|
68
|
-
are using complex artificial intelligence algorithms to make sense out of
|
69
|
-
a *handful* of words given for an *Internet* search.
|
70
|
-
|
71
|
-
Nevertheless, QuickSearch, the J1 built-in implementation, is simple like
|
72
|
-
searching at _Google_ or _Bing_ but offers additional features to do searches
|
73
|
-
specifically for *local websites*. QuickSearch provides an easy-to-use
|
74
|
-
query language for better search results.
|
75
|
-
|
76
|
-
|
77
|
-
mdi:clock-time-five-outline[24px, md-gray mt-4 mr-2]
|
78
|
-
*10-15 Minutes* to read
|
79
|
-
|
80
|
-
// Include sub-documents (if any)
|
81
|
-
// -----------------------------------------------------------------------------
|
82
|
-
[role="mt-5"]
|
83
|
-
== Core concepts
|
84
|
-
|
85
|
-
Understanding some of the concepts and terminology that QuickSearch based on
|
86
|
-
_Lunr_ uses will allow users to provide powerful search functionality - to
|
87
|
-
get more relevant search results of the *current* website.
|
88
|
-
|
89
|
-
[role="mt-4"]
|
90
|
-
=== Indexing Documents
|
91
|
-
|
92
|
-
QuickSearch offers searches on *all* documents of the website generated by
|
93
|
-
the template system but only for *this* site. Advantage, no internet access
|
94
|
-
is required for *local* searches. Searches are based on a pre-build local
|
95
|
-
site *full-text* index loaded by the browser on a page request. The index
|
96
|
-
for a site is generated by the Jekyll plugin *lunr_index* `lunr_index.rb`
|
97
|
-
located in the root *_plugins* folder `/_plugins`.
|
98
|
-
|
99
|
-
The full-text index is always generated by Jekyll at *build-time*:
|
100
|
-
|
101
|
-
.Index creation at buildtime
|
102
|
-
----
|
103
|
-
Startup the site ..
|
104
|
-
Configuration file: ...
|
105
|
-
|
106
|
-
Incremental build: enabled
|
107
|
-
Generating...
|
108
|
-
J1 QuickSearch: creating search index ...
|
109
|
-
J1 QuickSearch: finished, index ready.
|
110
|
-
....
|
111
|
-
----
|
112
|
-
|
113
|
-
Or, if you're running a website in development mode, the index get refreshed
|
114
|
-
for all files added or modified.
|
115
|
-
|
116
|
-
.Index creation if files added, or modified
|
117
|
-
----
|
118
|
-
site: Regenerating: n file(s) changed at ...
|
119
|
-
site: ...
|
120
|
-
site: J1 QuickSearch: creating search index ...
|
121
|
-
site: J1 QuickSearch: finished, index ready.
|
122
|
-
...
|
123
|
-
----
|
124
|
-
|
125
|
-
[role="mt-4"]
|
126
|
-
=== Lunr Index
|
127
|
-
|
128
|
-
The searchable data in an index is organized as data sets containing the
|
129
|
-
text and the words, named as terms, you want to search on. A document is
|
130
|
-
a *JSON data* set with fields that are processed to create the result list
|
131
|
-
for a search.
|
132
|
-
|
133
|
-
The *JSON data* data set might look like so:
|
134
|
-
|
135
|
-
.Generated JSON data
|
136
|
-
[source, json, role="noclip"]
|
137
|
-
----
|
138
|
-
{
|
139
|
-
"id": 3,
|
140
|
-
"title": "Roundtrip",
|
141
|
-
"tagline": "present images",
|
142
|
-
"url": "/pages/public/learn/roundtrip/present_images/",
|
143
|
-
"date": "2020-11-03 +0100",
|
144
|
-
"tags": [
|
145
|
-
"Introduction",
|
146
|
-
"Module",
|
147
|
-
"Image"
|
148
|
-
],
|
149
|
-
"categories": [
|
150
|
-
"Roundtrip"
|
151
|
-
],
|
152
|
-
"description": "Welcome to the preview page ... and galleries.\n",
|
153
|
-
"is_post": false
|
154
|
-
}
|
155
|
-
----
|
156
|
-
|
157
|
-
In this data, there are several fields, like title `title`, tagline `tagline`,
|
158
|
-
or description `description`, that could be used for *full-text* searches.
|
159
|
-
Additional fields are available, like tas `tags` or categories `categories`,
|
160
|
-
for more specific searches based on so-called *identifiers*.
|
161
|
-
|
162
|
-
NOTE: The data *content* is collected by the intrinsic *body* field `<body`.
|
163
|
-
To limit the index data loaded by the browser, the *body* field is removed
|
164
|
-
from the data set, but the *content* is still fully searchable.
|
165
|
-
|
166
|
-
To do a simple full-text search as well as more specific searches, the
|
167
|
-
QuickSearch core engine Lunr offers a *query language* --a domain-specific
|
168
|
-
language DSL. Find more about *QuickSearch|Lunr DSL* queries with the section
|
169
|
-
<<QuickSearch>>.
|
170
|
-
|
171
|
-
[role="mt-4"]
|
172
|
-
=== Lunr Scoring
|
173
|
-
|
174
|
-
The *relevance*, the so-called *score*, is calculated based on an algorithm
|
175
|
-
called *BM25*. You don’t need to worry too much about the details of how this
|
176
|
-
technique works. The *more* a search term occurs in a single page, the score
|
177
|
-
is increased and *seldom* words will *decrease* the score.
|
178
|
-
|
179
|
-
Scoring information is added to the local stored search index and allows
|
180
|
-
a very fast calculation of the relevance of all pages of a website for
|
181
|
-
search queries.
|
182
|
-
|
183
|
-
Imagine you’re website contains pages about Jekyll. The term *Jekyll* may
|
184
|
-
occur very *frequently* throughout the entire website. So finding a page
|
185
|
-
that mentions the term *Jekyll* isn’t very significant for a search.
|
186
|
-
|
187
|
-
However, if you’re searching for the tem *Jekyll Generator*, only some pages
|
188
|
-
of the website has the word *Generator* in them. That will bring the
|
189
|
-
relevance for documents having *both* words in them at a higher level, and
|
190
|
-
show them higher up in the search results.
|
191
|
-
|
192
|
-
Matching and scoring are used by all search engines -- the same as for J1
|
193
|
-
QuickSearch. You’ll see for QuickSearch a similar behavior in *sorting*
|
194
|
-
search results as you already know from commercial internet search engines
|
195
|
-
like Google: the *top* results are the *more relevant* ones.
|
196
|
-
|
197
|
-
|
198
|
-
[role="mt-5"]
|
199
|
-
== QuickSearch
|
200
|
-
|
201
|
-
To access QuickSearch, a magnifier button
|
202
|
-
// <a href="#" aria-label="Search"><i class="nav-icon mdib mdib-magnify mdib-2x"></i></a>
|
203
|
-
is available in the `Quicklinks` area in the menu bar at the top-right of
|
204
|
-
every page.
|
205
|
-
|
206
|
-
.Search button (magnifier) in the quick access area
|
207
|
-
lightbox::quicksearch-icon[ 800, {data-quicksearch-icon} ]
|
208
|
-
|
209
|
-
A mouse-click on the magnifier button opens the search input and disables
|
210
|
-
all other navigation to focus on what you're intended to do: searching.
|
211
|
-
|
212
|
-
.Input bar for a QuickSearch
|
213
|
-
lightbox::quicksearch-input[ 800, {data-quicksearch-input} ]
|
214
|
-
|
215
|
-
Search queries look like simple text. But the search `engine` under the
|
216
|
-
hood of QuickSearch transforms the given search string (text) always into a
|
217
|
-
search query. Search queries support a special syntax, the DSL, for defining
|
218
|
-
more complex queries for better (scored) results.
|
219
|
-
|
220
|
-
As always: start simple!
|
221
|
-
|
222
|
-
=== Simple Searches
|
223
|
-
|
224
|
-
The simplest way to run a search is to pass the text (words, terms) on which
|
225
|
-
you want to search on:
|
226
|
-
|
227
|
-
[source, text]
|
228
|
-
----
|
229
|
-
jekyll
|
230
|
-
----
|
231
|
-
|
232
|
-
The above will return all documents that match the term `jekyll`. Searches for
|
233
|
-
*multiple* terms (words) are also supported. If a document matches *at least*
|
234
|
-
one of the search terms, it will show in the results. The search terms are
|
235
|
-
combined by a logical `OR`.
|
236
|
-
|
237
|
-
[source, text]
|
238
|
-
----
|
239
|
-
jekyll tutorial
|
240
|
-
----
|
241
|
-
|
242
|
-
The above example will match documents that contain either `jekyll` *OR*
|
243
|
-
`tutorial`. Documents that contain _both_ will increase the score, and those
|
244
|
-
documents are returned first.
|
245
|
-
|
246
|
-
NOTE: Comparing to a Google search (terms are combined at Google by a
|
247
|
-
logical `AND`) a Quicksearch combines the terms by an `OR`.
|
248
|
-
|
249
|
-
To combine search terms in a QuickSearch query by a logical *AND*, the terms
|
250
|
-
could be prepended by a plus sign (`+`) to mark them as for the QuickSearch
|
251
|
-
query (DSL) as *required*:
|
252
|
-
|
253
|
-
[source, text]
|
254
|
-
----
|
255
|
-
+jekyll +tutorial
|
256
|
-
----
|
257
|
-
|
258
|
-
[role="mt-4"]
|
259
|
-
=== Searches using Wildcards
|
260
|
-
|
261
|
-
QuickSearch supports wildcards when performing searches. A wildcard is
|
262
|
-
represented as an asterisk `*` and can appear anywhere in a search
|
263
|
-
term. For example, the following will match all documents with words
|
264
|
-
beginning with *jek* `Jek`:
|
265
|
-
|
266
|
-
[source, text]
|
267
|
-
----
|
268
|
-
jek*
|
269
|
-
----
|
270
|
-
|
271
|
-
NOTE: Language grammar rules are not relevant for searches. For simplification,
|
272
|
-
all words (terms) are transformed to lower case. As a result, the word
|
273
|
-
`Jekyll` is the same as `jekyll` from a search-engines perspective. Language
|
274
|
-
variations of `Jekyll's` or plurals like `Generators` are reduced
|
275
|
-
to their base form. For searches, don't take care of grammar rules but the
|
276
|
-
spelling. If you're unsure about the spelling of a word, use wildcards.
|
277
|
-
|
278
|
-
////
|
279
|
-
[role="mt-4"]
|
280
|
-
=== Searches using Fields
|
281
|
-
|
282
|
-
By default, Lunr will search *all fields* in a document for the given query
|
283
|
-
terms, and it is possible to restrict a term to a specific *field*. The
|
284
|
-
following example searches for the term `jekyll` in the field title:
|
285
|
-
|
286
|
-
[source, text]
|
287
|
-
----
|
288
|
-
title:jekyll
|
289
|
-
----
|
290
|
-
|
291
|
-
The search term is prefixed with the field's name, followed by a colon (`:`).
|
292
|
-
The field _must_ be one of the fields defined when building the index.
|
293
|
-
Unrecognized fields will lead to an error.
|
294
|
-
|
295
|
-
Search queries based on fields can be combined with all other term modifiers
|
296
|
-
like wildcards. For example, to search for words
|
297
|
-
beginning with `jek` in the title *AND* the wildcard `coll*` in a document,
|
298
|
-
the following query can be used:
|
299
|
-
|
300
|
-
[source, text]
|
301
|
-
----
|
302
|
-
+title:jek* +coll*
|
303
|
-
----
|
304
|
-
|
305
|
-
Besides the document *body*, an intrinsic field to create the full-text index
|
306
|
-
out of the document *content*, some more specific fields are available for
|
307
|
-
searches.
|
308
|
-
|
309
|
-
.Available fields (all documents)
|
310
|
-
[cols="3a,3a,6a, options="header", width="100%", role="rtable mt-3"]
|
311
|
-
|===
|
312
|
-
|Name |Value |Description\|Example\|s
|
313
|
-
|
314
|
-
|`title`
|
315
|
-
|`string`
|
316
|
-
|The headline of a document (article, post)
|
317
|
-
|
318
|
-
Example\|s: QuickSearch
|
319
|
-
[source, text]
|
320
|
-
----
|
321
|
-
title:QuickSearch
|
322
|
-
----
|
323
|
-
|
324
|
-
|`tagline`
|
325
|
-
|`string`
|
326
|
-
|The subtitle of a document (article, post)
|
327
|
-
|
328
|
-
Example\|s: full index search
|
329
|
-
|
330
|
-
|`tags`
|
331
|
-
|`string`
|
332
|
-
|Tags describe the content of a document.
|
333
|
-
|
334
|
-
Example\|s: Roundtrip, QuickSearch
|
335
|
-
|
336
|
-
|`categories`
|
337
|
-
|`string`
|
338
|
-
|Categories describe the group of documnets a document belongs to.
|
339
|
-
|
340
|
-
Example\|s: Search
|
341
|
-
|
342
|
-
|`description`
|
343
|
-
|`string`
|
344
|
-
|The description is given by the author for a document. It gives a brief
|
345
|
-
summary what the document is all about.
|
346
|
-
|
347
|
-
Example\|s: QuickSearch is based on the search engine Lunr, fully integrated
|
348
|
-
with J1 Template ...
|
349
|
-
|
350
|
-
|===
|
351
|
-
|
352
|
-
=== Boosts
|
353
|
-
|
354
|
-
In multi-term searches, a single term may be important than others. For
|
355
|
-
these cases Lunr supports term level boosts. Any document that matches a
|
356
|
-
boosted term will get a higher relevance score, and appear higher up in
|
357
|
-
the results. A boost is applied by appending a caret (`^`) and then a
|
358
|
-
positive integer to a term.
|
359
|
-
|
360
|
-
[source, javascript]
|
361
|
-
----
|
362
|
-
idx.search('foo^10 bar')
|
363
|
-
----
|
364
|
-
|
365
|
-
The above example weights the term “foo” 10 times higher than the term
|
366
|
-
“bar”. The boost value can be any positive integer, and different terms
|
367
|
-
can have different boosts:
|
368
|
-
|
369
|
-
[source, javascript]
|
370
|
-
----
|
371
|
-
idx.search('foo^10 bar^5 baz')
|
372
|
-
----
|
373
|
-
|
374
|
-
=== Fuzzy Matches
|
375
|
-
|
376
|
-
Lunr supports fuzzy matching search terms in documents, which can be
|
377
|
-
helpful if the spelling of a term is unclear, or to increase the number
|
378
|
-
of search results that are returned. The amount of fuzziness to allow
|
379
|
-
when searching can also be controlled. Fuzziness is applied by appending
|
380
|
-
a tilde (`~`) and then a positive integer to a term. The following
|
381
|
-
search matches all documents that have a word within 1 edit distance of
|
382
|
-
“foo”:
|
383
|
-
|
384
|
-
[source, javascript]
|
385
|
-
----
|
386
|
-
idx.search('foo~1')
|
387
|
-
----
|
388
|
-
|
389
|
-
An edit distance of 1 allows words to match if either adding, removing,
|
390
|
-
changing or transposing a character in the word would lead to a match.
|
391
|
-
For example “boo” requires a single edit (replacing “f” with “b”) and
|
392
|
-
would match, but “boot” would not as it also requires an additional “t”
|
393
|
-
at the end.
|
394
|
-
|
395
|
-
[role="mt-5"]
|
396
|
-
== Lunr Term presence
|
397
|
-
|
398
|
-
By default, Lunr combines multiple terms in a search with a logical OR. That
|
399
|
-
is, a search for `jekyll collections` will match documents that contain
|
400
|
-
`jekyll` or contain `collections` or contain both. This behavior is
|
401
|
-
controllable at the term level, i.e., the presence of each term in matching
|
402
|
-
documents can be specified.
|
403
|
-
|
404
|
-
By default, each term is optional in a matching document, though a document
|
405
|
-
must have at least one matching term. It is possible to specify that a term
|
406
|
-
must be present in matching documents or that it must be absent in matching
|
407
|
-
documents.
|
408
|
-
|
409
|
-
To indicate that a term must be *present* in matching documents, the term
|
410
|
-
could be prefixed with a plus sign (`+`) (required), and to indicate that a
|
411
|
-
term must be *absent* (not wanted), the term should be prefixed with a minus
|
412
|
-
(`-`).
|
413
|
-
|
414
|
-
The below example searches for documents that *must* contain `jekyll`, and
|
415
|
-
must *not* contain the word `collection`:
|
416
|
-
|
417
|
-
[source, text]
|
418
|
-
----
|
419
|
-
+jekyll -collection
|
420
|
-
----
|
421
|
-
|
422
|
-
To simulate a logical *AND* search of documents that contain the word `jekyll`
|
423
|
-
*AND* the word `collection`, mark both terms as required:
|
424
|
-
|
425
|
-
[source, text]
|
426
|
-
----
|
427
|
-
+jekyll +collection
|
428
|
-
----
|
429
|
-
////
|
430
|
-
|
431
|
-
[role="mt-5"]
|
432
|
-
== What next
|
433
|
-
|
434
|
-
You reached the end of the roundtrip. Hopefully you enjoyed exploring what J1
|
435
|
-
can do for your new website. To make things real for your site, go for
|
436
|
-
_J1 in a Day_.
|
437
|
-
|
438
|
-
J1 in a Day is a tutorial learning to create modern websites using the J1
|
439
|
-
Theme. This Tutorial focuses on the basics of Jekyll and J1, which all
|
440
|
-
people need to know for a successful way to a modern static website. Jekyll
|
441
|
-
(and J1) is quite different from classic Content Management Systems (CMS).
|
442
|
-
|
443
|
-
If you would like to learn more about the use of Jekyll and J1 Template, the
|
444
|
-
tutorials present what you need to know:
|
445
|
-
|
446
|
-
* The basics of modern static webs
|
447
|
-
* Creating an awesome Site
|
448
|
-
* Development System
|
449
|
-
* Project Management
|
450
|
-
* Create Content
|
451
|
-
|
452
|
-
It sounds much, spending a whole day to get Jekyll and J1 to know. Yes, it is
|
453
|
-
much. But it makes sense to get a full overview of what can be achieved by
|
454
|
-
modern static websites.
|
455
|
-
|
456
|
-
It's a pleasant journey to learn what modern static webs can offer today.
|
457
|
-
Start your journey from here:
|
458
|
-
link:{url-j1-kickstarter--web-in-a-day}[J1 in a Day, {browser-window--new}].
|
459
|
-
|
460
|
-
Have fun!
|