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

Images does not show on draft article #1639

Closed
luzfcb opened this issue Feb 23, 2015 · 6 comments
Closed

Images does not show on draft article #1639

luzfcb opened this issue Feb 23, 2015 · 6 comments

Comments

@luzfcb
Copy link

luzfcb commented Feb 23, 2015

When I use the :status: draft

due to the url of generated image is relative, the image is not found because draft articles staying in url http://foodomain.com/drafts

would not want to have to manage another folder for images.

I would simply remove : status: draft from article and the article be published, without the need to stay renaming folders and moving static files

if this is expected behavior, it is not documented:
http://docs.getpelican.com/en/3.5.0/content.html?highlight=draft#publishing-drafts

@avaris
Copy link
Member

avaris commented Feb 24, 2015

Can you show your settings file and how you link to static content?

@luzfcb
Copy link
Author

luzfcb commented Feb 24, 2015

@avaris all blog: https://github.com/pythonclub/pythonclub.github.io
https://github.com/pythonclub/pythonclub.github.io/blob/pelican/pelicanconf.py

https://github.com/pythonclub/pythonclub.github.io/blob/pelican/content/changing-tuples-pt_BR.rst

To test:

git clone --recursive https://github.com/pythonclub/pythonclub.github.io
cd pythonclub.github.io
mkvirtualenv pythonclub
pip install -r requirements.txt
make devserver

and
open: http://127.0.0.1:8000/drafts/tuplas-mutantes-em-python.html

@avaris
Copy link
Member

avaris commented Feb 24, 2015

Right, I suspected it might be the case. You're not using {filename} syntax to link to your internal content. That would solve both your issues (this and #1640).

You should do:

.. image:: {filename}images/ramalho/Tweedledum-Tweedledee_500x390.png

instead of

.. image:: images/ramalho/Tweedledum-Tweedledee_500x390.png

@luzfcb
Copy link
Author

luzfcb commented Feb 24, 2015

@avaris oh. Sorry, and thank you for pointing out my mistake.

As I am not a fluent speaker of the English language and the vast majority of blog collaborators of PythonClub colaborative blog also are not. Some things due to my still little knowledge in English language, yet are not very clear.

I think the real problem is the documentation. The documentation is inconsistent as to the examples. Some examples are shown only in Markdown version and others only in reStructuredText.

So it would be good to show examples in both, in Markdown and in reStructuredText

That Said,
.. image:: images/ramalho/Tweedledum-Tweedledee_500x390.png

is a reStructuredText valid sintax .

It would be possible to include a warning, showing that it is not recommended this syntax when using Pelican and talking to be insert {filename} text before the normal way

@justinmayer
Copy link
Member

Hi @luzfcb. Thanks for your comments. Some thoughts...

I think the real problem is the documentation. The documentation is inconsistent as to the examples. Some examples are shown only in Markdown version and others only in reStructuredText.

So it would be good to show examples in both, in Markdown and in reStructuredText

This gets cumbersome to do everywhere, and it doesn't scale. Should we include examples for Asciidoc, too? What if we support Textile in the future? Do we include that, too?

That Said,
.. image:: images/ramalho/Tweedledum-Tweedledee_500x390.png
is a reStructuredText valid sintax .

Sure... IF you are trying to link to your generated output as it appears on your live site — e.g., http://example.com/images/ramalho/Tweedledum-Tweedledee_500x390.png. But that's not what you're trying to here, is it? I get the impression you are instead trying to link to your source content — i.e., ~/projects/pythonclub/content/images/ramalho/Tweedledum-Tweedledee_500x390.png. If that is indeed what you are trying to do, then your "this is valid syntax" argument does not apply, and you should use the intrasite link syntax that @avaris suggested.

It would be possible to include a warning, showing that it is not recommended this syntax when using Pelican and talking to be insert {filename} text before the normal way

I don't think that is a good idea. Intrasite link syntax is optional, so the warning you suggest would be spurious and annoying to everyone who does not use intrasite links.

@ingwinlu
Copy link
Contributor

also we actually do have examples for md AND rst in the docs: http://pelican.readthedocs.org/en/latest/content.html#linking-to-internal-content

the only problem here is as @justinmayer pointed out that you don't seem to grasp the difference between a link to somewhere and a 'internal' link which will be translated by pelican to the final url of the content you 'linked' via the {filename} syntax

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

4 participants