Skip to content

Commit

Permalink
Merge branch 'fix/edit_on_github-3'
Browse files Browse the repository at this point in the history
  • Loading branch information
ypid committed Nov 5, 2016
2 parents be887b1 + 3ba8c8d commit c86f02a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/_lib/sphinxcontrib/debops/func.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def get_source_file_to_url_map(start_dir='.', skip_patterns=[]):
repo_dir_to_url_map = {}
list_of_submod_paths = []

cur_dir = os.path.abspath(os.path.dirname(__file__))
cur_dir = os.path.abspath(start_dir)

for submodule_path in check_output(['git', 'submodule', '--quiet', 'foreach', 'pwd']).split('\n'):
if submodule_path.startswith(cur_dir):
Expand Down Expand Up @@ -103,7 +103,7 @@ def get_source_file_to_url_map(start_dir='.', skip_patterns=[]):
relative_pagename = 'CHANGES.rst'

pagename_source_file = re.sub(r'\.rst$', '', pagename_source_file)
print(dir_path)
# print(dir_path)
source_file_to_url_map[pagename_source_file] = {
'url': repo_dir_to_url_map[dir_path],
'pagename': relative_pagename,
Expand Down
2 changes: 1 addition & 1 deletion docs/_templates/breadcrumbs.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<a href="{{ meta['github_url'] }}" class="fa fa-github"> Edit on GitHub</a>
{% else %}
{# Removed: github_version #}
<a href="{{ source_file_to_url_map[pagename]['url'] }}/blob//master/{{ source_file_to_url_map[pagename]['pagename'] }}" class="fa fa-github"> Edit on GitHub</a>
<a href="{{ source_file_to_url_map[pagename]['url'] }}/blob/master/{{ source_file_to_url_map[pagename]['pagename'] }}" class="fa fa-github"> Edit on GitHub</a>
{% endif %}
{% elif display_bitbucket %}
{% if check_meta and 'bitbucket_url' in meta %}
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
'last_updated': True,
'commit': False,
'source_file_to_url_map': debops.get_source_file_to_url_map(
start_dir=os.path.dirname(__file__),
skip_patterns=[
r'debops-keyring/docs/entities(?:\.rst)$', # Auto generated.
r'ansible/roles/debops[^/]+$', # Legacy.
Expand Down

0 comments on commit c86f02a

Please sign in to comment.