Skip to content

Commit d528047

Browse files
committed
Log nav only
1 parent 9cd12aa commit d528047

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

.github/make_relative_to.py

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,29 @@
1212
# return sub(pattern, lambda m: f'href="{urljoin(os.environ['BASE_URL'], page.url, m.group(1))}', markdown)
1313

1414

15-
def on_env(env, config, files, **kwargs):
16-
log.warning('inside os_env')
17-
def url_with_redirect(func):
18-
@wraps(func)
19-
def inner(context, value):
20-
log.warning(f'before url_filter: {value}')
21-
url = func(context, value)
22-
log.warning(f'os_env url: {url}')
23-
scheme, netloc, path, query, anchor = urlsplit(url)
24-
if scheme or netloc: # External link
25-
return url
26-
if not path: # Self-link containing only query or anchor.
27-
return url
28-
if files.get_file_from_path(path) or files.get_file_from_path: # MD document or folder with MD
29-
return url
30-
# if files.documentation_pages().any(lambda x: x):
31-
# return url
32-
return urljoin(os.environ['BASE_URL'], url)
33-
return inner
15+
# def on_env(env, config, files, **kwargs):
16+
# log.warning('inside os_env')
17+
# def url_with_redirect(func):
18+
# @wraps(func)
19+
# def inner(context, value):
20+
# log.warning(f'before url_filter: {value}')
21+
# url = func(context, value)
22+
# log.warning(f'os_env url: {url}')
23+
# scheme, netloc, path, query, anchor = urlsplit(url)
24+
# if scheme or netloc: # External link
25+
# return url
26+
# if not path: # Self-link containing only query or anchor.
27+
# return url
28+
# if files.get_file_from_path(path) or files.get_file_from_path: # MD document or folder with MD
29+
# return url
30+
# # if files.documentation_pages().any(lambda x: x):
31+
# # return url
32+
# return urljoin(os.environ['BASE_URL'], url)
33+
# return inner
3434

35-
env.filters['url'] = url_with_redirect(templates.url_filter)
36-
return env
35+
# env.filters['url'] = url_with_redirect(templates.url_filter)
36+
# return env
3737

3838
def on_nav(nav, config, files):
39-
log.warning(f'nav pages: {nav.pages}')
39+
log.warning(f'nav pages: {nav.pages}')
40+
return nav

0 commit comments

Comments
 (0)