Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade ruby to 3.2.2, replace lunr.js with algolia search #493

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.7
3.2.2
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ gem 'jekyll-seo-tag', "~> 2.7.1"

group :jekyll_plugins do
gem 'jekyll-diagrams'
gem 'jekyll-lunr-js-search', :git => 'https://github.com/memfault/jekyll-lunr-js-search.git', :ref => '497e6c31849162d74872ec421017f364fd84b7c4'
end

gem "jekyll-target-blank", "~> 2.0"
Expand Down
83 changes: 43 additions & 40 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,32 +1,26 @@
GIT
remote: https://github.com/memfault/jekyll-lunr-js-search.git
revision: 497e6c31849162d74872ec421017f364fd84b7c4
ref: 497e6c31849162d74872ec421017f364fd84b7c4
specs:
jekyll-lunr-js-search (3.3.0)
execjs (~> 2.7)
json (~> 2.0)
nokogiri (~> 1.7)

GEM
remote: https://rubygems.org/
specs:
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
colorator (1.1.0)
concurrent-ruby (1.1.9)
deep_merge (1.2.1)
em-websocket (0.5.2)
concurrent-ruby (1.3.3)
deep_merge (1.2.2)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
http_parser.rb (~> 0)
eventmachine (1.2.7)
execjs (2.8.1)
ffi (1.15.4)
ffi (1.17.0-aarch64-linux-gnu)
ffi (1.17.0-arm-linux-gnu)
ffi (1.17.0-arm64-darwin)
ffi (1.17.0-x86-linux-gnu)
ffi (1.17.0-x86_64-darwin)
ffi (1.17.0-x86_64-linux-gnu)
forwardable-extended (2.6.0)
http_parser.rb (0.6.0)
i18n (1.8.10)
http_parser.rb (0.8.0)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
jekyll (4.2.1)
jekyll (4.2.2)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
Expand All @@ -49,62 +43,71 @@ GEM
deep_merge (~> 1.2)
jekyll (>= 3.0)
jekyll-paginate (1.1.0)
jekyll-sass-converter (2.1.0)
jekyll-sass-converter (2.2.0)
sassc (> 2.0.1, < 3.0)
jekyll-seo-tag (2.7.1)
jekyll (>= 3.8, < 5.0)
jekyll-sitemap (1.4.0)
jekyll (>= 3.7, < 5.0)
jekyll-target-blank (2.0.0)
jekyll-target-blank (2.0.2)
jekyll (>= 3.0, < 5.0)
nokogiri (~> 1.10)
jekyll-watch (2.2.1)
listen (~> 3.0)
json (2.6.3)
kramdown (2.3.1)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.7.0)
liquid (4.0.4)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
mini_portile2 (2.8.4)
nokogiri (1.15.3)
mini_portile2 (~> 2.8.2)
nokogiri (1.16.6-aarch64-linux)
racc (~> 1.4)
nokogiri (1.16.6-arm-linux)
racc (~> 1.4)
nokogiri (1.16.6-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.6-x86-linux)
racc (~> 1.4)
nokogiri (1.16.6-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.6-x86_64-linux)
racc (~> 1.4)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.6)
racc (1.7.1)
rb-fsevent (0.11.0)
rb-inotify (0.10.1)
public_suffix (6.0.0)
racc (1.8.0)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rexml (3.2.5)
rouge (3.26.1)
rexml (3.3.2)
strscan
rouge (3.30.0)
safe_yaml (1.0.5)
sassc (2.4.0)
ffi (~> 1.9)
strscan (3.1.0)
terminal-table (2.0.0)
unicode-display_width (~> 1.1, >= 1.1.1)
unicode-display_width (1.8.0)
webrick (1.7.0)
webrick (1.8.1)

PLATFORMS
ruby
universal-darwin
universal-linux

DEPENDENCIES
jekyll (~> 4.2.1)
jekyll-diagrams
jekyll-feed (~> 0.15.1)
jekyll-get-json (~> 1.0)
jekyll-lunr-js-search!
jekyll-paginate (~> 1.1)
jekyll-seo-tag (~> 2.7.1)
jekyll-sitemap (~> 1.4)
jekyll-target-blank (~> 2.0)
webrick (~> 1.7)

BUNDLED WITH
2.2.29
2.4.20
1 change: 0 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,5 @@ exclude:
- vendor/cache/
- vendor/gems/
- vendor/ruby/
- netlify.toml
- readme.html
- example
3 changes: 3 additions & 0 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,7 @@
<!-- RSS -->
<link href="{{ '/feed.xml' | absolute_url }}" type="application/rss+xml" rel="alternate" title="RSS 2.0 Feed" />

<!-- Speed up DocSearch -->
<link rel="preconnect" href="https://R2IYF7ETH7-dsn.algolia.net" crossorigin />

</head>
24 changes: 9 additions & 15 deletions _includes/script.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,13 @@
<script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/8551838.js"></script>
<!-- End of HubSpot Embed Code -->

{% if jekyll.environment == "production" %}
<!-- This is installed from the https://github.com/slashdotdash/jekyll-lunr-js-search Gem -->
<script src="/js/search.min.js" type="text/javascript" charset="utf-8"></script>
{% endif %}

<script type="text/javascript">
$(function() {
$('#search-input').lunrSearch({
indexUrl : '/js/index.json', // url for the .json file containing search index data
results : '#search-results', // selector for containing search results element
template : '#search-results-template', // selector for Mustache.js template
titleMsg : '', //<h1>Search results<h1>', // message attached in front of results (can be empty)
emptyMsg : '<p>Nothing found.</p>' // shown message if search returns no results
});
});
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3" />
<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@3" ></script>
<script>
docsearch({
container: '#docsearch',
appId: '4SXF6GYFKZ',
apiKey: '2028276a4fc7f09eeb0bd082fbd85164',
gminn marked this conversation as resolved.
Show resolved Hide resolved
indexName: 'memfault',
});
</script>
40 changes: 1 addition & 39 deletions _includes/search.html
Original file line number Diff line number Diff line change
@@ -1,39 +1 @@
<form id="search-form">
<label for="search-input">
<h3>Search</h3>
</label>
<input autocomplete="off" type="text" id="search-input" name="q" placeholder="Search posts...">
</form>

<section id="search-results" style="display: none;"> </section>

{% raw %}
<script id="search-results-template" type="text/mustache">
{{#entries}}
<article class="search-result">
<h1><a href="{{url}}">{{title}}</a></h1>
<small>
{{#date}}<time datetime="{{pubdate}}" pubdate>{{displaydate}}</time>{{/date}}
{{#is_post}}
{{#tags}} #{{.}}{{/tags}}
{{/is_post}}
</small>
</article>
{{/entries}}
</script>
{% endraw %}

<style>
#search-results {
padding-top: 1.3em;
}

.search-result {
padding-bottom: 0.5em;
}

.search-result h1 {
font-size: 1rem;
line-height: 1.5;
}
</style>
<div id="docsearch"></div>
2 changes: 1 addition & 1 deletion _redirects
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
/events-calendar https://airtable.com/shrPIHX3y3gQ0WlRd/iCal?timeZone=America%2FLos_Angeles&userLocale=en

# Custom 404 page
# https://docs.netlify.com/routing/redirects/redirect-options/#custom-404-page-handling
# https://developers.cloudflare.com/pages/configuration/redirects/
/* /404.html 404
61 changes: 1 addition & 60 deletions _sass/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -344,66 +344,7 @@ footer {
}
}


/* Search */
#search-results {
@media (min-width: 940px) {
max-height: 300px;
overflow-y: auto;
position: relative;

&:after {
content: 'Scroll down to see more';
transition: all 0.3s ease-in;
text-align: center;
display: block;
position: sticky;
bottom: 0;
left: 0;
color: #33475b;
font-size: 12px;
line-height: 4.5rem;
width: 100%;
height: 50px;
opacity: 1;
background: -moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 50%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 50%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 50%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=0 ); /* IE6-9 */
}

&.scrolled-down:after {
bottom: -50px;
opacity: 0;
}
}
}

#search-input {
height: 45px;
border: 1px solid $light-grey;
font-size: 18px;
padding: 5px 10px;
color: $text-color;
background-color: $background-color2;
border-radius: 15px;
}

#results-container {
margin-left: 0;
margin-bottom: 40px;

&::after {
display: block;
content: '';
width: 5rem;
height: 1px;
margin: 23px auto;
background-color: lighten($text-color, 70%);
}
}

#search-form {
#docsearch {
display: flex;
flex-direction: column;

Expand Down
10 changes: 0 additions & 10 deletions netlify.toml

This file was deleted.

2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ You can now access the server at [http://0.0.0.0:4000](http://0.0.0.0:4000)

You'll need:
- Python 3.8 or later
- Ruby 2.7.7
- Ruby 3.2.2

#### Install Dependencies

Expand Down
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
blockdiag
Pillow==9.5.0
# Install a newer version of blockdiag, that's compatible with modern pillow
git+https://github.com/blockdiag/blockdiag.git@refs/pull/179/head
Pillow==10.3.0
funcparserlib==1.0.0a0
Loading