You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SITEURL = 'mysite.com/blog' in the Pelican settings file.
and a fileurl of 'posts/my_article/index.html`
the _create_absolute_fileurl method in open_graph.py will return a file_url missing the SITEURLs subdirectory.
This is due to the way that urllib's parse.urljoin works.
My quick workaround for now is to append a slash to the siteurl. If it's redundant, it will be stripped out by urljoin
I am having the same issue. My Pelican is in a subfolder of my domain, example.com/blog, and the image/og_image attributes begin with /images/... - The resulting image url lacks the /blog before /images/.
Maybe something like this, to avoid making sure SITEURL ends with '/':
def_create_absolute_fileurl(self):
"""Join site URL and file path."""# Ensure fileurl is a relative pathifself.fileurl.startswith('/'):
relative_fileurl=self.fileurl[1:]
else:
relative_fileurl=self.fileurlfile_url=parse.urljoin(self.siteurl, relative_fileurl)
returnfile_url
Given
SITEURL = 'mysite.com/blog'
in the Pelican settings file.and a
fileurl
of 'posts/my_article/index.html`the
_create_absolute_fileurl
method inopen_graph.py
will return afile_url
missing theSITEURL
s subdirectory.This is due to the way that urllib's
parse.urljoin
works.My quick workaround for now is to append a slash to the
siteurl
. If it's redundant, it will be stripped out byurljoin
The text was updated successfully, but these errors were encountered: