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

Lunr search on development uses wrong url #2225

Closed
lsolesen opened this issue Aug 2, 2019 · 7 comments
Closed

Lunr search on development uses wrong url #2225

lsolesen opened this issue Aug 2, 2019 · 7 comments

Comments

@lsolesen
Copy link
Contributor

lsolesen commented Aug 2, 2019

Environment

Expected behavior

That the correct link is used in search on development.

Steps to reproduce the behavior

All links on the site works except for the prepended baseurl in Lunr search - there it sets http://localhost:8080 when I am on my development environment AWS Cloud9. When the true baseurl is something like this: https://a-complicated-id.vfs.cloud9.eu-west-1.amazonaws.com/

Other

@mmistakes
Copy link
Owner

Not sure I follow what the issue is. I don't see a baseurl defined in your _config.yml.

@lsolesen
Copy link
Contributor Author

lsolesen commented Aug 2, 2019 via email

@mmistakes
Copy link
Owner

I'm still not following what your issue is. What links don't have the correct baseurl?

@lsolesen
Copy link
Contributor Author

lsolesen commented Aug 2, 2019 via email

@mmistakes
Copy link
Owner

mmistakes commented Aug 3, 2019

baseurl works as intended for me in the /test site when running locally.

What are you setting as your baseurl when testing? I see above you mentioned https://a-complicated-id.vfs.cloud9.eu-west-1.amazonaws.com/. If that's the case then that could be your problem as baseurl is meant to be used as a subfolder and not the domain. url would be the correct usage for what you're trying to achieve. See this blog post from a Jekyll maintainer on its correct usage.

There is a small caveat when setting url as well. Jekyll runs in JEKYLL_ENV=development by default and it overwrites whatever you set to the localhost server address. The only way to keep the url you've set is by running Jekyll in production mode with JEKYLL_ENV=production.

How to set environments are covered in their documentation.

@stale
Copy link

stale bot commented Sep 2, 2019

This issue has been automatically marked as stale because it has not had recent activity.

If this is a bug and you can still reproduce this error on the master branch, please reply with any additional information you have about it in order to keep the issue open.

If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.

This issue will automatically be closed in 7 days if no further activity occurs. Thank you for all your contributions.

@stale stale bot added the Status: Stale label Sep 2, 2019
@stale stale bot closed this as completed Sep 9, 2019
@iveney
Copy link

iveney commented Jan 29, 2021

hmmm, I may be running into this after I upgraded to jekyll 4.2.0.

When using bundle exec jekyll serve, everything is resolved correctly to use http://localhost:4000, except the search result, which is the actual url of my site http://www.ivansiu.com.

If I remove the url: "https://www.ivansiu.com" line in my _config.yml then it works.

Reproducible here

Ivan_Xiao

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

No branches or pull requests

3 participants