mirror of
https://github.com/vale981/ablog
synced 2025-03-06 01:31:39 -05:00
Linking to archive pages from intersphinx domain.
This commit is contained in:
parent
06a891177e
commit
87d95492a9
1 changed files with 11 additions and 9 deletions
|
@ -385,26 +385,28 @@ def process_posts(app, doctree):
|
||||||
|
|
||||||
# instantiate catalogs and collections here
|
# instantiate catalogs and collections here
|
||||||
# so that references are created and no warnings are issued
|
# so that references are created and no warnings are issued
|
||||||
std_domain = app.env.domains['std']
|
if non_html:
|
||||||
|
stdlabel = env.intersphinx_inventory.setdefault('std:label', {})
|
||||||
|
baseurl = getattr(env.config, 'blog_baseurl').rstrip('/') + '/'
|
||||||
|
project, version = env.config.project, text_type(env.config.version)
|
||||||
|
else:
|
||||||
|
stdlabel = env.domains['std'].data['labels']
|
||||||
|
|
||||||
for key in ['tags', 'author', 'category', 'location', 'language']:
|
for key in ['tags', 'author', 'category', 'location', 'language']:
|
||||||
catalog = blog.catalogs[key]
|
catalog = blog.catalogs[key]
|
||||||
for label in postinfo[key]:
|
for label in postinfo[key]:
|
||||||
coll = catalog[label]
|
coll = catalog[label]
|
||||||
if non_html:
|
if non_html:
|
||||||
std_domain.data['labels'][coll.xref] = (
|
stdlabel[coll.xref] = (project, version, baseurl + coll.docname, coll.name)
|
||||||
'http://ablog.readthedocs.org/' + coll.docname, coll.xref, coll.name)
|
|
||||||
else:
|
else:
|
||||||
std_domain.data['labels'][coll.xref] = (
|
stdlabel[coll.xref] = (coll.docname, coll.xref, coll.name)
|
||||||
coll.docname, coll.xref, coll.name)
|
|
||||||
|
|
||||||
if postinfo['date']:
|
if postinfo['date']:
|
||||||
coll = blog.archive[postinfo['date'].year]
|
coll = blog.archive[postinfo['date'].year]
|
||||||
if non_html:
|
if non_html:
|
||||||
std_domain.data['labels'][coll.xref] = (
|
stdlabel[coll.xref] = (project, version, baseurl + coll.docname, coll.name)
|
||||||
'http://ablog.readthedocs.org/' + coll.docname, coll.xref, coll.name)
|
|
||||||
else:
|
else:
|
||||||
std_domain.data['labels'][coll.xref] = (
|
stdlabel[coll.xref] = (coll.docname, coll.xref, coll.name)
|
||||||
coll.docname, coll.xref, coll.name)
|
|
||||||
|
|
||||||
|
|
||||||
def process_postlist(app, doctree, docname):
|
def process_postlist(app, doctree, docname):
|
||||||
|
|
Loading…
Add table
Reference in a new issue