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

Use full path for images to avoid rst2pdf 'Missing image file' error #7

Merged

Conversation

wombelix
Copy link
Collaborator

Images added in a Post / Page will not be added to the PDF, rst2pdf can't find the image due to the relative path and will raise a Missing image file error. The PDF will be generated, but without the image, a red cross is added instead.

Can be resolved by searching for images and replace {.*} (e.g. {static}) with the path to Pelican, ~/pelican/content in the following Example.

before:
..image:: {static}/images/picture.jpg

after:
..image:: ~/pelican/content/images/picture.jpg

This PR supports reStructuredText and Markdown.

@wombelix
Copy link
Collaborator Author

@justinmayer can you help me to understand why build / Lint (pull_request) Failing after 2m — Lint fails? Under Details I only see Error: The log was not found. It may have been deleted based on retention settings..

@justinmayer
Copy link
Contributor

I see the following:

Run actions/setup-python@v2
Version 3.6 was not found in the local cache
Error: Version 3.6 with arch x64 not found
The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json

I imagine the problem is that Python 3.6 is no longer supported, but I can't say for certain. I think the best course of action is to remove Python 3.6 from the test matrix and see whether the problem persists.

@justinmayer
Copy link
Contributor

I dropped Python 3.6 from the test matrix via 5f26b2b, which seems to have resolved that particular problem.

@justinmayer
Copy link
Contributor

@wombelix: I have fixed multiple issues, which I believe will address the errors seen here in your PR. Can you rebase this branch on main?

@wombelix
Copy link
Collaborator Author

which I believe will address the errors seen here in your PR

Thanks a lot, looks better but still one error in the pre-commit.ci:

    => error
    remote: HTTP Basic: Access denied. The provided password or token is incorrect or your account has 2FA enabled and you must use a personal access token instead of a password. See https://gitlab.com/help/topics/git/troubleshooting_git#error-on-git-fetch-http-basic-access-denied
    fatal: Authentication failed for 'https://gitlab.com/pycqa/flake8.git/'

@justinmayer
Copy link
Contributor

That pre-commit.ci problem seems to be because the Flake8 project moved from GitLab to GitHub. We can safely ignore that error.

Side note: I am increasingly unconvinced that pre-commit.ci provides enough value and may decide to remove it entirely. As for Flake8, I am displeased with how that project is managed, and I would never use it again for any new projects. I may replace it across-the-board with Ruff.

@justinmayer
Copy link
Contributor

@wombelix: I resolved the CI issues in this PR. Could you please add a RELEASE.md file to this PR with the following contents?

Release type: patch

Use full path for images to avoid rst2pdf 'Missing image file' error

@justinmayer
Copy link
Contributor

@wombelix: Never mind — I took care of adding the RELEASE.md file myself. Many thanks for the enhancement to this plugin! ✨

@justinmayer justinmayer changed the title fix: Use full path for images to avoid rst2pdf 'Missing image file' error Use full path for images to avoid rst2pdf 'Missing image file' error Apr 4, 2023
@justinmayer justinmayer merged commit cbf5b23 into pelican-plugins:main Apr 4, 2023
6 checks passed
@wombelix wombelix deleted the fix_missing_image_file_error branch June 9, 2023 19:47
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

Successfully merging this pull request may close these issues.

None yet

2 participants