Skip to content

Commit

Permalink
move doc static and redirect to docuementation doc group
Browse files Browse the repository at this point in the history
  • Loading branch information
craigahobbs committed Jul 12, 2021
1 parent 6e113cd commit 65937ec
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
9 changes: 7 additions & 2 deletions src/chisel/doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,13 @@ def create_doc_requests(requests=None, root_path='/doc', api=True, app=True):
yield DocIndex(requests=requests, urls=(('GET', root_path + '/doc_index'),))
yield DocRequest(requests=requests, urls=(('GET', root_path + '/doc_request'),))
if app:
yield RedirectRequest((('GET', root_path),), root_path + '/')
yield StaticRequest('chisel_doc', CHISEL_DOC_HTML, urls=(('GET', root_path + '/'), ('GET', root_path + '/index.html')))
yield RedirectRequest((('GET', root_path),), root_path + '/', doc_group='Documentation')
yield StaticRequest(
'chisel_doc',
CHISEL_DOC_HTML,
urls=(('GET', root_path + '/'), ('GET', root_path + '/index.html')),
doc_group='Documentation'
)


class DocIndex(Action):
Expand Down
1 change: 1 addition & 0 deletions src/chisel/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ class StaticRequest(Request):
'.jpg': 'image/jpeg',
'.js': 'application/javascript',
'.json': 'application/json',
'.md': 'text/plain',
'.png': 'image/png',
'.svg': 'image/svg+xml',
'.txt': 'text/plain'
Expand Down
8 changes: 2 additions & 6 deletions src/tests/test_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,10 @@ def test_doc_index(self):
'title': 'localhost:80',
'groups': {
'Documentation': [
'chisel_doc',
'chisel_doc_index',
'chisel_doc_request'
],
'Redirects': [
'chisel_doc_request',
'redirect_doc'
],
'Statics': [
'chisel_doc'
]
}
})
Expand Down

0 comments on commit 65937ec

Please sign in to comment.