mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
add support for relative cross-site links
This commit is contained in:
parent
a6dd3178b1
commit
a0504aeabe
7 changed files with 26 additions and 19 deletions
|
|
@ -39,7 +39,7 @@ class Writer(object):
|
|||
link='%s/%s' % (self.site_url, item.url),
|
||||
unique_id='tag:%s,%s:%s' % (self.site_url.replace('http://', ''),
|
||||
item.date.date(), item.url),
|
||||
description=item.content,
|
||||
description=item.get_content(self.site_url),
|
||||
categories=item.tags if hasattr(item, 'tags') else None,
|
||||
author_name=getattr(item, 'author', ''),
|
||||
pubdate=set_date_tzinfo(item.date,
|
||||
|
|
@ -124,7 +124,9 @@ class Writer(object):
|
|||
|
||||
localcontext = context.copy()
|
||||
if relative_urls:
|
||||
localcontext['SITEURL'] = get_relative_path(name)
|
||||
relative_path = get_relative_path(name)
|
||||
context['localsiteurl'] = relative_path
|
||||
localcontext['SITEURL'] = relative_path
|
||||
|
||||
localcontext.update(kwargs)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue