docs(index.html): update config

This commit is contained in:
qingwei.li 2017-03-12 08:27:29 +08:00
parent 1f19cb2ade
commit ceafc37bb3
7 changed files with 38 additions and 111 deletions

4
docs/_navbar.md Normal file
View File

@ -0,0 +1,4 @@
- [:uk:](/)
- [:cn: 中文](/zh-cn/)
- [:de: German](/de-de/)
- [:uk: EN](/)

4
docs/de-de/_navbar.md Normal file
View File

@ -0,0 +1,4 @@
- [:de:](/de-de/)
- [:cn: 中文](/zh-cn/)
- [:de: German](/de-de/)
- [:uk: EN](/)

View File

@ -1,22 +1,22 @@
- Loslegen
- [Schnellstart](/quickstart)
- [Schreiben weiterer Seiten](/more-pages)
- [Navigationsleiste anpassen](/custom-navbar)
- [Titelseite](/cover)
- [Schnellstart](/de-de/quickstart)
- [Schreiben weiterer Seiten](/de-de/more-pages)
- [Navigationsleiste anpassen](/de-de/custom-navbar)
- [Titelseite](/de-de/cover)
- Anpassen
- [Einstellungen](/configuration)
- [Themen](/themes)
- [Liste der Erweiterungen](/plugins)
- [Schreiben eigener Erweiterungen](/write-a-plugin)
- [Markdown-Einstellungen](/markdown)
- [Hervorheben von Sprachen](/language-highlight)
- [Einstellungen](/de-de/configuration)
- [Themen](/de-de/themes)
- [Liste der Erweiterungen](/de-de/plugins)
- [Schreiben eigener Erweiterungen](/de-de/write-a-plugin)
- [Markdown-Einstellungen](/de-de/markdown)
- [Hervorheben von Sprachen](/de-de/language-highlight)
- Guide
- [Inbetriebnahme](/deploy)
- [Helfer](/helpers)
- [Vue Kompatibilität](/vue)
- [CDN](/cdn)
- [Offline Modus (PWA)](/pwa)
- [Inbetriebnahme](/de-de/deploy)
- [Helfer](/de-de/helpers)
- [Vue Kompatibilität](/de-de/vue)
- [CDN](/de-de/cdn)
- [Offline Modus (PWA)](/de-de/pwa)
- [Changelog](/changelog)
- [Changelog](/de-de/changelog)

View File

@ -6,19 +6,21 @@
<link rel="icon" href="_media/favicon.ico">
<meta name="keywords" content="doc,docs,documentation,gitbook,creator,generator,github,jekyll,github-pages">
<meta name="description" content="A magical documentation generator.">
<meta name="google-site-verification" content="6t0LoIeFksrjF4c9sqUEsVXiQNxLp2hgoqo0KryT-sE" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css" title="vue">
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/dark.css" title="dark" disabled>
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/buble.css" title="buble" disabled>
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/pure.css" title="pure" disabled>
<style>
nav.app-nav li ul {
min-width: 100px;
}
nav.app-nav a.active {
border-bottom: none;
}
</style>
</head>
<body>
<nav data-cloak>
<a href="#/de-de/">De</a>
<a href="#/">En</a>
<a href="#/zh-cn/">中文</a>
</nav>
<div id="app">Loading ...</div>
</body>
<script>
@ -32,6 +34,7 @@
coverpage: true,
executeScript: true,
loadSidebar: true,
loadNavbar: true,
maxLevel: 4,
name: 'docsify',
repo: 'QingWei-Li/docsify',
@ -50,10 +53,6 @@
},
subMaxLevel: 2
}
if (typeof navigator.serviceWorker !== 'undefined') {
navigator.serviceWorker.register('sw.js')
}
</script>
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
<script src="//unpkg.com/docsify/lib/plugins/search.min.js"></script>

View File

@ -1,84 +0,0 @@
/* ===========================================================
* docsify sw.js
* ===========================================================
* Copyright 2016 @huxpro
* Licensed under Apache 2.0
* Register service worker.
* ========================================================== */
const RUNTIME = 'docsify'
const HOSTNAME_WHITELIST = [
self.location.hostname,
'raw.githubusercontent.com',
'fonts.gstatic.com',
'fonts.googleapis.com',
'unpkg.com'
]
// The Util Function to hack URLs of intercepted requests
const getFixedUrl = (req) => {
var now = Date.now()
var url = new URL(req.url)
// 1. fixed http URL
// Just keep syncing with location.protocol
// fetch(httpURL) belongs to active mixed content.
// And fetch(httpRequest) is not supported yet.
url.protocol = self.location.protocol
// 2. add query for caching-busting.
// Github Pages served with Cache-Control: max-age=600
// max-age on mutable content is error-prone, with SW life of bugs can even extend.
// Until cache mode of Fetch API landed, we have to workaround cache-busting with query string.
// Cache-Control-Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=453190
if (url.hostname === self.location.hostname) {
url.search += (url.search ? '&' : '?') + 'cache-bust=' + now
}
return url.href
}
/**
* @Lifecycle Activate
* New one activated when old isnt being used.
*
* waitUntil(): activating ====> activated
*/
self.addEventListener('activate', event => {
event.waitUntil(self.clients.claim())
})
/**
* @Functional Fetch
* All network requests are being intercepted here.
*
* void respondWith(Promise<Response> r)
*/
self.addEventListener('fetch', event => {
// Skip some of cross-origin requests, like those for Google Analytics.
if (HOSTNAME_WHITELIST.indexOf(new URL(event.request.url).hostname) > -1) {
// Stale-while-revalidate
// similar to HTTP's stale-while-revalidate: https://www.mnot.net/blog/2007/12/12/stale
// Upgrade from Jake's to Surma's: https://gist.github.com/surma/eb441223daaedf880801ad80006389f1
const cached = caches.match(event.request)
const fixedUrl = getFixedUrl(event.request)
const fetched = fetch(fixedUrl, { cache: 'no-store' })
const fetchedCopy = fetched.then(resp => resp.clone())
// Call respondWith() with whatever we get first.
// If the fetch fails (e.g disconnected), wait for the cache.
// If theres nothing in cache, wait for the fetch.
// If neither yields a response, return offline pages.
event.respondWith(
Promise.race([fetched.catch(_ => cached), cached])
.then(resp => resp || fetched)
.catch(_ => { /* eat any errors */ })
)
// Update the cache with the version we fetched (only for ok status)
event.waitUntil(
Promise.all([fetchedCopy, caches.open(RUNTIME)])
.then(([response, cache]) => response.ok && cache.put(event.request, response))
.catch(_ => { /* eat any errors */ })
)
}
})

4
docs/zh-cn/_navbar.md Normal file
View File

@ -0,0 +1,4 @@
- [:cn:](/zh-cn/)
- [:cn: 中文](/zh-cn/)
- [:de: German](/de-de/)
- [:uk: EN](/)

View File

@ -75,7 +75,7 @@ renderer.link = function (href, title, text) {
if (title) {
title = ` title="${title}"`
}
return `<a href="${href}"${title}${blank}>${text}</a>`
return `<a href="${href}"${title || ''}${blank}>${text}</a>`
}
renderer.paragraph = function (text) {
if (/^!&gt;/.test(text)) {