@markbattistella/docsify-sidebarfooter 5.0.3 → 5.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +185 -0
- package/dist/docsify-sidebar.min.js +2 -2
- package/docs/README.md +2 -0
- package/docs/dist/docsify-sidebar.js +50 -32
- package/docs/dist/docsify-sidebar.min.js +2 -2
- package/docs/index.html +3 -3
- package/docs/site/cover.md +1 -1
- package/docs/site/style.min.css +4 -0
- package/package.json +4 -3
package/README.md
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# docsify.js sidebar footer
|
|
4
|
+
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
This plugin enhances your website's sidebar or page by creating a footer area where you can display important information. It automatically updates the copyright year or range, allows you to include your name or company with a URL, and provides links to a privacy policy, terms of service, and cookies policy pages. By utilising this plugin, you can easily showcase relevant legal information, personalise your website, and promote transparency and compliance.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
!> **Note: There are breaking changes in the configuration from `v4.x` to `v5.x`. Please take the time to read all the documentation before upgrading**
|
|
12
|
+
|
|
13
|
+
### Update `index.html` file
|
|
14
|
+
|
|
15
|
+
Assuming you have a working [docsify](https://docsify.js.org/) framework set up, it is easy to use the plugin.
|
|
16
|
+
|
|
17
|
+
1. Add one of the following script tags to your `index.html` via either CDN or downloading it and using it locally:
|
|
18
|
+
|
|
19
|
+
```html
|
|
20
|
+
<!-- unpkg.com -->
|
|
21
|
+
<script src="https://unpkg.com/@markbattistella/docsify-sidebarfooter@latest"></script>
|
|
22
|
+
|
|
23
|
+
<!-- jsDelivr -->
|
|
24
|
+
<script src="https://cdn.jsdelivr.net/npm/@markbattistella/docsify-sidebarfooter@latest"></script>
|
|
25
|
+
|
|
26
|
+
<!-- locally -->
|
|
27
|
+
<script src="docsify-sidebar.min.js"></script>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
1. In docsify setup configure the plugin:
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
<script>
|
|
34
|
+
window.$docsify = {
|
|
35
|
+
autoFooter: {
|
|
36
|
+
|
|
37
|
+
// the name you wish to display as the copyright holder
|
|
38
|
+
name: String,
|
|
39
|
+
|
|
40
|
+
// the URL (personal or company) which clicking the `name` goes to
|
|
41
|
+
url: String,
|
|
42
|
+
|
|
43
|
+
// the start year of copyright
|
|
44
|
+
copyYear: String,
|
|
45
|
+
|
|
46
|
+
// show the privacy policy link
|
|
47
|
+
policy: Bool | String,
|
|
48
|
+
|
|
49
|
+
// show the terms of service link
|
|
50
|
+
terms: Bool | String,
|
|
51
|
+
|
|
52
|
+
// show the cookies policy link
|
|
53
|
+
cookies: Bool | String,
|
|
54
|
+
|
|
55
|
+
// use your own css styles or the built in ones
|
|
56
|
+
customStyle: Bool | String
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
</script>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Additional files
|
|
63
|
+
|
|
64
|
+
#### Default
|
|
65
|
+
|
|
66
|
+
If you set the `policy`, `terms`, or `cookies` options to `true` the URL links for those pages will look for the markdown files directly next to the `index.html` file:
|
|
67
|
+
|
|
68
|
+
```js
|
|
69
|
+
// ... other config
|
|
70
|
+
policy: true,
|
|
71
|
+
terms: true,
|
|
72
|
+
cookies: true,
|
|
73
|
+
// ... other config
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
```md
|
|
77
|
+
- index.html --> https://your-awesome-site.com/#/
|
|
78
|
+
- _policy.md --> https://your-awesome-site.com/#/_policy
|
|
79
|
+
- _terms.md --> https://your-awesome-site.com/#/_terms
|
|
80
|
+
- _cookies.md --> https://your-awesome-site.com/#/_cookies
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
#### Sub-folder
|
|
84
|
+
|
|
85
|
+
However, if you enter a string it will append that to the base URL of your website:
|
|
86
|
+
|
|
87
|
+
```js
|
|
88
|
+
// ... other config
|
|
89
|
+
policy: 'site/policy',
|
|
90
|
+
terms: 'site/terms',
|
|
91
|
+
cookies: 'site/cookies',
|
|
92
|
+
// ... other config
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
```md
|
|
96
|
+
- index.html --> https://your-awesome-site.com/#/
|
|
97
|
+
- site/
|
|
98
|
+
\__ policy.md --> https://your-awesome-site.com/#/site/policy
|
|
99
|
+
\__ terms.md --> https://your-awesome-site.com/#/site/terms
|
|
100
|
+
\__ cookies.md --> https://your-awesome-site.com/#/site/cookies
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
#### External links
|
|
104
|
+
|
|
105
|
+
If you host your policy, terms, or cookies messages on an external website (or need to link to a parent company policy) you can add them in as the full URL:
|
|
106
|
+
|
|
107
|
+
```js
|
|
108
|
+
// ... other config
|
|
109
|
+
policy: "https://my-other-website.com/policy",
|
|
110
|
+
terms: "https://my-other-website.com/terms",
|
|
111
|
+
cookies: "https://my-other-website.com/cookies",
|
|
112
|
+
// ... other config
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
These will open those pages in a new tab directly.
|
|
116
|
+
|
|
117
|
+
## Configuration
|
|
118
|
+
|
|
119
|
+
There are some options available for the `docsify-sidebarfooter`:
|
|
120
|
+
|
|
121
|
+
| Setting | Type | Options |
|
|
122
|
+
|---------------|----------------|------------------------------------|
|
|
123
|
+
| `name` | String | your name or company |
|
|
124
|
+
| `url` | String | url you want the `name` to link to |
|
|
125
|
+
| `copyYear` | String | first year of copyright |
|
|
126
|
+
| `policy` | Bool or String | - `false` hides it from the site<br/>- `true` defaults to `_policy.md`<br/>- a custom string will direct to that |
|
|
127
|
+
| `terms` | Bool or String | - `false` hides it from the site<br/>- `true` defaults to `_terms.md`<br/>- a custom string will direct to that |
|
|
128
|
+
| `cookies` | Bool or String | - `false` hides it from the site<br/>- `true` defaults to `_cookies.md`<br/>- a custom string will direct to that |
|
|
129
|
+
| `customStyle` | Bool or String | - `false` uses in-built css (sidebar styled)<br/>- `true` applies no styles, you can create your own<br/>- `sidebar` uses the in-built css designed for the sidebar<br/>- `body` uses the in-built css designed for the body |
|
|
130
|
+
|
|
131
|
+
## Usage
|
|
132
|
+
|
|
133
|
+
### Sidebar
|
|
134
|
+
|
|
135
|
+
At the bottom of your `_sidebar.md` file add the following code:
|
|
136
|
+
|
|
137
|
+
```html
|
|
138
|
+
<footer id="mb-footer"></footer>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Body
|
|
142
|
+
|
|
143
|
+
Under the `<div id="app"></div>` in your `index.html` file, add the following code:
|
|
144
|
+
|
|
145
|
+
```html
|
|
146
|
+
<footer id="mb-footer"></footer>
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Styling
|
|
150
|
+
|
|
151
|
+
The links container is sectioned into different classes for you to customise as much (or little) as you wish.
|
|
152
|
+
|
|
153
|
+
```html
|
|
154
|
+
<footer id="mb-footer">
|
|
155
|
+
<div class="footer-container">
|
|
156
|
+
<div class="footer-text">
|
|
157
|
+
<span class="footer-text-copyright">
|
|
158
|
+
Copyright © YYYY-YYYY
|
|
159
|
+
</span>
|
|
160
|
+
<span class="footer-text-author">
|
|
161
|
+
<a target="_blank" href="">Your website name</a>
|
|
162
|
+
</span>
|
|
163
|
+
</div>
|
|
164
|
+
<div class="footer-link">
|
|
165
|
+
<span class="footer-links-policy">
|
|
166
|
+
<a href="">Policy</a>
|
|
167
|
+
</span>
|
|
168
|
+
<span class="footer-links-terms">
|
|
169
|
+
<a href="">Terms</a>
|
|
170
|
+
</span>
|
|
171
|
+
<span class="footer-links-cookies">
|
|
172
|
+
<a href="">Cookies</a>
|
|
173
|
+
</span>
|
|
174
|
+
</div>
|
|
175
|
+
</div>
|
|
176
|
+
</footer>
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Contributing
|
|
180
|
+
|
|
181
|
+
1. Clone the repo:<br>`git clone https://github.com/markbattistella/docsify-sidebarFooter.git`
|
|
182
|
+
2. Create your feature branch:<br>`git checkout -b my-feature`
|
|
183
|
+
3. Commit your changes:<br>`git commit -am 'Add some feature'`
|
|
184
|
+
4. `Push` to the branch:<br>`git push origin my-new-feature`
|
|
185
|
+
5. Submit the `pull` request
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! docsify-sidebar.js v5.0.
|
|
2
|
-
"use strict";function doesObjectExists(o){return null!=o&&o.constructor===Object&&0<Object.keys(o).length}function getFooter(o){(new Date).getFullYear();o.name,o.url,o.copyYear,o.policy,o.terms,o.cookies,o.customStyle}var
|
|
1
|
+
/*! docsify-sidebar.js v5.0.4 | (c) Mark Battistella */
|
|
2
|
+
"use strict";function doesObjectExists(o){return null!=o&&o.constructor===Object&&0<Object.keys(o).length}function getFooter(o){(new Date).getFullYear();o.name,o.url,o.copyYear,o.policy,o.terms,o.cookies,o.customStyle}var footerOptions={name:"",url:"",copyYear:"",policy:!0,terms:!0,cookies:!0,customStyle:!1},footerError={unknownError:"ERROR: sidebar-footer plugin - unknown error",configNotSet:"ERROR: sidebar-footer plugin - configuration not set\n\t\t>> this happens when the autoFooter is not found in the index.html file",configIsEmpty:"ERROR: sidebar-footer plugin - configuration is empty\n\t\t>> please consult the documentation for the settings needed"};function autoFooter(o,t){o.init(function(){var o,t,e;getFooter(footerOptions),"boolean"!=typeof footerOptions.customStyle&&"string"!=typeof footerOptions.customStyle||"boolean"==typeof footerOptions.customStyle&&!0===footerOptions.customStyle||(o="#mb-footer { border-top: 1px solid; font-size: 0.8em; line-height: 1.5; transition: all var(--sidebar-transition-duration) ease-out; }",("boolean"==typeof footerOptions.customStyle&&!1===footerOptions.customStyle||"sidebar"===footerOptions.customStyle)&&(o+="#mb-footer { padding-top: 1.5rem; margin-top: 1.5rem; } #mb-footer .footer-text, #mb-footer .footer-text a { font-weight: bold; }"),"body"===footerOptions.customStyle&&(!$docsify.loadSidebar&&null!==$docsify.loadSidebar&&$docsify.hideSidebar||(o+="body #mb-footer { margin-left: var(--sidebar-width); } body.close #mb-footer { margin-left: 0; }"),o+="#mb-footer { padding: 1.5rem; } #mb-footer .footer-container { max-width: var(--content-max-width); margin: 0 auto; } #mb-footer .footer-container { display: grid; grid-template-columns: auto auto; } #mb-footer .footer-container a { margin-left: 2em; } #mb-footer .footer-link { text-align: right; }@media (max-width: 680px) { #mb-footer .footer-container { grid-template-columns: auto; }#mb-footer .footer-text, #mb-footer .footer-link { text-align: center; } } @media (max-width: 400px) { #mb-footer .footer-text, #mb-footer .footer-link { text-align: left; } #mb-footer span { display: block; } #mb-footer .footer-container a { margin: 0; } }"),t=document.querySelector("head"),e=document.createElement("style"),t.appendChild(e),e.appendChild(document.createTextNode(o)))}),o.doneEach(function(){var i,a,o,t,e,r,n,s,c=document.getElementById("mb-footer");c&&(t=(new Date).getFullYear(),i=window.location.origin+window.location.pathname+"#/",a=function(o){var t=document.createElement("a");return t.href=o,t.host!==window.location.host},s=function(o,t,e,r){var n="";return"boolean"!=typeof o&&"string"!=typeof o||("boolean"==typeof o&&o?n='<a href="'.concat(i+e,'">').concat(t,"</a>"):"string"==typeof o&&(n=(a(o)?'<a target="_blank" href="'.concat(o,'">'):'<a href="'.concat(i+o,'">')).concat(t,"</a>"))),n&&(e="".concat(r.toLowerCase().replace(/\s+/g,"-")),n='<span class="'.concat(e,'">').concat(n,"</span>")),n},o="</div>",t='<span class="footer-text-copyright">Copyright © '.concat(footerOptions.copyYear&&footerOptions.copyYear<=t?"".concat(footerOptions.copyYear).concat(footerOptions.copyYear<t?"-"+t:""):t,"</span>"),e=s(footerOptions.url,footerOptions.name,"","footer-text-author"),r=s(footerOptions.policy,"Policy","_policy","footer-links-policy"),n=s(footerOptions.terms,"Terms","_terms","footer-links-terms"),s=s(footerOptions.cookies,"Cookies","_cookies","footer-links-cookies"),c.innerHTML='<div class="footer-container"><div class="footer-text">'+t+e+o+'<div class="footer-link">'+r+n+s+o+o)})}if(void 0===footerOptions||!doesObjectExists(footerOptions)){if("undefined"!=typeof headerOptions&&doesObjectExists(headerOptions))throw footerError.unknownError;throw footerError.configNotSet}window.$docsify.autoFooter=Object.assign(footerOptions,window.$docsify.autoFooter),window.$docsify.plugins=[].concat(autoFooter,window.$docsify.plugins);
|
package/docs/README.md
CHANGED
|
@@ -8,6 +8,8 @@ This plugin enhances your website's sidebar or page by creating a footer area wh
|
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
11
|
+
!> **Note: There are breaking changes in the configuration from `v4.x` to `v5.x`. Please take the time to read all the documentation before upgrading**
|
|
12
|
+
|
|
11
13
|
### Update `index.html` file
|
|
12
14
|
|
|
13
15
|
Assuming you have a working [docsify](https://docsify.js.org/) framework set up, it is easy to use the plugin.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! docsify-sidebar.js v5.0.
|
|
1
|
+
/*! docsify-sidebar.js v5.0.4 | (c) Mark Battistella */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
// MARK: - check if object exists and is not empty
|
|
@@ -13,24 +13,24 @@ function doesObjectExists(obj) {
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
// MARK: - update the `options` object
|
|
16
|
-
function getFooter(
|
|
16
|
+
function getFooter(footerOptions) {
|
|
17
17
|
|
|
18
18
|
// -- get this year
|
|
19
19
|
let date = new Date().getFullYear();
|
|
20
20
|
|
|
21
21
|
// -- update the variables
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
footerOptions.name ? footerOptions.name : null;
|
|
23
|
+
footerOptions.url ? footerOptions.url : null;
|
|
24
|
+
footerOptions.copyYear ? footerOptions.copyYear : date;
|
|
25
|
+
footerOptions.policy ? footerOptions.policy : false;
|
|
26
|
+
footerOptions.terms ? footerOptions.terms : false;
|
|
27
|
+
footerOptions.cookies ? footerOptions.cookies : false;
|
|
28
|
+
footerOptions.customStyle ? footerOptions.customStyle : false;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
// defaults
|
|
33
|
-
const
|
|
32
|
+
// -- defaults
|
|
33
|
+
const footerOptions = {
|
|
34
34
|
name: '',
|
|
35
35
|
url: '',
|
|
36
36
|
copyYear: '',
|
|
@@ -38,6 +38,19 @@ const options = {
|
|
|
38
38
|
terms: true,
|
|
39
39
|
cookies: true,
|
|
40
40
|
customStyle: false
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
// -- errors
|
|
44
|
+
footerError = {
|
|
45
|
+
|
|
46
|
+
// -- error: when something that shouldn't happen, happens
|
|
47
|
+
unknownError: 'ERROR: sidebar-footer plugin - unknown error',
|
|
48
|
+
|
|
49
|
+
// -- error: configuration not set
|
|
50
|
+
configNotSet: `ERROR: sidebar-footer plugin - configuration not set\n\t\t>> this happens when the autoFooter is not found in the index.html file`,
|
|
51
|
+
|
|
52
|
+
// -- error: configuration is empty object
|
|
53
|
+
configIsEmpty: `ERROR: sidebar-footer plugin - configuration is empty\n\t\t>> please consult the documentation for the settings needed`
|
|
41
54
|
};
|
|
42
55
|
|
|
43
56
|
|
|
@@ -48,14 +61,14 @@ function autoFooter(hook, vm) {
|
|
|
48
61
|
hook.init(function () {
|
|
49
62
|
|
|
50
63
|
// -- initialise the options
|
|
51
|
-
getFooter(
|
|
64
|
+
getFooter(footerOptions);
|
|
52
65
|
|
|
53
66
|
|
|
54
67
|
// -- check the options for bool or string
|
|
55
|
-
if (typeof
|
|
68
|
+
if (typeof footerOptions.customStyle === "boolean" || typeof footerOptions.customStyle === "string") {
|
|
56
69
|
|
|
57
70
|
// -- dont continue if using custom styles
|
|
58
|
-
if ((typeof
|
|
71
|
+
if ((typeof footerOptions.customStyle === "boolean" && footerOptions.customStyle === true)) {
|
|
59
72
|
return;
|
|
60
73
|
}
|
|
61
74
|
|
|
@@ -63,14 +76,14 @@ function autoFooter(hook, vm) {
|
|
|
63
76
|
let style = `#mb-footer { border-top: 1px solid; font-size: 0.8em; line-height: 1.5; transition: all var(--sidebar-transition-duration) ease-out; }`;
|
|
64
77
|
|
|
65
78
|
// -- custom style for sidebar
|
|
66
|
-
if ((typeof
|
|
67
|
-
(
|
|
79
|
+
if ((typeof footerOptions.customStyle === "boolean" && footerOptions.customStyle === false) ||
|
|
80
|
+
(footerOptions.customStyle === "sidebar")
|
|
68
81
|
) {
|
|
69
82
|
style += `#mb-footer { padding-top: 1.5rem; margin-top: 1.5rem; } #mb-footer .footer-text, #mb-footer .footer-text a { font-weight: bold; }`;
|
|
70
83
|
}
|
|
71
84
|
|
|
72
85
|
// -- custom style for sidebar
|
|
73
|
-
if (
|
|
86
|
+
if (footerOptions.customStyle === "body") {
|
|
74
87
|
|
|
75
88
|
// --> if there is a sidebar
|
|
76
89
|
if( $docsify.loadSidebar || $docsify.loadSidebar === null || !$docsify.hideSidebar ) {
|
|
@@ -173,17 +186,17 @@ function autoFooter(hook, vm) {
|
|
|
173
186
|
// -- text
|
|
174
187
|
copyright = (
|
|
175
188
|
`<span class="footer-text-copyright">Copyright © ${
|
|
176
|
-
|
|
177
|
-
? `${
|
|
189
|
+
footerOptions.copyYear && footerOptions.copyYear <= date
|
|
190
|
+
? `${footerOptions.copyYear}${footerOptions.copyYear < date ? "-" + date : ""}`
|
|
178
191
|
: date
|
|
179
192
|
}</span>`
|
|
180
193
|
),
|
|
181
|
-
author = createLink(
|
|
194
|
+
author = createLink( footerOptions.url, footerOptions.name, '', 'footer-text-author'),
|
|
182
195
|
|
|
183
196
|
// -- links
|
|
184
|
-
policyURL = createLink(
|
|
185
|
-
termsURL = createLink(
|
|
186
|
-
cookiesURL = createLink(
|
|
197
|
+
policyURL = createLink(footerOptions.policy, 'Policy', '_policy', 'footer-links-policy'),
|
|
198
|
+
termsURL = createLink(footerOptions.terms, 'Terms', '_terms', 'footer-links-terms' ),
|
|
199
|
+
cookiesURL = createLink(footerOptions.cookies, 'Cookies', '_cookies', 'footer-links-cookies'),
|
|
187
200
|
|
|
188
201
|
// output
|
|
189
202
|
output = (
|
|
@@ -199,22 +212,27 @@ function autoFooter(hook, vm) {
|
|
|
199
212
|
|
|
200
213
|
|
|
201
214
|
// MARK: - check options is defined and not empty
|
|
202
|
-
if (typeof
|
|
215
|
+
if (typeof footerOptions !== 'undefined' && doesObjectExists(footerOptions)) {
|
|
203
216
|
|
|
204
217
|
// -- find footer plugin options
|
|
205
218
|
window.$docsify.autoFooter = Object.assign(
|
|
206
|
-
|
|
219
|
+
footerOptions,
|
|
207
220
|
window.$docsify.autoFooter
|
|
208
221
|
);
|
|
209
222
|
window.$docsify.plugins = [].concat(autoFooter, window.$docsify.plugins);
|
|
210
223
|
|
|
211
224
|
} else {
|
|
212
225
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
226
|
+
// --> config not set in `index.html`
|
|
227
|
+
if (typeof headerOptions === 'undefined') {
|
|
228
|
+
throw footerError.configNotSet
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// --> config is empty object
|
|
232
|
+
if (!doesObjectExists(headerOptions)) {
|
|
233
|
+
throw footerError.configNotSet
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// --> some other error
|
|
237
|
+
throw footerError.unknownError;
|
|
220
238
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! docsify-sidebar.js v5.0.
|
|
2
|
-
"use strict";function doesObjectExists(o){return null!=o&&o.constructor===Object&&0<Object.keys(o).length}function getFooter(o){(new Date).getFullYear();o.name,o.url,o.copyYear,o.policy,o.terms,o.cookies,o.customStyle}var
|
|
1
|
+
/*! docsify-sidebar.js v5.0.4 | (c) Mark Battistella */
|
|
2
|
+
"use strict";function doesObjectExists(o){return null!=o&&o.constructor===Object&&0<Object.keys(o).length}function getFooter(o){(new Date).getFullYear();o.name,o.url,o.copyYear,o.policy,o.terms,o.cookies,o.customStyle}var footerOptions={name:"",url:"",copyYear:"",policy:!0,terms:!0,cookies:!0,customStyle:!1},footerError={unknownError:"ERROR: sidebar-footer plugin - unknown error",configNotSet:"ERROR: sidebar-footer plugin - configuration not set\n\t\t>> this happens when the autoFooter is not found in the index.html file",configIsEmpty:"ERROR: sidebar-footer plugin - configuration is empty\n\t\t>> please consult the documentation for the settings needed"};function autoFooter(o,t){o.init(function(){var o,t,e;getFooter(footerOptions),"boolean"!=typeof footerOptions.customStyle&&"string"!=typeof footerOptions.customStyle||"boolean"==typeof footerOptions.customStyle&&!0===footerOptions.customStyle||(o="#mb-footer { border-top: 1px solid; font-size: 0.8em; line-height: 1.5; transition: all var(--sidebar-transition-duration) ease-out; }",("boolean"==typeof footerOptions.customStyle&&!1===footerOptions.customStyle||"sidebar"===footerOptions.customStyle)&&(o+="#mb-footer { padding-top: 1.5rem; margin-top: 1.5rem; } #mb-footer .footer-text, #mb-footer .footer-text a { font-weight: bold; }"),"body"===footerOptions.customStyle&&(!$docsify.loadSidebar&&null!==$docsify.loadSidebar&&$docsify.hideSidebar||(o+="body #mb-footer { margin-left: var(--sidebar-width); } body.close #mb-footer { margin-left: 0; }"),o+="#mb-footer { padding: 1.5rem; } #mb-footer .footer-container { max-width: var(--content-max-width); margin: 0 auto; } #mb-footer .footer-container { display: grid; grid-template-columns: auto auto; } #mb-footer .footer-container a { margin-left: 2em; } #mb-footer .footer-link { text-align: right; }@media (max-width: 680px) { #mb-footer .footer-container { grid-template-columns: auto; }#mb-footer .footer-text, #mb-footer .footer-link { text-align: center; } } @media (max-width: 400px) { #mb-footer .footer-text, #mb-footer .footer-link { text-align: left; } #mb-footer span { display: block; } #mb-footer .footer-container a { margin: 0; } }"),t=document.querySelector("head"),e=document.createElement("style"),t.appendChild(e),e.appendChild(document.createTextNode(o)))}),o.doneEach(function(){var i,a,o,t,e,r,n,s,c=document.getElementById("mb-footer");c&&(t=(new Date).getFullYear(),i=window.location.origin+window.location.pathname+"#/",a=function(o){var t=document.createElement("a");return t.href=o,t.host!==window.location.host},s=function(o,t,e,r){var n="";return"boolean"!=typeof o&&"string"!=typeof o||("boolean"==typeof o&&o?n='<a href="'.concat(i+e,'">').concat(t,"</a>"):"string"==typeof o&&(n=(a(o)?'<a target="_blank" href="'.concat(o,'">'):'<a href="'.concat(i+o,'">')).concat(t,"</a>"))),n&&(e="".concat(r.toLowerCase().replace(/\s+/g,"-")),n='<span class="'.concat(e,'">').concat(n,"</span>")),n},o="</div>",t='<span class="footer-text-copyright">Copyright © '.concat(footerOptions.copyYear&&footerOptions.copyYear<=t?"".concat(footerOptions.copyYear).concat(footerOptions.copyYear<t?"-"+t:""):t,"</span>"),e=s(footerOptions.url,footerOptions.name,"","footer-text-author"),r=s(footerOptions.policy,"Policy","_policy","footer-links-policy"),n=s(footerOptions.terms,"Terms","_terms","footer-links-terms"),s=s(footerOptions.cookies,"Cookies","_cookies","footer-links-cookies"),c.innerHTML='<div class="footer-container"><div class="footer-text">'+t+e+o+'<div class="footer-link">'+r+n+s+o+o)})}if(void 0===footerOptions||!doesObjectExists(footerOptions)){if("undefined"!=typeof headerOptions&&doesObjectExists(headerOptions))throw footerError.unknownError;throw footerError.configNotSet}window.$docsify.autoFooter=Object.assign(footerOptions,window.$docsify.autoFooter),window.$docsify.plugins=[].concat(autoFooter,window.$docsify.plugins);
|
package/docs/index.html
CHANGED
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
|
|
22
22
|
<script>
|
|
23
23
|
window.$docsify = {
|
|
24
|
-
name: '
|
|
25
|
-
repo: 'https://github.com/markbattistella/docsify-
|
|
24
|
+
name: 'sidebar-footer',
|
|
25
|
+
repo: 'https://github.com/markbattistella/docsify-sidebar-footer',
|
|
26
26
|
coverpage: 'site/cover.md',
|
|
27
27
|
homepage: 'README.md',
|
|
28
28
|
loadSidebar: false,
|
|
@@ -49,6 +49,6 @@
|
|
|
49
49
|
<script src="https://cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script>
|
|
50
50
|
|
|
51
51
|
<!-- local: docsify-sidebarFooter -->
|
|
52
|
-
<script src="dist/docsify-sidebar.
|
|
52
|
+
<script src="dist/docsify-sidebar.js"></script>
|
|
53
53
|
</body>
|
|
54
54
|
</html>
|
package/docs/site/cover.md
CHANGED
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
Add your footer to the sidebar (or anywhere)
|
|
4
4
|
|
|
5
5
|
[Find it on Github](https://github.com/markbattistella/docsify-sidebarFooter)
|
|
6
|
-
[Read more](#
|
|
6
|
+
[Read more](#docsifyjs-sidebar-footer)
|
|
7
7
|
[npm link](https://www.npmjs.com/package/@markbattistella/docsify-sidebarfooter)
|
package/docs/site/style.min.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markbattistella/docsify-sidebarfooter",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.4",
|
|
4
4
|
"description": "Add a footer notice for Docsify.js",
|
|
5
5
|
"main": "./dist/docsify-sidebar.min.js",
|
|
6
6
|
"repository": {
|
|
@@ -12,8 +12,9 @@
|
|
|
12
12
|
"update": "ncu -u && npm update && npm install",
|
|
13
13
|
"babel": "npx babel ./docs/dist/docsify-sidebar.js -o ./docs/dist/docsify-sidebar.babel.js",
|
|
14
14
|
"uglify": "uglifyjs ./docs/dist/docsify-sidebar.babel.js --verbose -c -m -o ./docs/dist/docsify-sidebar.min.js",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
15
|
+
"dupeJS": "cp ./docs/dist/docsify-sidebar.min.js ./dist/docsify-sidebar.min.js",
|
|
16
|
+
"dupeRM": "cp ./docs/README.md ./README.md",
|
|
17
|
+
"minify": "npm run babel && npm run uglify && npm run dupeJS && npm run dupeRM"
|
|
17
18
|
},
|
|
18
19
|
"devDependencies": {
|
|
19
20
|
"docsify-cli": "^4.4.4",
|