docsify-plugin-google-adsense 0.0.1 → 0.0.3

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.
@@ -0,0 +1,24 @@
1
+ name: Publish Package
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ id-token: write # Required for OIDC
11
+ contents: read
12
+
13
+ jobs:
14
+ publish:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - uses: actions/setup-node@v4
19
+ with:
20
+ node-version: '24'
21
+ registry-url: 'https://registry.npmjs.org'
22
+ - run: npm ci
23
+ - run: npm run build --if-present
24
+ - run: npm publish
@@ -1,16 +1,16 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="CheckStyle-IDEA" serialisationVersion="2">
4
- <checkstyleVersion>13.0.0</checkstyleVersion>
5
- <scanScope>JavaOnly</scanScope>
6
- <copyLibs>true</copyLibs>
7
- <option name="thirdPartyClasspath" />
8
- <option name="activeLocationIds" />
9
- <option name="locations">
10
- <list>
11
- <ConfigurationLocation id="bundled-sun-checks" type="BUNDLED" scope="All" description="Sun Checks">(bundled)</ConfigurationLocation>
12
- <ConfigurationLocation id="bundled-google-checks" type="BUNDLED" scope="All" description="Google Checks">(bundled)</ConfigurationLocation>
13
- </list>
14
- </option>
15
- </component>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="CheckStyle-IDEA" serialisationVersion="2">
4
+ <checkstyleVersion>13.0.0</checkstyleVersion>
5
+ <scanScope>JavaOnly</scanScope>
6
+ <copyLibs>true</copyLibs>
7
+ <option name="thirdPartyClasspath" />
8
+ <option name="activeLocationIds" />
9
+ <option name="locations">
10
+ <list>
11
+ <ConfigurationLocation id="bundled-sun-checks" type="BUNDLED" scope="All" description="Sun Checks">(bundled)</ConfigurationLocation>
12
+ <ConfigurationLocation id="bundled-google-checks" type="BUNDLED" scope="All" description="Google Checks">(bundled)</ConfigurationLocation>
13
+ </list>
14
+ </option>
15
+ </component>
16
16
  </project>
package/.idea/vcs.xml CHANGED
@@ -1,6 +1,6 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
5
- </component>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
6
  </project>
package/README.md CHANGED
@@ -1,29 +1,28 @@
1
- # docsify-plugin-adsense
2
-
3
- [docsify](https://docsify.js.org/) plugin to make you easy to join up [google adsense](https://www.google.com/adsense)
4
-
5
- [![](https://img.shields.io/github/downloads/iscod/docsify-plugin-adsense/total)](https://github.com/iscod/docsify-plugin-adsense/releases)
6
-
7
- ## Usage
8
-
9
- ```html
10
- <script src="//cdn.jsdelivr.net/npm/docsify-plugin-adsense@1/index.min.js"></script>
11
- ```
12
-
13
- ```js
14
- window.$docsify = {
15
- plugins: [
16
- // Change to your adsense ca-pub-xxxx
17
- DocsifyAds.create('ca-pub-xxxx')
18
- ]
19
- }
20
- ```
21
-
22
- ## Example
23
-
24
- See example site: [iscod.github.io](http://iscod.github.io)
25
-
26
- ## ☕️ Donate
27
-
28
- [![Donate](https://img.shields.io/badge/Donate-WebChat-50BE6E)](https://iscod.github.io/images/donate/webchat.png)
29
- [![Donate](https://img.shields.io/badge/Donate-AliPay-377EF8)](https://iscod.github.io/images/donate/alipay.png)
1
+ # docsify-plugin-google-adsense
2
+
3
+ [docsify](https://docsify.js.org/) plugin to make you easy to join up [google adsense](https://www.google.com/adsense)
4
+
5
+ [![](https://img.shields.io/github/downloads/iscod/docsify-plugin-adsense/total)](https://github.com/iscod/docsify-plugin-adsense/releases)
6
+
7
+ ## Usage
8
+
9
+ ```html
10
+ <script src="//cdn.jsdelivr.net/npm/docsify-plugin-google-adsense@latest/index.min.js"></script>
11
+ ```
12
+
13
+ ```js
14
+ window.$docsify = {
15
+ plugins: [
16
+ // Change to your adsense ca-pub-xxxx
17
+ DocsifyAds.create('ca-pub-xxxx', 'xxxxxx')
18
+ ]
19
+ }
20
+ ```
21
+
22
+ ## Example
23
+
24
+ See example site: [docsify.isharkfly.com](https://docsify.isharkfly.com/#/)
25
+
26
+ ## iSharkFly
27
+
28
+ [www.isharkfly.com](https://www.isharkfly.com/t/topic/7)
package/index.js CHANGED
@@ -1,105 +1,50 @@
1
- (function(window) {
2
- window.DocsifyAds = {
3
- create(caPub) {
4
- return function(hook, vm) {
5
- hook.ready(function() {
6
- window.DocsifyAds.injectStyle();
7
- });
8
-
9
- hook.doneEach(function() {
10
- window.DocsifyAds.injectScript(caPub);
11
- });
12
- };
13
- },
14
-
15
- injectScript(caPub) {
16
- const adEl = document.querySelector("#adsense");
17
- const scriptID = "_adsense_js";
18
- const sidebarEl = document.querySelector(".sidebar-nav");
19
-
20
- if (!adEl && sidebarEl) {
21
- let scriptEl = document.querySelector(`#${scriptID}`);
22
-
23
- if (scriptEl) {
24
- scriptEl = scriptEl.parentNode.removeChild(scriptEl);
25
- } else {
26
- scriptEl = document.createElement("script");
27
- scriptEl.src = `https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${caPub}`;
28
- scriptEl.async = "async";
29
- scriptEl.id = scriptID;
30
- }
31
-
32
- sidebarEl.insertBefore(scriptEl, sidebarEl.firstChild);
33
- }
34
- },
35
-
36
- injectStyle() {
37
- const styleEl = document.createElement("style");
38
-
39
- styleEl.textContent = `
40
- #adsense * {
41
- margin: initial;
42
- padding: initial;
43
- }
44
-
45
- #adsense {
46
- max-width: 330px;
47
- background-color: #fafafa;
48
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
49
- Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial,
50
- sans-serif;
51
- }
52
-
53
- #adsense a {
54
- color: inherit;
55
- text-decoration: none;
56
- }
57
-
58
- #adsense a:hover {
59
- color: inherit;
60
- }
61
-
62
- #adsense span {
63
- display: block;
64
- position: relative;
65
- overflow: hidden;
66
- }
67
-
68
- #adsense .adsense-wrap {
69
- display: flex;
70
- }
71
-
72
- #adsense .adsense-img img {
73
- display: block;
74
- }
75
-
76
- #adsense .adsense-text {
77
- align-self: center;
78
- margin-bottom: 20px;
79
- padding: 8px 10px;
80
- font-size: 12px;
81
- line-height: 1.5;
82
- text-align: left;
83
- }
84
-
85
- #adsense .adsense-poweredby {
86
- display: block;
87
- position: absolute;
88
- bottom: 0;
89
- right: 0;
90
- padding: 6px 8px;
91
- border-top-left-radius: 3px;
92
- background-color: #f1f1f1;
93
- font-size: 8px;
94
- font-weight: 600;
95
- line-height: 1;
96
- letter-spacing: 0.5px;
97
- text-align: center;
98
- text-transform: uppercase;
99
- }
100
- `;
101
-
102
- document.head.insertBefore(styleEl, document.querySelector("head style, head link[rel*='stylesheet']"));
103
- },
104
- };
105
- })(window);
1
+ (function (window) {
2
+ window.DocsifyAds = {
3
+ create(caPub) {
4
+ return function (hook, vm) {
5
+ hook.ready(function () {
6
+ window.DocsifyAds.injectStyle();
7
+ });
8
+
9
+ hook.doneEach(function () {
10
+ window.DocsifyAds.injectScript(caPub);
11
+ });
12
+ };
13
+ },
14
+
15
+ injectScript(caPub) {
16
+ const adEl = document.querySelector("#adsense");
17
+ const scriptID = "_adsense_js";
18
+ const sidebarEl = document.querySelector(".sidebar-nav");
19
+
20
+ if (!adEl && sidebarEl) {
21
+ let scriptEl = document.querySelector(`#${scriptID}`);
22
+
23
+ if (scriptEl) {
24
+ scriptEl = scriptEl.parentNode.removeChild(scriptEl);
25
+ } else {
26
+ scriptEl = document.createElement("script");
27
+ scriptEl.src = `https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${caPub}`;
28
+ scriptEl.async = "async";
29
+ scriptEl.id = scriptID;
30
+ }
31
+
32
+ sidebarEl.insertBefore(scriptEl, sidebarEl.firstChild);
33
+ }
34
+ },
35
+
36
+ injectStyle() {
37
+ const styleEl = document.createElement("style");
38
+
39
+ styleEl.textContent = `
40
+ #adsense * {
41
+ margin: initial;
42
+ padding: initial;
43
+ }
44
+
45
+ `;
46
+
47
+ document.head.insertBefore(styleEl, document.querySelector("head style, head link[rel*='stylesheet']"));
48
+ },
49
+ };
50
+ })(window);
package/package.json CHANGED
@@ -1,25 +1,25 @@
1
- {
2
- "name": "docsify-plugin-google-adsense ",
3
- "version": "0.0.1",
4
- "description": "[docsify](https://docsify.js.org/) plugin to make you easy to join up [google adsense](https://www.google.com/adsense)",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
- "repository": {
10
- "type": "git",
11
- "url": "https://src.isharkfly.com/iSharkFly-Open/docsify-plugin-adsense.git"
12
- },
13
- "keywords": [
14
- "google adsense",
15
- "adsense",
16
- "docsify",
17
- "plugin"
18
- ],
19
- "author": "iSharkFly",
20
- "license": "MIT",
21
- "bugs": {
22
- "url": "https://src.isharkfly.com/iSharkFly-Open/docsify-plugin-adsense"
23
- },
24
- "homepage": "https://src.isharkfly.com/iSharkFly-Open/docsify-plugin-adsense#readme"
25
- }
1
+ {
2
+ "name": "docsify-plugin-google-adsense ",
3
+ "version": "0.0.3",
4
+ "description": "[docsify](https://docsify.js.org/) plugin to make you easy to join up [google adsense](https://www.google.com/adsense)",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/honeymoose/docsify-plugin-google-adsense.git"
12
+ },
13
+ "keywords": [
14
+ "google adsense",
15
+ "adsense",
16
+ "docsify",
17
+ "plugin"
18
+ ],
19
+ "author": "iSharkFly",
20
+ "license": "MIT",
21
+ "bugs": {
22
+ "url": "https://src.isharkfly.com/iSharkFly-Open/docsify-plugin-adsense"
23
+ },
24
+ "homepage": "https://src.isharkfly.com/iSharkFly-Open/docsify-plugin-adsense#readme"
25
+ }
package/.idea/misc.xml DELETED
@@ -1,9 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectRootManager" version="2">
4
- <output url="file://$PROJECT_DIR$/out" />
5
- </component>
6
- <component name="ThriftCompiler">
7
- <compilers />
8
- </component>
9
- </project>
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/docsify-plugin-adsense.iml" filepath="$PROJECT_DIR$/docsify-plugin-adsense.iml" />
6
- </modules>
7
- </component>
8
- </project>
@@ -1,9 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="WEB_MODULE" version="4">
3
- <component name="NewModuleRootManager" inherit-compiler-output="true">
4
- <exclude-output />
5
- <content url="file://$MODULE_DIR$" />
6
- <orderEntry type="inheritedJdk" />
7
- <orderEntry type="sourceFolder" forTests="false" />
8
- </component>
9
- </module>