mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-24 10:22:23 +00:00
edit document title
This commit is contained in:
parent
54fe0d12b6
commit
44ff6ee6dd
@ -30,7 +30,7 @@
|
||||
// essential settings
|
||||
ditto.index = "README.md",
|
||||
ditto.sidebar_file = "sidebar.md",
|
||||
|
||||
ditto.document_title = "ECMAScript 6入门",
|
||||
// where the docs are actually stored on github - so you can edit
|
||||
ditto.base_url = "https://github.com/ruanyf/es6tutorial/edit/gh-pages/"; // <------- EDIT ME!!
|
||||
|
||||
|
13
js/ditto.js
13
js/ditto.js
@ -186,18 +186,21 @@ function router() {
|
||||
$.get(path , function(data) {
|
||||
$(ditto.error_id).hide();
|
||||
$(ditto.content_id).html(marked(data));
|
||||
|
||||
if ($(ditto.content_id h1) === ditto.document_title){
|
||||
document.title = ditto.document_title;
|
||||
} else {
|
||||
document.title = $(ditto.content_id h1).text() + " - " + ditto.document_title;
|
||||
}
|
||||
normalize_paths();
|
||||
create_page_anchors();
|
||||
|
||||
$('#content code').map(function() {
|
||||
Prism.highlightElement(this);
|
||||
});
|
||||
}).fail(function() {
|
||||
show_error();
|
||||
|
||||
}).always(function() {
|
||||
clearInterval(loading);
|
||||
$('#content code').map(function() {
|
||||
Prism.highlightElement(this);
|
||||
});
|
||||
$(ditto.loading_id).hide();
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user