-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Internal URLs not parsed in summaries #3265
Comments
Actually... This should already be handled in Line 527 in 2d75ca8
And it works as expected. I can't reproduce this: $ cat pelicanconf.py
SITEURL = 'http://example.com'
$ cat content/articles/test.md
title: article1
date: 02.01.2023
summary: [another article]({filename}test2.md)
Article 1 content
$ cat content/articles/test2.md
title: article2
date: 03.01.2023
Article 2 content
$ pelican content -s pelicanconf.py
[00:32:55] WARNING No timezone information specified in the settings. Assuming your timezone is UTC for feed generation. Check log.py:89
https://docs.getpelican.com/en/latest/settings.html#TIMEZONE for more information
Done: Processed 2 articles, 0 drafts, 0 hidden articles, 0 pages, 0 hidden pages and 0 draft pages in 0.06 seconds.
$ grep "another article" output/index.html
</footer><!-- /.post-info --> <p><a href="http://example.com/article2.html">another article</a></p> |
@arturlangner: Any follow-up comments about this issue that you submitted? |
I uninstalled and reinstalled Pelican 4.9.1 with I checked my contents.py:527 and it does contain the code @avaris has mentioned above. The only somewhat special thing about my setup is that I also use |
@avaris already said that he can't reproduce the issue you describe. Do you not think it would make more sense to try without the |
I retested with the plugin disabled and the output is okay. The plugin only extracts the summary and does not do any processing. |
So… If the problem goes away when the plugin is disabled, doesn't this seem like something to ask @MinchinWeb about since it appears related to the plugin instead of Pelican itself? |
@arturlangner Is your site setup somewhere online where I can look at it? In particular, it makes a difference what version of Pelican you're trying to run this with... |
It is not online but I attach the minimal subset here (run I installed everything with
Everything runs on Python 3.11.7. |
@arturlangner this is brilliant, thank you! |
So the good news, is I can replicate the issue. Some history: Back is 2014, Plugins Issue #314 was raised covering this very issue (that links weren't being resolved), and so the solution was to create a new signal ( Pelican 3.6 works as expected, as does Pelican 3.7. However, v4.0 breaks, as above.
The breaking change was PR #2226 (although it was actually #2288 that was merged, but it's based on this). What this change does is remove the automatic link processing of the summary, but extend it to all After all the above, is the flaw just that the links are updated before the plugin is run? Can the order of these just be swapped? The current code: # pelican/__init__.py
for p in generators:
if hasattr(p, "refresh_metadata_intersite_links"):
p.refresh_metadata_intersite_links() # <-- links get updated
signals.all_generators_finalized.send(generators) # <-- summary plugin called I've created a Pull Request (to be pushed here shortly) that will do just that. |
Ok, the Pull Request has been pushed! #3280 solves it for me locally. A test site is available as part of the summary plugin if you want to test is locally yourself. |
Internal links (ie.
{filename}/stuff/more_stuff.md
) are not parsed in a summary and the output HTML URL is broken. It contains the original verbatim text.I experienced it when using https://github.com/MinchinWeb/minchin.pelican.plugins.summary but the bug itself is in Pelican codebase.
The problematic code in
get_summary()
is:Fix that works for me is:
I would be happy if this fix or something similar goes upstream. 🙂
The text was updated successfully, but these errors were encountered: