Comments (5)
"Read more" link does not link to the correct URL.
EDIT: I fixed the problem in this comment by changing /{url}
to {url}
. But image link issue still persists.
In my publishconf.py I have
SITEURL = 'https://ahmetalpbalkan.com/blog'
HOMEURL = 'https://ahmetalpbalkan.com/'
ARTICLE_URL = '{slug}/'
ARTICLE_SAVE_AS = '{slug}/index.html'
READ_MORE_LINK = '<nobr> Read more →</nobr>'
READ_MORE_LINK_FORMAT = "<a href='/{url}'>{text}</a>"
and it makes links to https://ahmetalpbalkan.com/{slug}
That's severely broken.
from pelican-plugins.
Hi @ahmetalpbalkan: would changing the READ_MORE_LINK_FORMAT
settings in the following way help?
READ_MORE_LINK_FORMAT = "<a href='%s/{url}'>{text}</a>" % SITEURL
If so, then perhaps I should either use settings.SITEURL
at https://github.com/getpelican/pelican-plugins/blob/master/read_more_link/read_more_link.py#L56 or figure out a clever way to allow you to pass in a SITEURL
value dynamically. What do you think?
-V.
from pelican-plugins.
I solved that problem just by removing /
in the beginning. Solved the case for me. I'm not sure yours is a better solution because even while serving on localhost
it will make the link go to SITEURL.
What about the image links issue?
from pelican-plugins.
Hello again, @ahmetalpbalkan. I've created a pull request to address the relative/absolute url generation issue. I'm going to think some more about the localhost
situation.
Personally, I use zc.buildout to create and control my environments. In this way, I am able to switch settings according to which environment (local vs prod) and thus can have different SITEURL respectively. I understand this doesn't directly address your issue.
As far as the image links, remember that read_more_link
is only trying to generate a "read more link" and nothing else (thus the name). I think whatever plugin you're using to generate summary is having the same problem as read_more_link
before my pull request #148.
EDIT: Oh, I just realized something. If you were to use the codes from #148, when you're working in local environment, you could set READ_MORE_LINK_RELATIVE = False
and links would be relative. When you deploy, just remove it or set READ_MORE_LINK_RELATIVE = True
Hope that helps.
-V.
from pelican-plugins.
I am not using any other summary plugins. I am just using Pelican's SUMMARY_MAX_LENGTH
setting and images in the summary do not get linked to the SITEURL. And my theme just uses {{ article.summary }}
property (just like other themes do).
When you disable read_more_link and run: make html && make serve
and navigate to localhost, are images that appear in summary linked to SITEURL or relative? They should be relative. But when I turn on read_more_link it becomes absolute urls with SITEURL.
You may be using zc.buildout but please do not break people's workflows.
from pelican-plugins.
Related Issues (20)
- [md_inline_extension] Broken with Markdown >= 3.4
- Asking to move some plugins in the Pelican plugin repo HOT 14
- [github_activity] Readme.rst has wrong reference to library used by plugin
- An alternate presentation of pelican-plugins and legacy plugins repos
- [org_python_reader] TRANSLATION property is not respected
- [New Plugins] spellcheck, uniquotes, redirects
- [New plugin] reStructuredText footnotes
- [Migration] - Readtime HOT 1
- [migration] asciidoc_reader HOT 5
- [migration] headerid HOT 1
- [New Plugin] Pelican-Injector: A plugin to inject code into specific HTML tags in pages and articles HOT 4
- [migration] representative_image HOT 5
- I18N Subsites: Use translation for default site not for subsite
- Transition to PYPI's Trusted Publisher mechanism
- New plugin
- feature request(headerid): Markdown support HOT 1
- Docutils has no localization for 'eu HOT 1
- [asciidoc_reader] Issue with detecting available binaries
- For requirements.txt, use PDM, PIP, Conda or pipreqs? HOT 2
- Strava Routes Page Injection Plugin
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pelican-plugins.