Categorygithub.com/yinyajun/hugo_algolia_search
repositorypackage
0.0.0-20250102052830-e9e408b45dc2
Repository: https://github.com/yinyajun/hugo_algolia_search.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

hugo_algolia_search

Due to algolia record size limit, we need to chunk our post to reduce index record size.

How to use?

  1. Build your hugo site, e.g. ~/blog
  2. In your hugo config, e.g. ~/blog/config.toml, set like this:
    [params]
    algoliaAppId = "*****"
    algoliaApiKey = "**********"
    algoliaIndexName = "****"
    
    Note APIKey should be accessible to write Algolia index.
  3. Write some posts, e.g. ~/blog/content/history/a.md, here history is a section.
  4. Run following golang code
    package main
    
    import "github.com/yinyajun/hugo_algolia_search"
    
    func main() {
    	search.Root = "~/blog"
    	search.BuildIndex("history")
    }