wrong path to image #975

Closed
PhML opened this Issue Jul 26, 2013 · 9 comments

Comments

Projects
None yet
3 participants

PhML commented Jul 26, 2013

With the following content:

.. image:: /images/DSC_0702_v1.TIFF

`a link relative to content root <|filename|/images/DSC_0702_v1.TIFF>`_

.. image:: images/DSC_0702_v1.TIFF

.. image:: |DSC_0761.JPG|/images/DSC_0761.JPG

I have the link working well, but no image.
make servdev says:

127.0.0.1 - - [26/Jul/2013 15:21:21] code 404, message File not found
127.0.0.1 - - [26/Jul/2013 15:21:21] "GET /images/DSC_0702_v1.TIFF HTTP/1.1" 404 -

And in the final html file:

</footer><!-- /.post-info -->      <img alt="/images/DSC_0702_v1.TIFF" src="/images/DSC_0702_v1.TIFF" />
<p><a class="reference external" href="./static/images/DSC_0702_v1.TIFF">a link relative to content root</a></p>

we can see that for the image, the path is /images… while for the like it is well ./static/images…

With Pelican 3.2.2 and python 2.7.5.

Owner

justinmayer commented Jul 26, 2013

Do you have RELATIVE_URLS set to True?

As an aside, the /static/ path handling was improved in #795, which is present in current master and due to be included in the next Pelican release.

Owner

justinmayer commented Jul 29, 2013

Hi @PhML. Is there anything further we can do to assist you with this?

PhML commented Jul 29, 2013

I tried with and without RELATIVE_URLS set to True, it changes nothing.
I tried to install pelican from source, but I obtain an error:

pip install -e git://github.com/getpelican/pelican#egg=pelican
fatal: read error: Connection reset by peer
fatal: early EOF
fatal: index-pack failed
Obtaining pelican from git+git://github.com/getpelican/pelican#egg=pelican
  Cloning git://github.com/getpelican/pelican to ./src/pelican
  Complete output from command /usr/bin/git clone -q git://github.com/getpelican/pelican /home/phml/virtualenvs/pelican-git/src/pelican:

----------------------------------------
Command /usr/bin/git clone -q git://github.com/getpelican/pelican /home/phml/virtualenvs/pelican-git/src/pelican failed with error code 128 in None
Storing complete log in /home/phml/.pip/pip.log

and content of pip.log:

/home/phml/virtualenvs/pelican-git/bin/pip run on Tue Jul 30 01:16:57 2013
Obtaining pelican from git+git://github.com/getpelican/pelican#egg=pelican

Cloning git://github.com/getpelican/pelican to ./src/pelican

Found command 'git' at '/usr/bin/git'
Running command /usr/bin/git clone -q git://github.com/getpelican/pelican /home/phml/virtualenvs/pelican-git/src/pelican
Complete output from command /usr/bin/git clone -q git://github.com/getpelican/pelican /home/phml/virtualenvs/pelican-git/src/pelican:


----------------------------------------

Command /usr/bin/git clone -q git://github.com/getpelican/pelican /home/phml/virtualenvs/pelican-git/src/pelican failed with error code 128 in None

Exception information:
Traceback (most recent call last):
File "/home/phml/virtualenvs/pelican-git/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/basecommand.py", line 139, in main
    status = self.run(options, args)
File "/home/phml/virtualenvs/pelican-git/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/commands/install.py", line 266, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/home/phml/virtualenvs/pelican-git/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/req.py", line 1003, in prepare_files
    req_to_install.update_editable(not self.is_download)
File "/home/phml/virtualenvs/pelican-git/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/req.py", line 395, in update_editable
    vcs_backend.obtain(self.source_dir)
File "/home/phml/virtualenvs/pelican-git/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/vcs/git.py", line 112, in obtain
    call_subprocess([self.cmd, 'clone', '-q', url, dest])
File "/home/phml/virtualenvs/pelican-git/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/util.py", line 662, in call_subprocess
    % (command_desc, proc.returncode, cwd))
InstallationError: Command /usr/bin/git clone -q git://github.com/getpelican/pelican /home/phml/virtualenvs/pelican-git/src/pelican failed with error code 128 in None
Owner

justinmayer commented Jul 29, 2013

Hmm. Not sure what's causing that error. Perhaps you might instead try the method described in our Setting Up the Development Environment instructions.

Owner

kylef commented Jul 31, 2013

The command works for me, perhaps your version of git is before they supported repositories without the .git suffix. Try pip install -e http://github.com/getpelican/pelican.git#egg=pelican.

Owner

justinmayer commented Aug 1, 2013

I took the liberty of adjusting the pip editable URL in the docs via 4c1b5c3.

PhML commented Aug 2, 2013

I installed from the Setting Up the Development Environment instructions, it worked. But still no images on my pages. I am the only one for whom it does not work?

It tried to install on another computer via pip (both pip install pelican and pip install -e git://github.com/getpelican/pelican#egg=pelican)but I had some troubles:

Downloading/unpacking pytz (from pelican)

Could not find a version that satisfies the requirement pytz (from pelican)
(from versions: 2009r, 2008b, [...] 2012j, 2004b)
Cleaning up...
No distributions matching the version for pytz (from pelican)

From the log:
Ignoring link https://pypi.python.org/packages/source/p/pytz/pytz-2012j.zip#md5=fc37f7acd4e32644c5a8b5ac116d2068 (from https://pypi.python.org/simple/pytz/), version 2012j is a pre-release (use --pre to allow).

Owner

justinmayer commented Aug 2, 2013

Which theme are you using? Whether something "works" or not is highly dependent on the theme. If you are not using the notmyidea theme, do you get the same problem with images if you use that theme?

Your issue with pytz is not unique — that package has a non-standard version number scheme, so pip (1.4+) thinks it's an alpha or beta and skips installing it. As suggested in the error output, simply install pytz first via the following command, and then continue installing Pelican:

pip install --pre pytz
Owner

justinmayer commented Nov 25, 2013

@PhML: If there is anything else we can do to assist you with this issue, please feel free to re-open it. Thanks!

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