Comments (4)
Hey @fgiorlando
Go check this https://matcornic.github.io/hugo-learn-doc/basics/configuration/ and this https://matcornic.github.io/hugo-learn-doc/basics/installation/
[params]
# Prefix URL to edit current page. Useful to give opportunity to people to create merge request for your doc.
# See the config.toml file from this documentation site to have an example.
editURL = ""
# Author of the site, will be used in meta information
author = ""
# Description of the site, will be used in meta information
description = ""
# Shows a checkmark for visited pages on the menu. Default to false
showVisitedLinks = false
# Automatically generates prev and next arrows
autoNav = false
# Activate search. Don't forget to generate the JSON index file (go check get started page)
search = false
Basically, you have to:
- Activate search by setting
search = true
parameter, but inside aparams
"section" (Ex: https://github.com/matcornic/hugo-learn-doc/blob/master/config.toml#L7) - Generate json index. Instead of using grunt, you could use hugo-lunr project directly : https://matcornic.github.io/hugo-learn-doc/basics/installation/#enable-search-functionality (Ex: index NPM script in https://github.com/matcornic/hugo-learn-doc/blob/master/package.json)
You should find everything you need on the documentation. And if you need a real life working example, the repo is here.
from hugo-theme-learn.
Thanks for the tips, I have now put the search config in a [params]
section and the search box appears.
I am a little new to using node so I have what may be an obvious question: when I install hugo-lunr with npm install lunr-hugo
, it installs fine. However, I can't run lunr-hugo
as I get the error: -bash: lunr-hugo: command not found
.
Do I have to set some path settings?
from hugo-theme-learn.
npm install -g lunr-hugo
, and it should work.
from hugo-theme-learn.
thanks @matcornic, that fixed it!
Sorry I know it was pretty obvious, I'm a bit of a node nube!
I'm impressed by how fast hugo is, I had previously built exactly the same site with grav and it's so much faster now
from hugo-theme-learn.
Related Issues (20)
- New Release to address the solved issues HOT 4
- Issue with setting landingPageURL being reliant on languages HOT 1
- Google Analytics in the exampleSite HOT 1
- Update Mermaid version HOT 2
- Font licensing? HOT 1
- Text-align left for chapters
- Create Handout HOT 1
- Search function not working as expected HOT 1
- Custom Header and Footer Rendering Under Sidebar HOT 1
- override global ordersectionsby on a per section basis? HOT 1
- disable copy-to-clipboard on a per code block basis? HOT 1
- i18n translation by content directory HOT 1
- mindmaps in mermaid (feature request ) HOT 1
- Attachments URL wrong if site is deployed under subpath
- link of logo not pointing to basepath HOT 1
- Synology Docker configuration & firewall HOT 1
- A Few Questions HOT 2
- What are people migrating too? HOT 2
- Global Markdown link references HOT 1
- Please change the default baseURL
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hugo-theme-learn.