
Research
Malicious fezbox npm Package Steals Browser Passwords from Cookies via Innovative QR Code Steganographic Technique
A malicious package uses a QR code as steganography in an innovative technique.
bridgetown-quick-search
Advanced tools
This [Bridgetown](https://www.bridgetownrb.com) plugin provides a component you can add to your site (likely the top navbar) to allow fast, real-time search of your posts, pages, and other collection documents. It automatically generates a JSON index file
This Bridgetown plugin provides a component you can add to your site (likely the top navbar) to allow fast, real-time search of your posts, pages, and other collection documents. It automatically generates a JSON index file which gets built along with the rest of the site, and then the component consumes that file and uses Lunr.js to construct the live search index and provide the search results as you type.
Run this command to add this plugin to your site's Gemfile:
$ bundle add bridgetown-quick-search
And then add the initializer to your configuration in config/initializers.rb
:
init :"bridgetown-quick-search"
Next, add this line to the top of your frontend's Javascript index file:
// frontend/javascript/index.js
import "bridgetown-quick-search"
Then add the Liquid component to one of your site templates, for example src/_components/navbar.liquid
:
{% render "bridgetown_quick_search/search" %}
If you're using a Ruby-based template (ERB, etc.), you can use the liquid_render
helper:
<%= liquid_render "bridgetown_quick_search/search" %>
You can provide additional Liquid variables to the component to configure its appearance. These are:
placeholder
: Text that will appear in the input control when no search value is presentinput_class
: Add custom CSS class names to the input controltheme
: The component's default theme is a "light" appearance, but you can also set it to use a "dark" appearancesnippet_length
: The length of the text snippet for each search result. Defaults to 142.display_collection
: Will show collections to which belong search results if true. Defaults to false.Here's an example of using all variables at once:
{% render "bridgetown_quick_search/search", placeholder: "Search", input_class: "input", theme: "dark", snippet_length: 200, display_collection: true %}
You can use CSS variables to control aspects of the search results popup. The popup is rendered inside of a Web Component using Shadow DOM, so these variables are the primary method of altering its appearance. The available variables are link-color
, divider-color
, text-color
, border-radius
and border-corner-radius
.
bridgetown-search-results {
--link-color: #0f5348;
--divider-color: #e6e1d7;
--text-color: #3e3f3a;
}
You can also alter the outer popup container via the custom element directly, as well as the wrapper surrounding the results contents using CSS Shadow Parts:
bridgetown-search-results {
/* Adjust the outer container of the popup */
}
bridgetown-search-results::part(inner) {
/* Adjust the popup contents wrapper */
}
bridgetown-search-results::part(inner-link) {
/* Adjust the link style of each search result */
}
You can provide additional front matter variables to any page or document to control the search index. These are:
exclude_from_search: true
: Setting this will exclude that item from the search index JSON. To batch-exclude pages, collections, categories, etc., you could use front matter defaults to set the exclude_from_search
variable.quick_search_content: "content for the index"
: Setting this will override the content in the search index JSON. Normally the content in the search index JSON is the content of the page. Setting this front matter variable explicilty sets the content in the search index JSON.bundle exec rspec
to run the test suitescript/cibuild
to validate with Rubocop and test with rspec together.git clone
to your local development machine.git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)3.0.3 / 2024-07-30
FAQs
This [Bridgetown](https://www.bridgetownrb.com) plugin provides a component you can add to your site (likely the top navbar) to allow fast, real-time search of your posts, pages, and other collection documents. It automatically generates a JSON index file
We found that bridgetown-quick-search demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.
Application Security
/Research
/Security News
Socket detected multiple compromised CrowdStrike npm packages, continuing the "Shai-Hulud" supply chain attack that has now impacted nearly 500 packages.