Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search returns 404 #44

Open
xavierraffin opened this issue Sep 1, 2021 · 7 comments
Open

Search returns 404 #44

xavierraffin opened this issue Sep 1, 2021 · 7 comments

Comments

@xavierraffin
Copy link

xavierraffin commented Sep 1, 2021

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/logo-blue@2x.png"
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

@somratpro
Copy link
Contributor

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?

@xavierraffin
Copy link
Author

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.

@somratpro
Copy link
Contributor

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 mehedi@themefisher.com. thank you

@Ankit-Gupta18
Copy link

@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?

@mehedi-sharif mehedi-sharif reopened this Jun 13, 2022
@xavierraffin
Copy link
Author

@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">

@Ankit-Gupta18
Copy link

@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?

@sugardayfox
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants