All Projects → kaushalmodi → hugo-search-fuse-js

kaushalmodi / hugo-search-fuse-js

Licence: GPL-3.0 license
Hugo theme component for implementing static site search using Fuse.js

Programming Languages

HTML
75241 projects
javascript
184084 projects - #8 most used programming language
emacs lisp
2029 projects
shell
77523 projects

Projects that are alternatives of or similar to hugo-search-fuse-js

hugo-atom-feed
Hugo theme component for ATOM feed custom Output Format
Stars: ✭ 29 (-44.23%)
Mutual labels:  hugo, hugo-theme-component, custom-output-format
hugo-shortcodes-netlify-cms
Shortcodes of Hugo for Netlify CMS Text Editor
Stars: ✭ 50 (-3.85%)
Mutual labels:  hugo, hugo-theme-component
hugo-component-matomo
Matomo user tracking and optout scripts for Hugo
Stars: ✭ 38 (-26.92%)
Mutual labels:  hugo, hugo-theme-component
hugo-cloak-email
A Hugo theme component to cloak email adresses
Stars: ✭ 71 (+36.54%)
Mutual labels:  hugo, hugo-theme-component
hugo-notice
A Hugo theme component to display nice notices
Stars: ✭ 138 (+165.38%)
Mutual labels:  hugo, hugo-theme-component
hugo-theme-massively
Massively theme for Hugo static site generator
Stars: ✭ 113 (+117.31%)
Mutual labels:  hugo
hugo-tania
A simple theme for bloggers.
Stars: ✭ 159 (+205.77%)
Mutual labels:  hugo
68Keys.io
Build your own 68% Custom Mechanical Keyboard.
Stars: ✭ 56 (+7.69%)
Mutual labels:  hugo
hugo-dusk
Simple, minimalistic dark theme for Hugo.
Stars: ✭ 50 (-3.85%)
Mutual labels:  hugo
HugoStructuredData
Collection of structured data snippets in Google preferred JSON-LD format, with support for Hugo
Stars: ✭ 33 (-36.54%)
Mutual labels:  hugo
hugo-hello-programmer-theme
This is a hugo theme for a programmer. It's simple and simple.
Stars: ✭ 40 (-23.08%)
Mutual labels:  hugo
Dockers
https://hub.docker.com/r/chenhw2/
Stars: ✭ 42 (-19.23%)
Mutual labels:  hugo
hyde-hyde
A cool theme inspired by spf13's Hyde theme
Stars: ✭ 234 (+350%)
Mutual labels:  hugo
navigator-hugo
Navigator Business theme powered by Hugo. It also could be used for a personal portfolio.
Stars: ✭ 133 (+155.77%)
Mutual labels:  hugo
hugo-minimalist-theme
Port of Raphael Riegger's Minimalistic Ghost theme to Hugo.
Stars: ✭ 25 (-51.92%)
Mutual labels:  hugo
hugo-action
Commands to help with building Hugo based static sites
Stars: ✭ 65 (+25%)
Mutual labels:  hugo
hugoinaction
Website for and source code accompanying Hugo In Action
Stars: ✭ 63 (+21.15%)
Mutual labels:  hugo
obyde
A minimal tool to convert a "standardly" configured Obsidian vault to a Jekyll or Hugo blog.
Stars: ✭ 38 (-26.92%)
Mutual labels:  hugo
capsule
A Hugo theme based on the CSS-only Bulma framework.
Stars: ✭ 20 (-61.54%)
Mutual labels:  hugo
web-content
ReactOS Website powered by the Hugo Static Site Generator
Stars: ✭ 25 (-51.92%)
Mutual labels:  hugo

Hugo live search using Fuse.js and Mark.js

This is not a standalone theme. This is a Hugo theme component.

To use this component,

  1. Add this to your site's TOML config file:

    [module]
      [[module.imports]]
        path = "github.com/kaushalmodi/hugo-search-fuse-js"
  2. Run hugo mod tidy in your main site directory. The main site repo needs to be a Hugo module as well (it needs to have its own go.mod). To make it one, run hugo mod init <your site url or any unique string> in your site repo before you do this step.

  3. Create content/search.md with layout parameter set to "search", and output parameter set to ["html", "json"]. The content or body of this search.md is not used by the search.html template which is part of this theme component.

    Here is an example search.md:

    +++
    title = "Search"
    layout = "search"
    outputs = ["html", "json"]
    [sitemap]
      priority = 0.1
    +++

Requirements

You need to install the latest version of Go from https://go.dev/doc/install because this theme component requires hugo mod .. commands to work.

This update on switch to using Hugo Modules was last tested with Hugo v0.92.0.

  1. Your main theme must be structured using base template and blocks, and
  2. The base template needs to define main and footer blocks (shown in that previous link).

If the main theme does not meet these requirements, you will need to edit the search.html partial to make search work. You can find it in layouts/_default/search.html in this component.

What if the main theme does not have baseof.html?

You have two options:

  1. Edit the search.html to make it fit your theme.
  2. Upgrade the theme to use the new "base template and blocks" approach.

What if the main theme has baseof.html, but doesn't have the main and/or footer blocks?

It's very easy to add those blocks without breaking your existing theme.

To add the main block, add this to your baseof.html at the appropriate place:

{{ block "main" . }}{{ end }}

And similarly add the below if the footer block is missing:

{{ block "footer" . }}{{ end }}

For an example, see the baseof.html snippet in Hugo docs.

Credits

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].