mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-27 10:26:35 +03:00
Merge pull request #209 from henningpeters/master
add website trailing-slash redirects
This commit is contained in:
commit
976259010e
11
fabfile.py
vendored
11
fabfile.py
vendored
|
@ -97,6 +97,17 @@ def web_publish(assets_path):
|
||||||
if not k.name.startswith('resources')])
|
if not k.name.startswith('resources')])
|
||||||
|
|
||||||
for root, dirnames, filenames in os.walk(site_path):
|
for root, dirnames, filenames in os.walk(site_path):
|
||||||
|
for dirname in dirnames:
|
||||||
|
target = os.path.relpath(os.path.join(root, dirname), site_path)
|
||||||
|
source = os.path.join(target, 'index.html')
|
||||||
|
|
||||||
|
if os.path.exists(os.path.join(root, dirname, 'index.html')):
|
||||||
|
key = bucket.new_key(source)
|
||||||
|
key.set_redirect('//%s/%s' % (bucket.name, target))
|
||||||
|
print('adding redirect for %s' % target)
|
||||||
|
|
||||||
|
keys_left.remove(source)
|
||||||
|
|
||||||
for filename in filenames:
|
for filename in filenames:
|
||||||
source = os.path.join(root, filename)
|
source = os.path.join(root, filename)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user