Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
use site.link to build tag URLs
  • Loading branch information
ralsina committed Jun 14, 2015
1 parent a71edbd commit b6cbfcb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions nikola/plugins/command/import_wordpress.py
Expand Up @@ -171,11 +171,9 @@ def show_info_about_mising_module(modulename):
for tag in self.all_tags:
tag = utils.slugify(tag.decode('utf8'))

This comment has been minimized.

Copy link
@felixfontein

felixfontein Jun 27, 2015

Contributor

Under Python 3, I get an exception here: AttributeError: 'str' object has no attribute 'decode'
Don't know how to fix it, though. For me, I can just leave the .decode('utf8') away, but that'll probably not work everywhere.

This comment has been minimized.

Copy link
@felixfontein

felixfontein Jun 30, 2015

Contributor

Is now fixed.

src_url = '{}tag/{}'.format(self.context['SITE_URL'], tag)
# FIXME: this should check for PRETTY_URLs in existing config
# probably reading that belongs in the Mixin
if True:
dst_url = self.context['SITE_URL'] + 'categories/' + tag + '.html'
self.url_map[src_url] = dst_url
dst_url = self.site.link('tag', tag)

This comment has been minimized.

Copy link
@felixfontein

felixfontein Jun 27, 2015

Contributor

This results in nikola.utils.LocaleBorgUninitializedException: Attempt to use LocaleBorg before initialization being raised.

This comment has been minimized.

Copy link
@ralsina

ralsina Jun 27, 2015

Author Member

See #1824

This comment has been minimized.

Copy link
@felixfontein

felixfontein Jun 27, 2015

Contributor

Cool :) Overlooked that.

if src_url != dst_url:
self.url_map[src_url] = dst_url

self.write_urlmap_csv(
os.path.join(self.output_folder, 'url_map.csv'), self.url_map)
Expand Down

0 comments on commit b6cbfcb

Please sign in to comment.