Skip to content

Commit 1690af5

Browse files
committedFeb 2, 2020
feat: update docs -> design pattern function array object math primitive types utils
1 parent cc4532e commit 1690af5

File tree

44 files changed

+982
-64
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+982
-64
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<template>
2+
<SWUpdatePopup v-slot="{ enabled, reload, message, buttonText }">
3+
<div
4+
v-if="enabled"
5+
class="my-sw-update-popup">
6+
{{ message }}<br>
7+
<button @click="reload">{{ buttonText }}</button>
8+
</div>
9+
</SWUpdatePopup>
10+
</template>
11+
12+
<script>
13+
import SWUpdatePopup from '@vuepress/plugin-pwa/lib/SWUpdatePopup.vue'
14+
15+
export default {
16+
components: { SWUpdatePopup }
17+
}
18+
</script>
19+
20+
<style>
21+
.my-sw-update-popup {
22+
text-align: right;
23+
position: fixed;
24+
bottom: 20px;
25+
right: 20px;
26+
background-color: #fff;
27+
font-size: 20px;
28+
padding: 10px;
29+
border: 5px solid #3eaf7c;
30+
}
31+
32+
.my-sw-update-popup button {
33+
border: 1px solid #fefefe;
34+
}
35+
</style>

‎docs/.vuepress/config.js

+27-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@ const plugins = require('./utils/plugins');
33
const { sidebarHelper } = require('./utils/sidebarHelper');
44
const nav = require('./utils/nav');
55

6+
/**
7+
* @description [guide, how-to-write-docs, ...]
8+
*/
9+
const docs = sidebarHelper();
10+
const sidebar = [];
11+
docs.map(item => {
12+
if (item.path.includes('guide') || item.path.includes('how-to-write-docs')) {
13+
sidebar.unshift(item)
14+
} else {
15+
sidebar.push(item)
16+
}
17+
});
18+
[sidebar[1], sidebar[0]] = [sidebar[0], sidebar[1]];
19+
20+
621
module.exports = {
722
// base: '/awesome-javascript-code-implementation/',
823
base: '',
@@ -12,7 +27,15 @@ module.exports = {
1227
head: [
1328
['link', { rel: 'icon', href: '/logo.png' }],
1429
['link', { rel: 'stylesheet', href: 'https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/katex.min.css' }],
15-
['link', { rel: 'stylesheet', href: 'https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/2.10.0/github-markdown.min.css' }]
30+
['link', { rel: 'stylesheet', href: 'https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/2.10.0/github-markdown.min.css' }],
31+
['link', { rel: 'manifest', href: '/manifest.json' }],
32+
['meta', { name: 'theme-color', content: '#3eaf7c' }],
33+
['meta', { name: 'apple-mobile-web-app-capable', content: 'yes' }],
34+
['meta', { name: 'apple-mobile-web-app-status-bar-style', content: 'black' }],
35+
['link', { rel: 'apple-touch-icon', href: '/icons/apple-touch-icon-152x152.png' }],
36+
['link', { rel: 'mask-icon', href: '/icons/safari-pinned-tab.svg', color: '#3eaf7c' }],
37+
['meta', { name: 'msapplication-TileImage', content: '/icons/msapplication-icon-144x144.png' }],
38+
['meta', { name: 'msapplication-TileColor', content: '#000000' }],
1639
],
1740
configureWebpack: {
1841
resolve: {
@@ -48,7 +71,7 @@ module.exports = {
4871
repoLabel: 'Repo',
4972

5073
displayAllHeaders: true,
51-
sidebar: sidebarHelper(),
74+
sidebar,
5275
nav,
5376

5477
// polyfill IE
@@ -69,8 +92,8 @@ module.exports = {
6992
search: true,
7093
searchMaxSuggestions: 10,
7194
// algolia: {
72-
// apiKey: '<API_KEY>',
73-
// indexName: '<INDEX_NAME>'
95+
// apiKey: '',
96+
// indexName: ''
7497
// },
7598

7699
// PWA

0 commit comments

Comments
 (0)
Please sign in to comment.