Skip to content

Commit

Permalink
use jsdelivr instead of rawgit; fixes #63
Browse files Browse the repository at this point in the history
rawgit is shutting down soon: https://rawgit.com
  • Loading branch information
bast committed Oct 14, 2018
1 parent 4055d8a commit a7f0a0d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cicero/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,15 @@ def render_github_markdown(path, engine, engine_version):
# we need to translate the reference to a sha (the reference can be a sha)
# the reason for this is that cdn.rawgit.com caches files forever
# the reference may change but the sha won't
# when changing to https://www.jsdelivr.com i haven't verified whether
# results are cached so translating to hashes might be overkill
sha = get_sha_github(owner, repo, ref)

root = '{0}/{1}/{2}'.format(owner, repo, sha)
root = '{0}/{1}@{2}'.format(owner, repo, sha)
if '/' in file_path:
root += '/' + '/'.join(file_path.split('/')[:-1]) + '/'

prefix = 'https://cdn.rawgit.com/{0}/'.format(root)
prefix = 'https://cdn.jsdelivr.net/gh/{0}/'.format(root)
else:
# FIXME currently fails, expects session token i think
prefix = 'https://{0}/{1}/{2}/raw/{3}/'.format(service, owner, repo, ref)
Expand Down

0 comments on commit a7f0a0d

Please sign in to comment.