liva-hugo icon indicating copy to clipboard operation
liva-hugo copied to clipboard

Search returns 404

Open xavierraffin opened this issue 2 years ago • 7 comments

I am running a blog with Liva and the search results page returns 404.

URL: https://visualping.io/blog/ Search result: https://visualping.io/blog/search?s=monitor

My config.toml:

######################## default configuration ####################
baseURL = "https://visualping.io/blog"
languageCode = "en-us"
title = "Visualping blog"
theme = "liva"
summaryLength = "20"
paginate = 6
disqusShortname = ""
relativeURL = "true"
DefaultContentLanguage = "en"


[outputs]
  home = ["HTML", "AMP", "RSS", "JSON"]

############################# Plugins ##############################
[params.plugins]

  # CSS Plugins
  [[params.plugins.css]]
  URL = "plugins/bootstrap/bootstrap.min.css"
  [[params.plugins.css]]
  URL = "plugins/slick/slick.css"
  [[params.plugins.css]]
  URL = "plugins/themify-icons/themify-icons.css"
  [[params.plugins.css]]
  URL = "plugins/venobox/venobox.css"

  # JS Plugins
  [[params.plugins.js]]
  URL = "plugins/jQuery/jquery.min.js"
  [[params.plugins.js]]
  URL = "plugins/bootstrap/bootstrap.min.js"
  [[params.plugins.js]]
  URL = "plugins/slick/slick.min.js"
  [[params.plugins.js]]
  URL = "plugins/venobox/venobox.min.js"
  [[params.plugins.js]]
  URL = "plugins/search/fuse.min.js"
  [[params.plugins.js]]
  URL = "plugins/search/mark.js"
  [[params.plugins.js]]
  URL = "plugins/search/search.js"


############################## navigation ###############################
[menu]

  # main menu
  [[menu.main]]
  name = "Home"
  URL = "https://visualping.io"
  weight = 1

  [[menu.main]]
  name = "Blog"
  URL = "/"
  weight = 2
...

#################### default parameters ################################
[params]
logo = "images/[email protected]"
logoDark = "images/logo-dark.png"
clock = "images/icon-clock.png"
home = "Home"
# Meta data
...

  # Preloader
  [params.preloader]
  enable = true
  preloader = "" # use .png , .svg or .gif format

  # search
  [params.search]
  enable = true



############################# social site ########################
[[params.social]]
title = "twitter"
icon = "ti-twitter-alt" # themify icon : https://themify.me/themify-icons
link = "https://twitter.com/intent/tweet?url="
...

################################ languages #############################

[languages]
  [languages.en]
    languageName = "English"
    contentDir = "content/en"
    title = "The Visualping Blog"
    weight = 1
    ...

Example search results (403 from S3 because the target file do not exist). It returns a 404 when running locally.

https://visualping.io/blog/search?s=monitor

Thank you very much for your help

xavierraffin avatar Sep 01 '21 21:09 xavierraffin

Hello @xavierraffin

Sorry for the late reply, I didn't notice this issue. I visit your site and didn't recognize the theme. Also, I noticed that your search still not working. can you tell me which theme you are using?

somratpro avatar Sep 26 '21 05:09 somratpro

Thank you for coming back to me @somratpro!

We use the theme from this current repo. See the theme.toml:

ame = "Liva Hugo"
license = "MIT"
licenselink = "https://github.com/themefisher/liva-hugo/blob/master/LICENSE"
description = "Hugo port of the Themefisher’s Liva Template"
homepage = "https://gethugothemes.com/shop/"
tags = ['landing-page', 'fast', 'light', 'white', 'modern', 'themefisher', 'hugo-theme', 'hugo-templates', 'bootstrap', 'blog', 'responsive', 'clean', 'simple', 'creative', 'contact-form', 'custom-themes', 'mobile', 'minimalistic', 'pages', 'resume', 'portfolio', 'google analytics', 'customizable', 'flexbox', 'presentation', 'product', 'theme', 'typography']
features = ['bootstrap','responsive']
min_version = "0.58.0"

[author]
  name = "Themefisher"
  homepage = "https://themefisher.com/"

We made some graphical customization from the original. But I don't know how the search is supposed to work, and was trying to get help here.

xavierraffin avatar Sep 27 '21 16:09 xavierraffin

Hey @xavierraffin

I check our live demo, and the search is working fine. I think you messed up with search when you customized this theme. Probably you removed the search.md file from content folder. I want to let you know that, we give custom support, if you are interested, you can contact at [email protected]. thank you

somratpro avatar Sep 28 '21 04:09 somratpro

@somratpro @tfsomrat I am facing the same issue. And I forked it from the original repo but still search doesn't work. How can I fix it? @xavierraffin how did you fix it?

Ankit-Gupta18 avatar Jun 13 '22 03:06 Ankit-Gupta18

@Ankit-Gupta18 it was a problem with Hugo Liva and our CDN, the path for search was not transmitted properly:

Here is the code change:

in blog/themes/liva/layouts/partials/header.html:

---            <form action="{{ .Site.BaseURL }}/search" class="h-100">
+++          <form action="{{ .Site.BaseURL }}search/" class="h-100">

xavierraffin avatar Jun 13 '22 16:06 xavierraffin

@Ankit-Gupta18 it was a problem with Hugo Liva and our CDN, the path for search was not transmitted properly:

Here is the code change:

in blog/themes/liva/layouts/partials/header.html:

---            <form action="{{ .Site.BaseURL }}/search" class="h-100">
+++          <form action="{{ .Site.BaseURL }}search/" class="h-100">

image Still this.. Any more change?

Ankit-Gupta18 avatar Jun 13 '22 16:06 Ankit-Gupta18

I just tried it and their search seems to work just fine.

sugardayfox avatar Nov 19 '22 14:11 sugardayfox