jekyll / jekyll-admin

A Jekyll plugin that provides users with a traditional CMS-style graphical interface to author content and administer Jekyll sites.
https://jekyll.github.io/jekyll-admin/
MIT License
2.82k stars 357 forks source link

Preview of the images does not work in production #622

Closed damienlethiec closed 3 years ago

damienlethiec commented 3 years ago

Description:

Hi there,

I am trying to preview my images in the assets in the admin. Unfortunately, the path used for the preview is the localhost one (ex: http://localhost:4000/assets/img/2EN1.png for the first image) and not the prod one. So the images do not appear.

image

Am I missing something ? It is a bug or do I need to configure something (I cannot find doc about it)?

Thanks so much !

Tell us a bit about yourself:

Steps to reproduce:

Go to your assets images in the admin

I expected the following:

I should see a preview of my images

But got the following, instead:

The images are not previewed as the path is the localhost one.

ashmaroli commented 3 years ago

When you say "in production", are you implying that JEKYLL_ENV is something other than development?

Theoretically, Jekyll Admin is meant as an aid during development, and hence why it piggy-backs the development environment of jekyll serve command.

damienlethiec commented 3 years ago

Well, I think for the moment I do not publish with a specific JEKYLL_ENV environment. I just set the base url in my config file. I can change the JEKYLL_ENV without problem if it allow me to see the previews.

But if I understand well, you say that Jekyll does not use the environment (or better, the value in config file) but use localhost by default?! Is that it? Would it be possible to adapt it? I am sure I am not alone using Jekyll admin in production :)

I allow saw this PR (from you) --> https://github.com/jekyll/jekyll-admin/pull/529 It seems related.

Thanks so much for the help

ashmaroli commented 3 years ago

Ah! Now the issue is bit more clear. The issue is not because of use in production, but due to the use of a baseurl.

Jekyll Admin does not support baseurl yet.

damienlethiec commented 3 years ago

Well, to be more precise, we do not use base_url but base. Below is an extract of my config. Do you know if I can make the preview work in this context?

url: "https://the-green-emporium.hashbang.fr/" # the base hostname & protocol for your site, e.g. http://example.com
baseurl: "" # the subpath of your site, e.g. /blog
base: "https://the-green-emporium.com"
encoding: utf-8
title: "The Low Tech Emporium" # the name of your site, e.g. ACME Corp.
tagline: "Le site low tech de The Green Emporium"

Thanks so much !

ashmaroli commented 3 years ago

Do you know if I can make the preview work in this context?

If you can set up a public test repository that I can easily clone at my end and reproduce this issue exactly, then perhaps I could suggest solution(s) or workarounds.

damienlethiec commented 3 years ago

Sure, the repo is public --> https://github.com/aventure-bio/the-low-tech-emporium

In case, here is a second issue I had --> https://github.com/jekyll/jekyll-admin/issues/621

Have a great day !

ashmaroli commented 3 years ago

I played with your repository with multiple versions of Jekyll — and unfortunately could not reproduce this issue.

damienlethiec commented 3 years ago

Well locally it works. In localhost. Have you tried online, with a github pages url for example?

ashmaroli commented 3 years ago

Have you tried online, with a github pages url for example?

No, I did not since Jekyll Admin wasn't designed to be used on the remote domain behind an auth layer.

damienlethiec commented 3 years ago

Yes, so this is the problem. Can you do anything? And for this issue (with is not linked): #621 ?

Thanks a lot

jekyllbot commented 3 years ago

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the master branch, please reply with all of the 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 two months if no further activity occurs. Thank you for all your contributions.