Skip to content

Commit b4698e4

Browse files
committed
Replace middleman-search with lunr with Typesense DocSearch
Signed-off-by: Takuya Noguchi <[email protected]>
1 parent b6a9b36 commit b4698e4

File tree

10 files changed

+16
-314
lines changed

10 files changed

+16
-314
lines changed

Gemfile

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ gem 'middleman', '~> 4.4'
66
gem 'middleman-syntax'
77
gem 'middleman-blog'
88
gem 'puma', '~> 5.6'
9-
gem 'middleman-search', github: 'deivid-rodriguez/middleman-search', branch: 'workarea-commerce-master'
109
gem 'rake'
1110
gem 'ronn'
1211
gem 'kramdown'

Gemfile.lock

-16
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
GIT
2-
remote: https://github.com/deivid-rodriguez/middleman-search.git
3-
revision: 50465e1c1580e282a45247b77036da3c2719870d
4-
branch: workarea-commerce-master
5-
specs:
6-
middleman-search (0.10.0)
7-
middleman-core (>= 3.2)
8-
mini_racer (~> 0.5)
9-
nokogiri (~> 1.6)
10-
111
GEM
122
remote: https://rubygems.org/
133
specs:
@@ -52,9 +42,6 @@ GEM
5242
json (2.6.2)
5343
kramdown (2.4.0)
5444
rexml
55-
libv8-node (16.10.0.0)
56-
libv8-node (16.10.0.0-arm64-darwin)
57-
libv8-node (16.10.0.0-x86_64-linux)
5845
listen (3.0.8)
5946
rb-fsevent (~> 0.9, >= 0.9.4)
6047
rb-inotify (~> 0.9, >= 0.9.7)
@@ -101,8 +88,6 @@ GEM
10188
middleman-core (>= 3.2)
10289
rouge (~> 3.2)
10390
mini_portile2 (2.8.0)
104-
mini_racer (0.5.0)
105-
libv8-node (~> 16.10.0.0)
10691
minitest (5.14.4)
10792
mustache (1.0.5)
10893
nio4r (2.5.8)
@@ -193,7 +178,6 @@ DEPENDENCIES
193178
kramdown
194179
middleman (~> 4.4)
195180
middleman-blog
196-
middleman-search!
197181
middleman-syntax
198182
nokogiri (~> 1.13)
199183
octokit (~> 5.1)

assets/javascripts/application.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import './search'
2-
import './search_arrows'
31
import AnchorJS from 'anchor-js';
42

3+
import "./typesenseDocsearch";
4+
55
const anchors = new AnchorJS();
66

77
anchors.options = {

assets/javascripts/search.js

-146
This file was deleted.

assets/javascripts/search_arrows.js

-93
This file was deleted.
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
docsearch({
2+
inputSelector: "#input-search",
3+
typesenseCollectionName: "bundler",
4+
typesenseServerConfig: {
5+
nodes: [{
6+
host: "k0cw8zgj4i592lsqp-1.a1.typesense.net",
7+
protocol: "https",
8+
}],
9+
apiKey: "kWCn88g6vUwWdBVgEPPYUP9WSIGoqljS",
10+
},
11+
});

assets/stylesheets/_search.scss

-42
Original file line numberDiff line numberDiff line change
@@ -31,45 +31,3 @@
3131
.input-search:focus {
3232
outline: 0;
3333
}
34-
35-
.search-list-ul {
36-
list-style-type: none;
37-
padding-left: 0;
38-
39-
hr {
40-
margin-top: 0;
41-
margin-bottom: 0;
42-
}
43-
44-
li:last-child hr {
45-
height: 0;
46-
border-top-color: #ffffff;
47-
}
48-
49-
h4 {
50-
padding-top: 10px;
51-
margin-bottom: 0;
52-
}
53-
54-
.active {
55-
border: 2px solid #64C9EF !important;
56-
57-
transition-property: border-color;
58-
transition-duration: 0.3s;
59-
-webkit-transition-property: border-color;
60-
-webkit-transition-duration: 0.3s;
61-
-o-transition-property: border-color;
62-
-o-transition-duration: 0.3s;
63-
-moz-transition-property: border-color;
64-
-moz-transition-duration: 0.3s;
65-
}
66-
67-
.search-list-li {
68-
border: 2px solid transparent;
69-
padding: 2px;
70-
}
71-
}
72-
73-
.popover{
74-
max-width: 100%; /* Max Width of the popover (depending on the container!) */
75-
}

assets/stylesheets/application.css.scss

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ $icon-font-path: '~bootstrap/assets/fonts/bootstrap/';
4848
@import "~bootstrap/scss/nav";
4949
@import "~bootstrap/scss/navbar";
5050
@import "~bootstrap/scss/card";
51-
@import "~bootstrap/scss/popover";
5251

5352
// Helpers
5453
@import "~bootstrap/scss/helpers";

config.rb

-12
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,6 @@
55

66
activate :syntax
77
activate :i18n
8-
activate :search do |search|
9-
search.resources = ['index.html', 'guides/', "#{config[:current_version]}/", 'compatibility.html', 'conduct.html', 'contributors.html']
10-
11-
search.index_path = 'search/lunr-index.json'
12-
13-
search.fields = {
14-
title: {boost: 100, store: true, required: true},
15-
content: {boost: 50},
16-
url: {index: false, store: true},
17-
description: {index: false, store: true},
18-
}
19-
end
208

219
set :markdown_engine, :kramdown
2210

0 commit comments

Comments
 (0)