mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Merge branch 'master' into feat/search-separator
This commit is contained in:
commit
c0164698cd
2
.babelrc
2
.babelrc
@ -2,6 +2,6 @@
|
|||||||
"presets": ["es2015"],
|
"presets": ["es2015"],
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"add-module-exports",
|
"add-module-exports",
|
||||||
"babel-root-import"
|
"root-import"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
material/assets/stylesheets/application-bfecc7305d.css
Normal file
1
material/assets/stylesheets/application-bfecc7305d.css
Normal file
File diff suppressed because one or more lines are too long
@ -39,7 +39,7 @@
|
|||||||
<script src="{{ base_url }}/assets/javascripts/modernizr-1df76c4e58.js"></script>
|
<script src="{{ base_url }}/assets/javascripts/modernizr-1df76c4e58.js"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block styles %}
|
{% block styles %}
|
||||||
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-769c285a91.css">
|
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-bfecc7305d.css">
|
||||||
{% if config.extra.palette %}
|
{% if config.extra.palette %}
|
||||||
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-02c2a4388f.palette.css">
|
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-02c2a4388f.palette.css">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -150,7 +150,7 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
<script src="{{ base_url }}/assets/javascripts/application-3b8048ec29.js"></script>
|
<script src="{{ base_url }}/assets/javascripts/application-1d6ee6ee6c.js"></script>
|
||||||
{% set languages = lang.t("search.languages").split(",") %}
|
{% set languages = lang.t("search.languages").split(",") %}
|
||||||
{% if languages | length and languages[0] != "" %}
|
{% if languages | length and languages[0] != "" %}
|
||||||
{% set path = base_url + "/assets/javascripts/lunr" %}
|
{% set path = base_url + "/assets/javascripts/lunr" %}
|
||||||
|
24
package.json
24
package.json
@ -33,29 +33,29 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"autoprefixer": "^7.1.1",
|
"autoprefixer": "^7.1.2",
|
||||||
"babel-core": "^6.25.0",
|
"babel-core": "^6.25.0",
|
||||||
"babel-eslint": "^7.2.3",
|
"babel-eslint": "^7.2.3",
|
||||||
"babel-loader": "^7.0.0",
|
"babel-loader": "^7.1.1",
|
||||||
"babel-plugin-add-module-exports": "^0.2.1",
|
"babel-plugin-add-module-exports": "^0.2.1",
|
||||||
|
"babel-plugin-root-import": "^5.1.0",
|
||||||
"babel-plugin-transform-react-jsx": "^6.24.1",
|
"babel-plugin-transform-react-jsx": "^6.24.1",
|
||||||
"babel-polyfill": "^6.20.0",
|
"babel-polyfill": "^6.23.0",
|
||||||
"babel-preset-es2015": "^6.24.1",
|
"babel-preset-es2015": "^6.24.1",
|
||||||
"babel-register": "^6.24.1",
|
"babel-register": "^6.24.1",
|
||||||
"babel-root-import": "^4.1.5",
|
"chalk": "^2.0.1",
|
||||||
"chalk": "^2.0.0",
|
|
||||||
"clipboard": "^1.7.1",
|
"clipboard": "^1.7.1",
|
||||||
"core-js": "^2.4.1",
|
"core-js": "^2.4.1",
|
||||||
"css-mqpacker": "^6.0.1",
|
"css-mqpacker": "^6.0.1",
|
||||||
"custom-event-polyfill": "^0.3.0",
|
"custom-event-polyfill": "^0.3.0",
|
||||||
"del": "^3.0.0",
|
"del": "^3.0.0",
|
||||||
"escape-string-regexp": "^1.0.5",
|
"escape-string-regexp": "^1.0.5",
|
||||||
"eslint": "^4.0.0",
|
"eslint": "^4.3.0",
|
||||||
"expose-loader": "^0.7.3",
|
"expose-loader": "^0.7.3",
|
||||||
"fastclick": "^1.0.6",
|
"fastclick": "^1.0.6",
|
||||||
"flow-bin": "^0.51.0",
|
"flow-bin": "^0.51.1",
|
||||||
"flow-jsdoc": "^0.3.0",
|
"flow-jsdoc": "^0.3.0",
|
||||||
"git-hooks": "^1.1.7",
|
"git-hooks": "^1.1.8",
|
||||||
"gulp": "^3.9.1",
|
"gulp": "^3.9.1",
|
||||||
"gulp-changed": "^3.1.0",
|
"gulp-changed": "^3.1.0",
|
||||||
"gulp-concat": "^2.6.1",
|
"gulp-concat": "^2.6.1",
|
||||||
@ -67,7 +67,7 @@
|
|||||||
"gulp-plumber": "^1.1.0",
|
"gulp-plumber": "^1.1.0",
|
||||||
"gulp-postcss": "^7.0.0",
|
"gulp-postcss": "^7.0.0",
|
||||||
"gulp-remove-empty-lines": "0.1.0",
|
"gulp-remove-empty-lines": "0.1.0",
|
||||||
"gulp-replace": "^0.6.0",
|
"gulp-replace": "^0.6.1",
|
||||||
"gulp-rev": "^8.0.0",
|
"gulp-rev": "^8.0.0",
|
||||||
"gulp-rev-replace": "^0.4.3",
|
"gulp-rev-replace": "^0.4.3",
|
||||||
"gulp-sass": "^3.1.0",
|
"gulp-sass": "^3.1.0",
|
||||||
@ -77,7 +77,7 @@
|
|||||||
"gulp-uglify": "^3.0.0",
|
"gulp-uglify": "^3.0.0",
|
||||||
"gulp-util": "^3.0.8",
|
"gulp-util": "^3.0.8",
|
||||||
"js-cookie": "^2.1.4",
|
"js-cookie": "^2.1.4",
|
||||||
"lunr": "^2.1.0",
|
"lunr": "^2.1.2",
|
||||||
"lunr-languages": "^1.0.0",
|
"lunr-languages": "^1.0.0",
|
||||||
"material-design-color": "2.3.2",
|
"material-design-color": "2.3.2",
|
||||||
"material-shadows": "3.0.1",
|
"material-shadows": "3.0.1",
|
||||||
@ -87,10 +87,10 @@
|
|||||||
"stylelint": "^8.0.0",
|
"stylelint": "^8.0.0",
|
||||||
"stylelint-config-standard": "^17.0.0",
|
"stylelint-config-standard": "^17.0.0",
|
||||||
"stylelint-order": "^0.6.0",
|
"stylelint-order": "^0.6.0",
|
||||||
"stylelint-scss": "^1.4.4",
|
"stylelint-scss": "^2.0.0",
|
||||||
"through2": "^2.0.3",
|
"through2": "^2.0.3",
|
||||||
"vinyl-paths": "^2.1.0",
|
"vinyl-paths": "^2.1.0",
|
||||||
"webpack": "^3.0.0",
|
"webpack": "^3.4.1",
|
||||||
"webpack-stream": "^3.2.0",
|
"webpack-stream": "^3.2.0",
|
||||||
"whatwg-fetch": "^2.0.3",
|
"whatwg-fetch": "^2.0.3",
|
||||||
"yargs": "^8.0.2"
|
"yargs": "^8.0.2"
|
||||||
|
@ -136,8 +136,8 @@ function initialize(config) { // eslint-disable-line func-style
|
|||||||
new Material.Event.Listener(window, [
|
new Material.Event.Listener(window, [
|
||||||
"scroll", "resize", "orientationchange"
|
"scroll", "resize", "orientationchange"
|
||||||
], new Material.Header.Shadow(
|
], new Material.Header.Shadow(
|
||||||
"[data-md-component=container]",
|
"[data-md-component=container]",
|
||||||
"[data-md-component=header]")))
|
"[data-md-component=header]")))
|
||||||
|
|
||||||
/* Component: tabs visibility toggle */
|
/* Component: tabs visibility toggle */
|
||||||
if (document.querySelector("[data-md-component=tabs]"))
|
if (document.querySelector("[data-md-component=tabs]"))
|
||||||
@ -150,8 +150,8 @@ function initialize(config) { // eslint-disable-line func-style
|
|||||||
new Material.Event.Listener(window, [
|
new Material.Event.Listener(window, [
|
||||||
"scroll", "resize", "orientationchange"
|
"scroll", "resize", "orientationchange"
|
||||||
], new Material.Sidebar.Position(
|
], new Material.Sidebar.Position(
|
||||||
"[data-md-component=navigation]",
|
"[data-md-component=navigation]",
|
||||||
"[data-md-component=header]")))
|
"[data-md-component=header]")))
|
||||||
|
|
||||||
/* Component: sidebar with table of contents (missing on 404 page) */
|
/* Component: sidebar with table of contents (missing on 404 page) */
|
||||||
if (document.querySelector("[data-md-component=toc]"))
|
if (document.querySelector("[data-md-component=toc]"))
|
||||||
@ -159,8 +159,8 @@ function initialize(config) { // eslint-disable-line func-style
|
|||||||
new Material.Event.Listener(window, [
|
new Material.Event.Listener(window, [
|
||||||
"scroll", "resize", "orientationchange"
|
"scroll", "resize", "orientationchange"
|
||||||
], new Material.Sidebar.Position(
|
], new Material.Sidebar.Position(
|
||||||
"[data-md-component=toc]",
|
"[data-md-component=toc]",
|
||||||
"[data-md-component=header]")))
|
"[data-md-component=header]")))
|
||||||
|
|
||||||
/* Component: link blurring for table of contents */
|
/* Component: link blurring for table of contents */
|
||||||
new Material.Event.MatchMedia("(min-width: 960px)",
|
new Material.Event.MatchMedia("(min-width: 960px)",
|
||||||
@ -191,16 +191,16 @@ function initialize(config) { // eslint-disable-line func-style
|
|||||||
new Material.Event.Listener("[data-md-component=query]", [
|
new Material.Event.Listener("[data-md-component=query]", [
|
||||||
"focus", "keyup", "change"
|
"focus", "keyup", "change"
|
||||||
], new Material.Search.Result("[data-md-component=result]", () => {
|
], new Material.Search.Result("[data-md-component=result]", () => {
|
||||||
return fetch(`${config.url.base}/mkdocs/search_index.json`, {
|
return fetch(`${config.url.base}/mkdocs/search_index.json`, {
|
||||||
credentials: "same-origin"
|
credentials: "same-origin"
|
||||||
}).then(response => response.json())
|
}).then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
return data.docs.map(doc => {
|
return data.docs.map(doc => {
|
||||||
doc.location = config.url.base + doc.location
|
doc.location = config.url.base + doc.location
|
||||||
return doc
|
return doc
|
||||||
})
|
|
||||||
})
|
})
|
||||||
})).listen()
|
})
|
||||||
|
})).listen()
|
||||||
|
|
||||||
/* Listener: close drawer when anchor links are clicked */
|
/* Listener: close drawer when anchor links are clicked */
|
||||||
new Material.Event.MatchMedia("(max-width: 959px)",
|
new Material.Event.MatchMedia("(max-width: 959px)",
|
||||||
|
@ -163,11 +163,11 @@ export default class Result {
|
|||||||
lunr.stopWordFilter
|
lunr.stopWordFilter
|
||||||
)
|
)
|
||||||
|
|
||||||
/* Set up stemmers for search languages */
|
/* Set up alternate search languages */
|
||||||
if (lang.length === 1) {
|
if (lang.length === 1) {
|
||||||
this.use(lunr[lang[0]])
|
this.use(lunr[lang[0]])
|
||||||
} else if (lang.length > 1) {
|
} else if (lang.length > 1) {
|
||||||
this.use(lunr.multiLanguage(...lang)) // TODO: remove
|
this.use(lunr.multiLanguage(...lang))
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Index fields */
|
/* Index fields */
|
||||||
|
Loading…
Reference in New Issue
Block a user