question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Jekyll url is not applied to the View button

See original GitHub issue

Description:

Pressing the View button in the admin panel the URL is pointing to http://localhost:4000. But I’m behind a reverse proxy called Nginx.

Tell us a bit about yourself:

  • Version of JekyllAdmin I’m using: 0.10.2
  • Version of Jekyll I’m using: 4.1.1
  • Version of NodeJS I’m using: v14.15.0
  • Operating System <e.g. OS X, Windows>: Linux!
  • Browser <e.g, Safari, Chrome>: Firefox!

Steps to reproduce:

  1. Setup Jekyll as normal
  2. Configure _config.yml file, and set url key to: url: "https://yourdomain.com" (baseurl is just “/”)
  3. Configure Nginx to use yourdomain.com as server_name in Nginx with a location / section containing at least: proxy_pass http://localhost:4000;
  4. Go to admin panel: https://yourdomain.com/admin
  5. Press the View button
  6. Links goes to http://localhost:4000/jekyll/update/2020/11/19/welcome-to-jekyll.html, which will NOT work.

I expected the following:

I expect the View links to take the url settings into account. The link example above, should go to:

https://yourdomain.nl/jekyll/update/2020/11/19/welcome-to-jekyll.html

But got the following, instead:

http://localhost:4000/jekyll/update/2020/11/19/welcome-to-jekyll.html

I think it shouldn’t be that hard to get this solved, I hope 👍🏽 ?

Regards, Melroy van den Berg

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
i-a-ncommented, Nov 25, 2020

this has been brought up a few times I believe, and I have yet to see an official response. I was able to get this working on my personal fork, however I do not believe my method (hijacking the URLable library to look for a special Jekyll config param) is necessarily a good answer for this project.

you can see my personal hack at this commit:

lib/jekyll-admin/urlable.rb
    def scheme
      JekyllAdmin.site.config["static_scheme"] || "http"
    end

    def host
      JekyllAdmin.site.config["static_host"] || JekyllAdmin.site.config["host"].sub("127.0.0.1", "localhost")
    end

    def port
      JekyllAdmin.site.config["static_port"] || JekyllAdmin.site.config["port"]
    end

… then on my Jekyll install:

_config.yml
static_scheme: https
static_host: [my domain name]
static_port: "443"

this got things working for me 👍

2reactions
ashmarolicommented, Nov 27, 2020

Would you approve this?

I would approve a tested Pull Request that proposes use of JekyllAdmin.site.config["jekyll_admin"][key] instead.

Read more comments on GitHub >

github_iconTop Results From Across the Web

View button links to 0.0.0.0 · Issue #460 · jekyll/jekyll-admin
Open web browser FROM ANOTHER COMPUTER on the computer public IP, edit a page, then click on the View button.
Read more >
View Markdown button on posts page - Help - Jekyll Talk
I'm having trouble wrapping my head around how the Markdown button needs to create the Liquid//Kramdown in order to open the _posts/....md file ......
Read more >
Github Pages jekyll not loading CSS when using custom domain
The problem is, as always, that the CSS path is not set correctly. If you use a custom domain, then please run locally...
Read more >
How To Control URLs and Links in Jekyll - DigitalOcean
In Part 3 of this series, we look at how Jekyll creates URLs and show how to change the pattern for an individual...
Read more >
Exploring Jekyll Basics via a Blog | go-go gh-pages! - evanwill
“Repository name”, since this will be your new example blog and be part of the URL, think a bit about what you want...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found