Skip to content

Handle circle artifact server not redirecting to index.html for directories #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 5, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions circle/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
if (matches) {
var ci_id = matches[1];
var path = matches[2] || '';
if (query.match(/\/$|[^.]{10}$|^[^.]*$/)) {
// path ends with slash or has no . in last 10 chars => append index.html
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has no "." in the last 10 chars? What's that for?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps I should have made it explicit: to exclude .html, .png, .jpg, .examples, .py, .ipynb, etc.

Copy link
Member

@amueller amueller Dec 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahhh sorry, I'm slow. Maybe add a comment in case I look at it again in a couple of month? ;)

if (path.endsWith('/')) {
path += 'index.html';
} else {
path += '/index.html';
}
}
window.___location.href = 'https://' + ci_id + '-843222-gh.circle-artifacts.com/0/home/ubuntu/scikit-learn/doc/_build/html/stable' + path;
} else {
var href_sans_query = window.___location.href.substring(0, window.___location.href.length - window.___location.search.length);
Expand Down