mirror of
https://github.com/mkdocs/mkdocs.git
synced 2026-03-27 09:58:31 +07:00
Use urlparse and display text correctly
This commit is contained in:
@@ -11,13 +11,12 @@
|
||||
|
||||
<link rel="stylesheet" href="{{ base_url }}/css/theme.css" type="text/css" />
|
||||
{% for path in extra_css %}
|
||||
<link href="{{ base_url }}/{{ path }}" rel="stylesheet">
|
||||
<link href="{{ path }}" rel="stylesheet">
|
||||
{% endfor %}
|
||||
|
||||
<script type="text/javascript" src="{{ base_url }}/js/theme.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
|
||||
{% for path in extra_javascript %}
|
||||
<script src="{{ base_url }}/{{ path }}"></script>
|
||||
<script src="{{ path }}"></script>
|
||||
{% endfor %}
|
||||
|
||||
<style>
|
||||
|
||||
@@ -9,6 +9,7 @@ and structure of the site and pages in the site.
|
||||
|
||||
import os
|
||||
import shutil
|
||||
from urlparse import urlparse
|
||||
|
||||
|
||||
def copy_file(source_path, output_path):
|
||||
@@ -137,10 +138,10 @@ def create_media_urls(nav, url_list):
|
||||
final_urls = []
|
||||
for url in url_list:
|
||||
# Allow links to fully qualified URL's
|
||||
if '//' in url:
|
||||
parsed = urlparse(url)
|
||||
if parsed.netloc:
|
||||
final_urls.append(url)
|
||||
else:
|
||||
relative_url = '%s/%s' % (nav.url_context.make_relative('/'), url)
|
||||
final_urls.append(relative_url)
|
||||
return final_urls
|
||||
|
||||
|
||||
Reference in New Issue
Block a user