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

Added support for search #2415

Merged
merged 30 commits into from
May 24, 2024
Merged

Added support for search #2415

merged 30 commits into from
May 24, 2024

Conversation

george-gca
Copy link
Collaborator

@george-gca george-gca commented May 13, 2024

Added support for search within the template as suggested in #581. I decided to go with a client side search based on Ninja keys, but using deepdub's fork as basis since it supports fuzzy search.

Had to do a bunch of changes to their code to make it work without using node to install everything. Also changed to use some colors defined in our side and using both pages' titles and descriptions for search. Also had to increase the template max width to better accomodate the new item in navigation bar.

Missing implementations:

  • One thing I'd love to do (but currently have no idea how) would be to change the text next to the search button depending on the platform. For example, if the user is accessing the site on a mac they should use ⌘k instead of ctrl k.
  • Test how this looks like (and how it is supposed to work) on devices with smaller screens
  • Support for offline mode

Some screenshots:


Dark version

Screenshot from 2024-05-13 16-30-12

Screenshot from 2024-05-13 16-30-26

Screenshot from 2024-05-13 16-30-36


Light version

Screenshot from 2024-05-13 16-30-44

Screenshot from 2024-05-13 16-30-50

Screenshot from 2024-05-13 16-30-55

Signed-off-by: George Araujo <george.gcac@gmail.com>
Signed-off-by: George Araujo <george.gcac@gmail.com>
Signed-off-by: George Araujo <george.gcac@gmail.com>
Signed-off-by: George Araujo <george.gcac@gmail.com>
Signed-off-by: George Araujo <george.gcac@gmail.com>
Signed-off-by: George Araujo <george.gcac@gmail.com>
Signed-off-by: George Araujo <george.gcac@gmail.com>
Signed-off-by: George Araujo <george.gcac@gmail.com>
Signed-off-by: George Araujo <george.gcac@gmail.com>
Signed-off-by: George Araujo <george.gcac@gmail.com>
Signed-off-by: George Araujo <george.gcac@gmail.com>
Signed-off-by: George Araujo <george.gcac@gmail.com>
@pourmand1376
Copy link
Collaborator

Hi. @george-gca

Thanks for adding the great feature. Images look great.

Just a question. Do you know anyway so that I can test this online?

@george-gca
Copy link
Collaborator Author

george-gca commented May 15, 2024

I want to add some kind of build and deploy from PR here, but I don't know if GitHub Pages support this. I saw this being done with netlify, as I commented in #1981, but never really looked into it.

@george-gca
Copy link
Collaborator Author

Apparently Netlify and Vercel support this feature.

Signed-off-by: George Araujo <george.gcac@gmail.com>
Signed-off-by: George Araujo <george.gcac@gmail.com>
Signed-off-by: George Araujo <george.gcac@gmail.com>
Signed-off-by: George Araujo <george.gcac@gmail.com>
Signed-off-by: George Araujo <george.gcac@gmail.com>
@george-gca
Copy link
Collaborator Author

george-gca commented May 17, 2024

I've been trying to make Netlify work for my repo so you could test this @pourmand1376 without having to run it locally, but to no avail. Currently it fails with

Liquid Exception: No such file or directory @ rb_sysopen - /opt/build/repo/./_bibliography/references.bib in /opt/build/repo/_posts/en-us/2023-07-12-post-bibliography.md

Even though the string references.bib doesn't even exist in the repo.

EDIT: Just found out that for some unknown reason the build is using the default values of some plugins (in this case jekyll-scholar) even though we override these in _config.yml. Any thoughts on this matter?

dependabot bot and others added 7 commits May 17, 2024 14:24
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.16.4
to 1.16.5.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/sparklemotion/nokogiri/releases">nokogiri's
releases</a>.</em></p>
<blockquote>
<h2>v1.16.5 / 2024-05-13</h2>
<h3>Security</h3>
<ul>
<li>[CRuby] Vendored libxml2 is updated to address CVE-2024-34459. See
<a
href="https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-r95h-9x8f-r3f7">GHSA-r95h-9x8f-r3f7</a>
for more information.</li>
</ul>
<h3>Dependencies</h3>
<ul>
<li>[CRuby] Vendored libxml2 is updated to <a
href="https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.12.7">v2.12.7</a>
from v2.12.6. (<a
href="https://github.com/flavorjones"><code>@​flavorjones</code></a>)</li>
</ul>
<hr />
<p>sha256 checksums:</p>

<pre><code>af0f44fa3e664dfb2aa10de8b551447d720c1e8d1f0aa3f35783dcc43e40a874
nokogiri-1.16.5-aarch64-linux.gem
23dc2357b26409a5c33b7e32a82902f0e9995305420f16d1a03ab3ea1a482fec
nokogiri-1.16.5-arm-linux.gem
950d037530edb49f75ad35de0b8038b970a7dda57e2b6326895b0e49fadf6214
nokogiri-1.16.5-arm64-darwin.gem
b7aefc94370c62476b8528e8d8abb6160203abd84a1f4eceda8f1aa8974d9989
nokogiri-1.16.5-java.gem
ec2167160df8fec3137bf95d574ed80ebc1d002bb3b281546b60b4aa9002466e
nokogiri-1.16.5-x64-mingw-ucrt.gem
6984200491fac69974005ecfa2de129d61843d345eafa5d6f58e8b908d1cf107
nokogiri-1.16.5-x64-mingw32.gem
abdc389ab1ec6604492da16bd9d06ad746fdb6bd6a1bd274c400d61ffcadb3c4
nokogiri-1.16.5-x86-linux.gem
63d24981345856f2baf7f4089870a62d3042fb8d3021b280fb04fc052532e3c4
nokogiri-1.16.5-x86-mingw32.gem
71b5f54e378c433d13df67c3b71acc4716129da62402d8181f310c4216a63279
nokogiri-1.16.5-x86_64-darwin.gem
0ca238da870066bed2f7837af6f35791bb9b76c4c5638999c46aac44818a6a97
nokogiri-1.16.5-x86_64-linux.gem
ec36162c68984fa0a90a5c4ae7ab7759460639e716cc1ce75f34c3cb54158ad2
nokogiri-1.16.5.gem
</code></pre>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md">nokogiri's
changelog</a>.</em></p>
<blockquote>
<h2>v1.16.5</h2>
<h3>Security</h3>
<ul>
<li>[CRuby] Vendored libxml2 is updated to address CVE-2024-34459. See
<a
href="https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-r95h-9x8f-r3f7">GHSA-r95h-9x8f-r3f7</a>
for more information.</li>
</ul>
<h3>Dependencies</h3>
<ul>
<li>[CRuby] Vendored libxml2 is updated to <a
href="https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.12.7">v2.12.7</a>
from v2.12.6. (<a
href="https://github.com/flavorjones"><code>@​flavorjones</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/sparklemotion/nokogiri/commit/cd70bd3dc9e0dc15b04b42d67b639eb5804e77d5"><code>cd70bd3</code></a>
version bump to v1.16.5</li>
<li><a
href="https://github.com/sparklemotion/nokogiri/commit/afc36de553085b6b397b23a0c09a2449655a3a47"><code>afc36de</code></a>
dep: update vendored libxml2 to v2.12.7 (<a
href="https://redirect.github.com/sparklemotion/nokogiri/issues/3191">#3191</a>)</li>
<li><a
href="https://github.com/sparklemotion/nokogiri/commit/41b4f0846d2c264b48ef93ecd034dd230ab8125a"><code>41b4f08</code></a>
ci: add arm64-darwin coverage using macos-14</li>
<li><a
href="https://github.com/sparklemotion/nokogiri/commit/67b9e863a67164ae6ffbe5ed4cc482267db7c436"><code>67b9e86</code></a>
dep: update libxml2 to v2.12.7</li>
<li>See full diff in <a
href="https://github.com/sparklemotion/nokogiri/compare/v1.16.4...v1.16.5">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=nokogiri&package-manager=bundler&previous-version=1.16.4&new-version=1.16.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/alshedivat/al-folio/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Fixes alshedivat#2419 by downloading leaflet images. Also changed the path where
the libraries are downloaded to avoid not downloading files with same
name.

---------

Signed-off-by: George Araujo <george.gcac@gmail.com>
Bumps [rexml](https://github.com/ruby/rexml) from 3.2.6 to 3.2.8.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/ruby/rexml/releases">rexml's
releases</a>.</em></p>
<blockquote>
<h2>REXML 3.2.8 - 2024-05-16</h2>
<h3>Fixes</h3>
<ul>
<li>Suppressed a warning</li>
</ul>
<h2>REXML 3.2.7 - 2024-05-16</h2>
<h3>Improvements</h3>
<ul>
<li>
<p>Improve parse performance by using <code>StringScanner</code>.</p>
<ul>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/106">GH-106</a></p>
</li>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/107">GH-107</a></p>
</li>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/108">GH-108</a></p>
</li>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/109">GH-109</a></p>
</li>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/112">GH-112</a></p>
</li>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/113">GH-113</a></p>
</li>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/114">GH-114</a></p>
</li>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/115">GH-115</a></p>
</li>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/116">GH-116</a></p>
</li>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/117">GH-117</a></p>
</li>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/118">GH-118</a></p>
</li>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/119">GH-119</a></p>
</li>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/121">GH-121</a></p>
</li>
<li>
<p>Patch by NAITOH Jun.</p>
</li>
</ul>
</li>
<li>
<p>Improved parse performance when an attribute has many
<code>&lt;</code>s.</p>
<ul>
<li><a
href="https://redirect.github.com/ruby/rexml/issues/124">GH-124</a></li>
</ul>
</li>
</ul>
<h3>Fixes</h3>
<ul>
<li>
<p>XPath: Fixed a bug of <code>normalize_space(array)</code>.</p>
<ul>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/110">GH-110</a></p>
</li>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/111">GH-111</a></p>
</li>
<li>
<p>Patch by flatisland.</p>
</li>
</ul>
</li>
<li>
<p>XPath: Fixed a bug that wrong position is used with nested path.</p>
<ul>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/110">GH-110</a></p>
</li>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/122">GH-122</a></p>
</li>
<li>
<p>Reported by jcavalieri.</p>
</li>
<li>
<p>Patch by NAITOH Jun.</p>
</li>
</ul>
</li>
<li>
<p>Fixed a bug that an exception message can't be generated for
invalid encoding XML.</p>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/ruby/rexml/blob/master/NEWS.md">rexml's
changelog</a>.</em></p>
<blockquote>
<h2>3.2.8 - 2024-05-16 {#version-3-2-8}</h2>
<h3>Fixes</h3>
<ul>
<li>Suppressed a warning</li>
</ul>
<h2>3.2.7 - 2024-05-16 {#version-3-2-7}</h2>
<h3>Improvements</h3>
<ul>
<li>
<p>Improve parse performance by using <code>StringScanner</code>.</p>
<ul>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/106">GH-106</a></p>
</li>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/107">GH-107</a></p>
</li>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/108">GH-108</a></p>
</li>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/109">GH-109</a></p>
</li>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/112">GH-112</a></p>
</li>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/113">GH-113</a></p>
</li>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/114">GH-114</a></p>
</li>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/115">GH-115</a></p>
</li>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/116">GH-116</a></p>
</li>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/117">GH-117</a></p>
</li>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/118">GH-118</a></p>
</li>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/119">GH-119</a></p>
</li>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/121">GH-121</a></p>
</li>
<li>
<p>Patch by NAITOH Jun.</p>
</li>
</ul>
</li>
<li>
<p>Improved parse performance when an attribute has many
<code>&lt;</code>s.</p>
<ul>
<li><a
href="https://redirect.github.com/ruby/rexml/issues/124">GH-124</a></li>
</ul>
</li>
</ul>
<h3>Fixes</h3>
<ul>
<li>
<p>XPath: Fixed a bug of <code>normalize_space(array)</code>.</p>
<ul>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/110">GH-110</a></p>
</li>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/111">GH-111</a></p>
</li>
<li>
<p>Patch by flatisland.</p>
</li>
</ul>
</li>
<li>
<p>XPath: Fixed a bug that wrong position is used with nested path.</p>
<ul>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/110">GH-110</a></p>
</li>
<li>
<p><a
href="https://redirect.github.com/ruby/rexml/issues/122">GH-122</a></p>
</li>
<li>
<p>Reported by jcavalieri.</p>
</li>
<li>
<p>Patch by NAITOH Jun.</p>
</li>
</ul>
</li>
<li>
<p>Fixed a bug that an exception message can't be generated for</p>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/ruby/rexml/commit/1cf37bab79d61d6183bbda8bf525ed587012b718"><code>1cf37ba</code></a>
Add 3.2.8 entry</li>
<li><a
href="https://github.com/ruby/rexml/commit/b67081caa807fad48d31983137b7ed8711e7f0df"><code>b67081c</code></a>
Remove an unused variable (<a
href="https://redirect.github.com/ruby/rexml/issues/128">#128</a>)</li>
<li><a
href="https://github.com/ruby/rexml/commit/94e180e939baff8f7e328a287bb96ebbd99db6eb"><code>94e180e</code></a>
Suppress a warning</li>
<li><a
href="https://github.com/ruby/rexml/commit/d574ba5fe1c40adbafbf16e47533f4eb32b43e60"><code>d574ba5</code></a>
ci: install only gems required for running tests (<a
href="https://redirect.github.com/ruby/rexml/issues/129">#129</a>)</li>
<li><a
href="https://github.com/ruby/rexml/commit/4670f8fc187c89d0504d027ea997959287143453"><code>4670f8f</code></a>
Add missing Thanks section</li>
<li><a
href="https://github.com/ruby/rexml/commit/9ba35f9f032c07c39b8c86536ac13a9cb313bef2"><code>9ba35f9</code></a>
Bump version</li>
<li><a
href="https://github.com/ruby/rexml/commit/085def07425561862d8329001168d8bc9c75ae8f"><code>085def0</code></a>
Add 3.2.7 entry</li>
<li><a
href="https://github.com/ruby/rexml/commit/4325835f92f3f142ebd91a3fdba4e1f1ab7f1cfb"><code>4325835</code></a>
Read quoted attributes in chunks (<a
href="https://redirect.github.com/ruby/rexml/issues/126">#126</a>)</li>
<li><a
href="https://github.com/ruby/rexml/commit/e77365e2d1c9cdb822c7e09b05fc5a4903d92c23"><code>e77365e</code></a>
Exclude older than 2.6 on macos-14</li>
<li><a
href="https://github.com/ruby/rexml/commit/bf2c8edb5facb206c25a62952aa37218793283e6"><code>bf2c8ed</code></a>
Move development dependencies to Gemfile (<a
href="https://redirect.github.com/ruby/rexml/issues/124">#124</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/ruby/rexml/compare/v3.2.6...v3.2.8">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rexml&package-manager=bundler&previous-version=3.2.6&new-version=3.2.8)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/alshedivat/al-folio/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Removed lsi command from code since it was added to _config.yml

---------

Signed-off-by: George Araujo <george.gcac@gmail.com>
Signed-off-by: George Araujo <george.gcac@gmail.com>
Signed-off-by: George Araujo <george.gcac@gmail.com>
Signed-off-by: George Araujo <george.gcac@gmail.com>
@george-gca
Copy link
Collaborator Author

@pourmand1376 do you know how to do hide the navbar properly? I tried to simply remove the show class from it, but it have 2 side effects:

  1. it hides abruptly and without animation
  2. it keeps the icon on the navbar as it were opened

@george-gca
Copy link
Collaborator Author

I think I am going to push this PR into our main branch already, and create 2 new issues:

  1. improvement - change the text next to the search button depending on the platform. For example, if the user is accessing the site on a mac they should use ⌘k instead of ctrl k
  2. bug - fix when on mobile devices

@george-gca george-gca merged commit 92cebc9 into alshedivat:master May 24, 2024
3 checks passed
@george-gca george-gca deleted the ninja-keys branch May 24, 2024 02:21
@pourmand1376
Copy link
Collaborator

@pourmand1376 do you know how to do hide the navbar properly? I tried to simply remove the show class from it, but it have 2 side effects:

  1. it hides abruptly and without animation
  2. it keeps the icon on the navbar as it were opened

Nope. I don't know.

george-gca added a commit to george-gca/multi-language-al-folio that referenced this pull request May 24, 2024
* Updated tikzjax hash

* Added support for search (alshedivat#2415)

Added support for search within the template as suggested in alshedivat#581. I
decided to go with a client side search based on [Ninja
keys](https://github.com/ssleptsov/ninja-keys), but using [deepdub's
fork](https://github.com/deepdub-ai/ninja-keys) as basis since it
supports fuzzy search.

Had to do a bunch of changes to their code to make it work without using
node to install everything. Also changed to use some colors defined in
our side and using both pages' titles and descriptions for search. Also
had to increase the template max width to better accomodate the new item
in navigation bar.

Missing implementations:
- [ ] One thing I'd love to do (but currently have no idea how) would be
to change the text next to the search button depending on the platform.
For example, if the user is accessing the site on a mac they should use
⌘k instead of ctrl k.
- [x] Test how this looks like (and how it is supposed to work) on
devices with smaller screens
- [x] Support for offline mode

Some screenshots:

---

## Dark version

![Screenshot from 2024-05-13
16-30-12](https://github.com/alshedivat/al-folio/assets/31376482/535acec5-dd7a-48cb-a17f-a295da98b5d3)

![Screenshot from 2024-05-13
16-30-26](https://github.com/alshedivat/al-folio/assets/31376482/6b2d94bb-3981-4252-ae2b-53994b514491)

![Screenshot from 2024-05-13
16-30-36](https://github.com/alshedivat/al-folio/assets/31376482/66262b56-2744-475d-b09f-2cb65210017b)

---

## Light version

![Screenshot from 2024-05-13
16-30-44](https://github.com/alshedivat/al-folio/assets/31376482/a0eec50c-e7ac-4b52-aee8-2050bff05d54)

![Screenshot from 2024-05-13
16-30-50](https://github.com/alshedivat/al-folio/assets/31376482/41d72066-3e68-4ec3-bf3d-140da621f67b)

![Screenshot from 2024-05-13
16-30-55](https://github.com/alshedivat/al-folio/assets/31376482/613fd56e-7180-4373-ab7a-dfed184b5a18)

---------

Signed-off-by: George Araujo <george.gcac@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix: Add back-to-top button (alshedivat#2433)

Fixes alshedivat#2425 

PR alshedivat#2427 adds a back-to-top button, however the button overlaps with the
footer when `footer_fixed: false` and [has inadequate
spacing](alshedivat#2425 (comment))
with `footer_fixed: true`

Changes in this PR:
- Fix positioning of button on fixed and sticky footer layouts 
- Add option to disable back-to-top button by setting `back_to_top:
false` in `_config.yml`
- Add button transparency to avoid button blocking content view
- Reduce size of button

Demo - 

| Device | Fixed footer | Sticky footer |
| :-----------: | :-------------: | :-----------: |
| Mobile |
![fixed_footer_mobile](https://github.com/alshedivat/al-folio/assets/2447878/2e17be04-1fa7-40c5-b691-829e92055367)
|
![sticky_footer_mobile](https://github.com/alshedivat/al-folio/assets/2447878/f5567e43-e6fe-442d-9a7f-99e0577e220b)
|
| Desktop |
![fixed_footer_desktop](https://github.com/alshedivat/al-folio/assets/2447878/fc755839-841a-4e6b-b249-2c75bc552ad8)
|
![sticky_footer_desktop](https://github.com/alshedivat/al-folio/assets/2447878/ef9a4c99-ce4c-4ac3-8fbb-207af9be245a)
|

Miscellaneous change - Added personal website under `Academics` to
`README.md`

* Moved search data inside search.liquid (alshedivat#2439)

Signed-off-by: George Araujo <george.gcac@gmail.com>

* Fixed merg bug

Signed-off-by: George Araujo <george.gcac@gmail.com>

* Translated search strings

Signed-off-by: George Araujo <george.gcac@gmail.com>

* Fixed spacing in liquid variables

Signed-off-by: George Araujo <george.gcac@gmail.com>

* Fixed all weird spacing between liquid variables and curly braces

Signed-off-by: George Araujo <george.gcac@gmail.com>

* Increased site max width

Signed-off-by: George Araujo <george.gcac@gmail.com>

* Fixed urls not being localized in search

Signed-off-by: George Araujo <george.gcac@gmail.com>

* Fixed prettier complaints

Signed-off-by: George Araujo <george.gcac@gmail.com>

---------

Signed-off-by: George Araujo <george.gcac@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Abhilesh Dhawanjewar <2447878+abhilesh@users.noreply.github.com>
george-gca pushed a commit that referenced this pull request May 27, 2024
Thank you @george-gca for the awesome work. on #2415.

This PR generalizes the search on all collections. Currently, only
projects are added to the search.
This PR uses all of them, such as news. On my personal website, I use a
teaching collection which is then also automatically searched.
@sahiljhawar
Copy link

sahiljhawar commented Jun 4, 2024

is it possible to do a site wide search instead of just he options which are shown in the search menu, like searching for in-text content?

@george-gca
Copy link
Collaborator Author

In situations like this it is recommended that you open a Q&A in discussions.

Yes, it is possible, but this search works locally, meaning you need to transfer a file with all the content that is going to be used for search. With only titles and descriptions, this file is small and the search is fast. Meanwhile if you give all the titles, descriptions, and contents, this file will increase in size, which will not only make your site heavier, but the search inside the file will be slower.

@sahiljhawar
Copy link

@george-gca okay, I’ll keep this in mind. But for now I don’t mind search being a bit slower, since I want to use my site as personal instruction repo for future references. Can you tell me how to put all the contents on the search or link to discussion which talks about this. Thanks

@george-gca
Copy link
Collaborator Author

Sure. Can you open a Q&A for this? This way it is easier for more people to find the answer to this.

@asboyer
Copy link
Contributor

asboyer commented Jun 14, 2024

Is there a way to make the search a little more specific? For example when searching "code", it returns results that contain "c" "o" "d" or "e" as well. There has to be a setting or field to restrict results to more exact matches?

@george-gca
Copy link
Collaborator Author

This was intentional, that's why it is based on deepdub's fork since it uses fuzzy search. If you want a more traditional search you can probably change the score function used, or change your code to use the original Ninja keys. Note that I made a bunch of changes to deepdub's code to make it work in our repo, so I don't think any of these changes are straightforward.

siril-teja pushed a commit to siril-teja/siril-teja.github.io-old that referenced this pull request Jun 19, 2024
Added support for search within the template as suggested in alshedivat#581. I
decided to go with a client side search based on [Ninja
keys](https://github.com/ssleptsov/ninja-keys), but using [deepdub's
fork](https://github.com/deepdub-ai/ninja-keys) as basis since it
supports fuzzy search.

Had to do a bunch of changes to their code to make it work without using
node to install everything. Also changed to use some colors defined in
our side and using both pages' titles and descriptions for search. Also
had to increase the template max width to better accomodate the new item
in navigation bar.

Missing implementations:
- [ ] One thing I'd love to do (but currently have no idea how) would be
to change the text next to the search button depending on the platform.
For example, if the user is accessing the site on a mac they should use
⌘k instead of ctrl k.
- [x] Test how this looks like (and how it is supposed to work) on
devices with smaller screens
- [x] Support for offline mode

Some screenshots:

---

![Screenshot from 2024-05-13
16-30-12](https://github.com/alshedivat/al-folio/assets/31376482/535acec5-dd7a-48cb-a17f-a295da98b5d3)

![Screenshot from 2024-05-13
16-30-26](https://github.com/alshedivat/al-folio/assets/31376482/6b2d94bb-3981-4252-ae2b-53994b514491)

![Screenshot from 2024-05-13
16-30-36](https://github.com/alshedivat/al-folio/assets/31376482/66262b56-2744-475d-b09f-2cb65210017b)

---

![Screenshot from 2024-05-13
16-30-44](https://github.com/alshedivat/al-folio/assets/31376482/a0eec50c-e7ac-4b52-aee8-2050bff05d54)

![Screenshot from 2024-05-13
16-30-50](https://github.com/alshedivat/al-folio/assets/31376482/41d72066-3e68-4ec3-bf3d-140da621f67b)

![Screenshot from 2024-05-13
16-30-55](https://github.com/alshedivat/al-folio/assets/31376482/613fd56e-7180-4373-ab7a-dfed184b5a18)

---------

Signed-off-by: George Araujo <george.gcac@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
siril-teja pushed a commit to siril-teja/siril-teja.github.io-old that referenced this pull request Jun 19, 2024
Thank you @george-gca for the awesome work. on alshedivat#2415.

This PR generalizes the search on all collections. Currently, only
projects are added to the search.
This PR uses all of them, such as news. On my personal website, I use a
teaching collection which is then also automatically searched.
karapostK pushed a commit to karapostK/karapostK.github.io that referenced this pull request Jul 4, 2024
Added support for search within the template as suggested in alshedivat#581. I
decided to go with a client side search based on [Ninja
keys](https://github.com/ssleptsov/ninja-keys), but using [deepdub's
fork](https://github.com/deepdub-ai/ninja-keys) as basis since it
supports fuzzy search.

Had to do a bunch of changes to their code to make it work without using
node to install everything. Also changed to use some colors defined in
our side and using both pages' titles and descriptions for search. Also
had to increase the template max width to better accomodate the new item
in navigation bar.

Missing implementations:
- [ ] One thing I'd love to do (but currently have no idea how) would be
to change the text next to the search button depending on the platform.
For example, if the user is accessing the site on a mac they should use
⌘k instead of ctrl k.
- [x] Test how this looks like (and how it is supposed to work) on
devices with smaller screens
- [x] Support for offline mode

Some screenshots:

---

## Dark version

![Screenshot from 2024-05-13
16-30-12](https://github.com/alshedivat/al-folio/assets/31376482/535acec5-dd7a-48cb-a17f-a295da98b5d3)

![Screenshot from 2024-05-13
16-30-26](https://github.com/alshedivat/al-folio/assets/31376482/6b2d94bb-3981-4252-ae2b-53994b514491)

![Screenshot from 2024-05-13
16-30-36](https://github.com/alshedivat/al-folio/assets/31376482/66262b56-2744-475d-b09f-2cb65210017b)

---

## Light version

![Screenshot from 2024-05-13
16-30-44](https://github.com/alshedivat/al-folio/assets/31376482/a0eec50c-e7ac-4b52-aee8-2050bff05d54)

![Screenshot from 2024-05-13
16-30-50](https://github.com/alshedivat/al-folio/assets/31376482/41d72066-3e68-4ec3-bf3d-140da621f67b)

![Screenshot from 2024-05-13
16-30-55](https://github.com/alshedivat/al-folio/assets/31376482/613fd56e-7180-4373-ab7a-dfed184b5a18)

---------

Signed-off-by: George Araujo <george.gcac@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
karapostK pushed a commit to karapostK/karapostK.github.io that referenced this pull request Jul 4, 2024
Thank you @george-gca for the awesome work. on alshedivat#2415.

This PR generalizes the search on all collections. Currently, only
projects are added to the search.
This PR uses all of them, such as news. On my personal website, I use a
teaching collection which is then also automatically searched.
Suraj-Bhor pushed a commit to Suraj-Bhor/suraj-bhor.github.io that referenced this pull request Aug 13, 2024
Added support for search within the template as suggested in alshedivat#581. I
decided to go with a client side search based on [Ninja
keys](https://github.com/ssleptsov/ninja-keys), but using [deepdub's
fork](https://github.com/deepdub-ai/ninja-keys) as basis since it
supports fuzzy search.

Had to do a bunch of changes to their code to make it work without using
node to install everything. Also changed to use some colors defined in
our side and using both pages' titles and descriptions for search. Also
had to increase the template max width to better accomodate the new item
in navigation bar.

Missing implementations:
- [ ] One thing I'd love to do (but currently have no idea how) would be
to change the text next to the search button depending on the platform.
For example, if the user is accessing the site on a mac they should use
⌘k instead of ctrl k.
- [x] Test how this looks like (and how it is supposed to work) on
devices with smaller screens
- [x] Support for offline mode

Some screenshots:

---

## Dark version

![Screenshot from 2024-05-13
16-30-12](https://github.com/alshedivat/al-folio/assets/31376482/535acec5-dd7a-48cb-a17f-a295da98b5d3)

![Screenshot from 2024-05-13
16-30-26](https://github.com/alshedivat/al-folio/assets/31376482/6b2d94bb-3981-4252-ae2b-53994b514491)

![Screenshot from 2024-05-13
16-30-36](https://github.com/alshedivat/al-folio/assets/31376482/66262b56-2744-475d-b09f-2cb65210017b)

---

## Light version

![Screenshot from 2024-05-13
16-30-44](https://github.com/alshedivat/al-folio/assets/31376482/a0eec50c-e7ac-4b52-aee8-2050bff05d54)

![Screenshot from 2024-05-13
16-30-50](https://github.com/alshedivat/al-folio/assets/31376482/41d72066-3e68-4ec3-bf3d-140da621f67b)

![Screenshot from 2024-05-13
16-30-55](https://github.com/alshedivat/al-folio/assets/31376482/613fd56e-7180-4373-ab7a-dfed184b5a18)

---------

Signed-off-by: George Araujo <george.gcac@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Suraj-Bhor pushed a commit to Suraj-Bhor/suraj-bhor.github.io that referenced this pull request Aug 13, 2024
Thank you @george-gca for the awesome work. on alshedivat#2415.

This PR generalizes the search on all collections. Currently, only
projects are added to the search.
This PR uses all of them, such as news. On my personal website, I use a
teaching collection which is then also automatically searched.
meiqing-wang pushed a commit to meiqing-wang/meiqing-wang.github.io that referenced this pull request Oct 13, 2024
Added support for search within the template as suggested in alshedivat#581. I
decided to go with a client side search based on [Ninja
keys](https://github.com/ssleptsov/ninja-keys), but using [deepdub's
fork](https://github.com/deepdub-ai/ninja-keys) as basis since it
supports fuzzy search.

Had to do a bunch of changes to their code to make it work without using
node to install everything. Also changed to use some colors defined in
our side and using both pages' titles and descriptions for search. Also
had to increase the template max width to better accomodate the new item
in navigation bar.

Missing implementations:
- [ ] One thing I'd love to do (but currently have no idea how) would be
to change the text next to the search button depending on the platform.
For example, if the user is accessing the site on a mac they should use
⌘k instead of ctrl k.
- [x] Test how this looks like (and how it is supposed to work) on
devices with smaller screens
- [x] Support for offline mode

Some screenshots:

---

## Dark version

![Screenshot from 2024-05-13
16-30-12](https://github.com/alshedivat/al-folio/assets/31376482/535acec5-dd7a-48cb-a17f-a295da98b5d3)

![Screenshot from 2024-05-13
16-30-26](https://github.com/alshedivat/al-folio/assets/31376482/6b2d94bb-3981-4252-ae2b-53994b514491)

![Screenshot from 2024-05-13
16-30-36](https://github.com/alshedivat/al-folio/assets/31376482/66262b56-2744-475d-b09f-2cb65210017b)

---

## Light version

![Screenshot from 2024-05-13
16-30-44](https://github.com/alshedivat/al-folio/assets/31376482/a0eec50c-e7ac-4b52-aee8-2050bff05d54)

![Screenshot from 2024-05-13
16-30-50](https://github.com/alshedivat/al-folio/assets/31376482/41d72066-3e68-4ec3-bf3d-140da621f67b)

![Screenshot from 2024-05-13
16-30-55](https://github.com/alshedivat/al-folio/assets/31376482/613fd56e-7180-4373-ab7a-dfed184b5a18)

---------

Signed-off-by: George Araujo <george.gcac@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
meiqing-wang pushed a commit to meiqing-wang/meiqing-wang.github.io that referenced this pull request Oct 13, 2024
Thank you @george-gca for the awesome work. on alshedivat#2415.

This PR generalizes the search on all collections. Currently, only
projects are added to the search.
This PR uses all of them, such as news. On my personal website, I use a
teaching collection which is then also automatically searched.
avishekanand pushed a commit to avishekanand/al-folio-homepage that referenced this pull request Oct 22, 2024
Added support for search within the template as suggested in alshedivat#581. I
decided to go with a client side search based on [Ninja
keys](https://github.com/ssleptsov/ninja-keys), but using [deepdub's
fork](https://github.com/deepdub-ai/ninja-keys) as basis since it
supports fuzzy search.

Had to do a bunch of changes to their code to make it work without using
node to install everything. Also changed to use some colors defined in
our side and using both pages' titles and descriptions for search. Also
had to increase the template max width to better accomodate the new item
in navigation bar.

Missing implementations:
- [ ] One thing I'd love to do (but currently have no idea how) would be
to change the text next to the search button depending on the platform.
For example, if the user is accessing the site on a mac they should use
⌘k instead of ctrl k.
- [x] Test how this looks like (and how it is supposed to work) on
devices with smaller screens
- [x] Support for offline mode

Some screenshots:

---

## Dark version

![Screenshot from 2024-05-13
16-30-12](https://github.com/alshedivat/al-folio/assets/31376482/535acec5-dd7a-48cb-a17f-a295da98b5d3)

![Screenshot from 2024-05-13
16-30-26](https://github.com/alshedivat/al-folio/assets/31376482/6b2d94bb-3981-4252-ae2b-53994b514491)

![Screenshot from 2024-05-13
16-30-36](https://github.com/alshedivat/al-folio/assets/31376482/66262b56-2744-475d-b09f-2cb65210017b)

---

## Light version

![Screenshot from 2024-05-13
16-30-44](https://github.com/alshedivat/al-folio/assets/31376482/a0eec50c-e7ac-4b52-aee8-2050bff05d54)

![Screenshot from 2024-05-13
16-30-50](https://github.com/alshedivat/al-folio/assets/31376482/41d72066-3e68-4ec3-bf3d-140da621f67b)

![Screenshot from 2024-05-13
16-30-55](https://github.com/alshedivat/al-folio/assets/31376482/613fd56e-7180-4373-ab7a-dfed184b5a18)

---------

Signed-off-by: George Araujo <george.gcac@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
avishekanand pushed a commit to avishekanand/al-folio-homepage that referenced this pull request Oct 22, 2024
Thank you @george-gca for the awesome work. on alshedivat#2415.

This PR generalizes the search on all collections. Currently, only
projects are added to the search.
This PR uses all of them, such as news. On my personal website, I use a
teaching collection which is then also automatically searched.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants