Hi!
I set up a page “Search” on my microblog that I am testing here https://notes.nicfab.it
However, as you can see, if you input any character, the search doesn’t work.
The config.toml contains the following lines:
[[languages.en.menu.main]]
name = "Search"
pageref = "page/search"
weight = 4
…
[[languages.it.menu.main]]
name = "Search"
pageref = "page/search"
weight = 4
I created two pages that are respectively under content/english/page and under content/italian/page with the following declaration:
---
title: "Search" # in any language you want
layout: "search" # is necessary
# url: "/archive"
# description: "Description for Search"
summary: "search"
placeholder: "placeholder text in search input box"
---
Have you checked out the theme’s documentation on GitHub?
There is a section about search not working over here
Perhaps you would get a more informed answer if you asked directly at the theme repo, so that the people who maintain and contribute to the theme can guide you.
Thank you very much.
I already did what you suggest.
Unfortunately, no answers from the repo.
I already modified the file as suggested by the developer.
Really, I was wondering if did something wrong.
I modified the file fastsearch.js as indicated by the developer and I copied it in layout/assets/js because that file is in themes/PaperMod/assets/js
I hope to have done the right thing
I was trying to keep organized both pages and posts, creating the following folders: /content/english/page /content/english/post /content/italian/page /content/italian/post
However, with this setting, the search doesn’t work.
So, I moved all the pages files under /content, distinguishing the Italian ones as filename.it.md.
Thus, I created two folders and precisely /content/post and /content/post_it where I saved the English and the Italian, respectively.
In this way, the search works properly.
Anyway, I hope to find a solution to keep organized the work.
You can have more than one content directories in a Hugo project.
In your case, one for the English markdown files and another one for the Italian files.
First you would need to install Go in your system.
On an M1 Mac I use the following:
curl -O https://dl.google.com/go/go1.17.5.darwin-arm64.tar.gz
tar -xvf go1.17.5.darwin-arm64.tar.gz
sudo mv go /usr/local
go version
rm go1.17.5.darwin-arm64.tar.gz
The answer to your question depends on the server setup.
If you are just publishing to a plain Ubuntu server why not execute hugo locally and use rsync or something similar to upload the static files and keep them in sync?
If you are using Docker or some kind of CI service, then yes you will have to install Go in the build image. For example Netlify’s build images come with Go installed.
I tried but the search doesn’t work.
As I wrote, the issue related to the search feature is related to the theme PaperMod that I am using.
Setting the folders by language impede the correct working of the search feature.
If you know a powerful theme instead of PaperMod (I mean that allows the search, social, and some other stuff), please let me know.
Thank you again