Skip to content

Commit 488cb74

Browse files
committed
docs(project): update config, add offer page
See https://doocs.github.io/advanced-java/#/offer
1 parent 6bf5dde commit 488cb74

File tree

4 files changed

+201
-8
lines changed

4 files changed

+201
-8
lines changed

_navbar.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
* 页面
77
* [封面]()
88
* [首页](README)
9-
* [GitHub](https://github.com/yanglbme)
9+
* [GitHub](https://github.com/yanglbme)
10+
* [Offer](offer)

index.html

+24-7
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,42 @@
1111
<link rel="icon" type="image/png" sizes="16x16" href="img/favicon-16x16.png?v=5.1.4">
1212
</head>
1313
<body>
14-
<div id="app">Loading</div>
14+
<div id="app">Welcome to Advanced-Java</div>
1515
<script>
1616
window.$docsify = {
1717
name: 'advanced-java',
1818
repo: 'doocs/advanced-java',
1919
maxLevel: 3,
2020
auto2top: true,
21+
loadNavbar: true,
22+
coverpage: true,
23+
mergeNavbar: true,
2124
search: [
2225
'/', // => /README.md
2326
'/guide', // => /guide.md
2427
'/get-started', // => /get-started.md
25-
'/zh-cn/', // => /zh-cn/README.md
26-
'/solution/coding-interview',
27-
'/solution/the-beauty-of-programming'
28+
'/zh-cn/' // => /zh-cn/README.md
2829
],
29-
loadNavbar: true,
30-
coverpage: true,
31-
mergeNavbar: true
30+
plugins: [
31+
function (hook) {
32+
var footer = [
33+
'<hr/>',
34+
'<footer>',
35+
'<span>Copyright © 2018 <a href="https://github.com/yanglbme" target="_blank">yanglbme</a>. All rights reserved.</span>',
36+
'</footer>'
37+
].join('')
38+
39+
hook.afterEach(function (html) {
40+
return html + footer
41+
})
42+
}
43+
]
44+
}
45+
46+
if (typeof navigator.serviceWorker !== 'undefined') {
47+
navigator.serviceWorker.register('sw.js')
3248
}
49+
3350
</script>
3451
<script src="//unpkg.com/docsify"></script>
3552
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>

offer.md

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<p align="center"><iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=86 src="//music.163.com/outchain/player?type=2&id=1321616516&auto=1&height=66"></iframe></p>
2+
3+
```
4+
每天起床第一句 先给自己打个气
5+
每次刷新查成绩 都要说声保佑me
6+
魔镜魔镜告诉我 我的offer在哪里
7+
努力 我要努力 我要变成收割机
8+
offer offer
9+
我要变成收割机
10+
offer offer
11+
12+
为了拿下BAT 天天提着一口气
13+
大厂小厂投简历 刷光面经笔试题
14+
天生我才难自弃 可惜面试都悲剧
15+
努力 我要努力 我要变成收割机
16+
Wow
17+
18+
在哪里在哪里在哪
19+
在哪里在哪里在哪
20+
在哪里在哪里在哪
21+
在哪里在哪里在哪
22+
我的offer在哪里
23+
燃烧我的卡路里
24+
25+
拜拜 二次元 综艺直播动作片 言情玄幻宫斗剧
26+
拿走拿走别客气
27+
28+
拜拜 铂金一 戒掉农药戒吃鸡 通宵开黑玩游戏
29+
别再熬夜伤身体
30+
31+
来来 沉住气 专业课本重拾起 牛客网上刷真题
32+
保温杯里泡枸杞
33+
34+
来来 深呼吸 对照镜子做练习
35+
单面群面全模拟 不拿offer不放弃
36+
37+
为了拿下BAT 天天提着一口气
38+
大厂小厂投简历 刷光面经笔试题
39+
天生我才难自弃 可惜面试都悲剧
40+
努力 我要努力 我要变成收割机
41+
Wow
42+
43+
在哪里在哪里在哪
44+
在哪里在哪里在哪
45+
在哪里在哪里在哪
46+
在哪里在哪里在哪
47+
我的offer在哪里
48+
燃烧我的卡路里
49+
50+
拜拜 二次元 综艺直播动作片 言情玄幻宫斗剧
51+
拿走拿走别客气
52+
53+
拜拜 铂金一 戒掉农药戒吃鸡 通宵开黑玩游戏
54+
别再熬夜伤身体
55+
56+
来来 沉住气 专业课本重拾起 牛客网上刷真题
57+
保温杯里泡枸杞
58+
59+
来来 深呼吸 对照镜子做练习
60+
单面群面全模拟 不拿offer不放弃
61+
62+
奇了怪了 小的时候明明是妈妈说
63+
考上大学就好惹 没烦恼
64+
直到熟悉的大学的寝室都住不上了 原来毕了业
65+
没人要 才烦恼
66+
希望 offer
67+
钱是多哒
68+
HR
69+
超nice哒
70+
不如跟着节奏没在怕的 努努力
71+
别让校招季卡住你 卡住你
72+
不拿offer不放弃
73+
燃烧我的卡路里
74+
75+
拜拜 二次元 综艺直播动作片 言情玄幻宫斗剧
76+
拿走拿走别客气
77+
78+
拜拜 铂金一 戒掉农药戒吃鸡 通宵开黑玩游戏
79+
别再熬夜伤身体
80+
81+
来来 沉住气 专业课本重拾起 牛客网上刷真题
82+
保温杯里泡枸杞
83+
84+
来来 深呼吸 对照镜子做练习
85+
单面群面全模拟 不拿offer不放弃
86+
不放弃
87+
燃烧我的卡路里
88+
不放弃
89+
燃烧我的卡路里
90+
91+
我要变成收割机
92+
```

sw.js

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/* ===========================================================
2+
* docsify sw.js
3+
* ===========================================================
4+
* Copyright 2016 @huxpro
5+
* Licensed under Apache 2.0
6+
* Register service worker.
7+
* ========================================================== */
8+
9+
const RUNTIME = 'docsify'
10+
const HOSTNAME_WHITELIST = [
11+
self.location.hostname,
12+
'fonts.gstatic.com',
13+
'fonts.googleapis.com',
14+
'unpkg.com'
15+
]
16+
17+
// The Util Function to hack URLs of intercepted requests
18+
const getFixedUrl = (req) => {
19+
var now = Date.now()
20+
var url = new URL(req.url)
21+
22+
// 1. fixed http URL
23+
// Just keep syncing with location.protocol
24+
// fetch(httpURL) belongs to active mixed content.
25+
// And fetch(httpRequest) is not supported yet.
26+
url.protocol = self.location.protocol
27+
28+
// 2. add query for caching-busting.
29+
// Github Pages served with Cache-Control: max-age=600
30+
// max-age on mutable content is error-prone, with SW life of bugs can even extend.
31+
// Until cache mode of Fetch API landed, we have to workaround cache-busting with query string.
32+
// Cache-Control-Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=453190
33+
if (url.hostname === self.location.hostname) {
34+
url.search += (url.search ? '&' : '?') + 'cache-bust=' + now
35+
}
36+
return url.href
37+
}
38+
39+
/**
40+
* @Lifecycle Activate
41+
* New one activated when old isnt being used.
42+
*
43+
* waitUntil(): activating ====> activated
44+
*/
45+
self.addEventListener('activate', event => {
46+
event.waitUntil(self.clients.claim())
47+
})
48+
49+
/**
50+
* @Functional Fetch
51+
* All network requests are being intercepted here.
52+
*
53+
* void respondWith(Promise<Response> r)
54+
*/
55+
self.addEventListener('fetch', event => {
56+
// Skip some of cross-origin requests, like those for Google Analytics.
57+
if (HOSTNAME_WHITELIST.indexOf(new URL(event.request.url).hostname) > -1) {
58+
// Stale-while-revalidate
59+
// similar to HTTP's stale-while-revalidate: https://www.mnot.net/blog/2007/12/12/stale
60+
// Upgrade from Jake's to Surma's: https://gist.github.com/surma/eb441223daaedf880801ad80006389f1
61+
const cached = caches.match(event.request)
62+
const fixedUrl = getFixedUrl(event.request)
63+
const fetched = fetch(fixedUrl, { cache: 'no-store' })
64+
const fetchedCopy = fetched.then(resp => resp.clone())
65+
66+
// Call respondWith() with whatever we get first.
67+
// If the fetch fails (e.g disconnected), wait for the cache.
68+
// If there’s nothing in cache, wait for the fetch.
69+
// If neither yields a response, return offline pages.
70+
event.respondWith(
71+
Promise.race([fetched.catch(_ => cached), cached])
72+
.then(resp => resp || fetched)
73+
.catch(_ => { /* eat any errors */ })
74+
)
75+
76+
// Update the cache with the version we fetched (only for ok status)
77+
event.waitUntil(
78+
Promise.all([fetchedCopy, caches.open(RUNTIME)])
79+
.then(([response, cache]) => response.ok && cache.put(event.request, response))
80+
.catch(_ => { /* eat any errors */ })
81+
)
82+
}
83+
})

0 commit comments

Comments
 (0)