Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
20325cce
Commit
20325cce
authored
Nov 18, 2013
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop .html suffixes in docs
parent
4ddbeb16
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
docs/template.html
+1
-0
mkdocs.py
+7
-2
No files found.
docs/template.html
View file @
20325cce
...
...
@@ -4,6 +4,7 @@
<meta
charset=
"utf-8"
>
<title>
{{ title }}
</title>
<link
href=
"{{ base_url }}/img/favicon.ico"
rel=
"icon"
type=
"image/x-icon"
>
<link
rel=
"canonical"
href=
"{{ canonical_url }}"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<meta
name=
"description"
content=
"{{ description }}"
>
<meta
name=
"author"
content=
"Tom Christie"
>
...
...
mkdocs.py
View file @
20325cce
...
...
@@ -19,7 +19,7 @@ if local:
index
=
'index.html'
else
:
base_url
=
'http://django-rest-framework.org'
suffix
=
'
.html
'
suffix
=
''
index
=
''
...
...
@@ -90,7 +90,10 @@ for idx in range(len(path_list)):
path
=
path_list
[
idx
]
rel
=
'../'
*
path
.
count
(
'/'
)
if
idx
>
0
:
if
idx
==
1
and
not
local
:
# Link back to '/', not '/index'
prev_url_map
[
path
]
=
'/'
elif
idx
>
0
:
prev_url_map
[
path
]
=
rel
+
path_list
[
idx
-
1
][:
-
3
]
+
suffix
if
idx
<
len
(
path_list
)
-
1
:
...
...
@@ -143,6 +146,7 @@ for (dirpath, dirnames, filenames) in os.walk(docs_dir):
else
:
main_title
=
'Django REST framework - '
+
main_title
canonical_url
=
base_url
+
'/'
+
relative_path
[:
-
3
]
+
suffix
prev_url
=
prev_url_map
.
get
(
relative_path
)
next_url
=
next_url_map
.
get
(
relative_path
)
...
...
@@ -152,6 +156,7 @@ for (dirpath, dirnames, filenames) in os.walk(docs_dir):
output
=
output
.
replace
(
'{{ title }}'
,
main_title
)
output
=
output
.
replace
(
'{{ description }}'
,
description
)
output
=
output
.
replace
(
'{{ page_id }}'
,
filename
[:
-
3
])
output
=
output
.
replace
(
'{{ canonical_url }}'
,
canonical_url
)
if
prev_url
:
output
=
output
.
replace
(
'{{ prev_url }}'
,
prev_url
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment