Compare commits

...

10 commits

5 changed files with 17 additions and 324 deletions

308
package-lock.json generated
View file

@ -12,7 +12,6 @@
"@node-minify/core": "^8.0.6",
"@node-minify/uglify-js": "^8.0.6",
"express": "^4.18.2",
"git-commit-count": "^1.1.3",
"glob": "^10.4.2",
"himalaya": "^1.1.0",
"minify-html": "^0.0.2",
@ -442,84 +441,6 @@
"node": ">= 0.6"
}
},
"node_modules/execa": {
"version": "0.6.3",
"resolved": "https://registry.npmjs.org/execa/-/execa-0.6.3.tgz",
"integrity": "sha512-/teX3MDLFBdYUhRk8WCBYboIMUmqeizu0m9Z3YF3JWrbEh/SlZg00vLJSaAGWw3wrZ9tE0buNw79eaAPYhUuvg==",
"license": "MIT",
"dependencies": {
"cross-spawn": "^5.0.1",
"get-stream": "^3.0.0",
"is-stream": "^1.1.0",
"npm-run-path": "^2.0.0",
"p-finally": "^1.0.0",
"signal-exit": "^3.0.0",
"strip-eof": "^1.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/execa/node_modules/cross-spawn": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
"integrity": "sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==",
"license": "MIT",
"dependencies": {
"lru-cache": "^4.0.1",
"shebang-command": "^1.2.0",
"which": "^1.2.9"
}
},
"node_modules/execa/node_modules/lru-cache": {
"version": "4.1.5",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz",
"integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==",
"license": "ISC",
"dependencies": {
"pseudomap": "^1.0.2",
"yallist": "^2.1.2"
}
},
"node_modules/execa/node_modules/shebang-command": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
"integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==",
"license": "MIT",
"dependencies": {
"shebang-regex": "^1.0.0"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/execa/node_modules/shebang-regex": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
"integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==",
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/execa/node_modules/signal-exit": {
"version": "3.0.7",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
"integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",
"license": "ISC"
},
"node_modules/execa/node_modules/which": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
"license": "ISC",
"dependencies": {
"isexe": "^2.0.0"
},
"bin": {
"which": "bin/which"
}
},
"node_modules/express": {
"version": "4.19.2",
"resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz",
@ -642,26 +563,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/get-stream": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
"integrity": "sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ==",
"license": "MIT",
"engines": {
"node": ">=4"
}
},
"node_modules/git-commit-count": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/git-commit-count/-/git-commit-count-1.1.3.tgz",
"integrity": "sha512-w8BUANhsOvvEYUFmTBLL5vsSIwJ4/gnWouumdH1hljr9dTYoNGF80cyb5Dag22PF+v0yQSCBuQ24iMYs/gzrZQ==",
"license": "MIT",
"dependencies": {
"execa": "^0.6.1",
"is-git-repository": "^1.0.1",
"path-is-absolute": "^1.0.1"
}
},
"node_modules/glob": {
"version": "10.4.2",
"resolved": "https://registry.npmjs.org/glob/-/glob-10.4.2.tgz",
@ -809,25 +710,6 @@
"node": ">=8"
}
},
"node_modules/is-git-repository": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/is-git-repository/-/is-git-repository-1.1.1.tgz",
"integrity": "sha512-hxLpJytJnIZ5Og5QsxSkzmb8Qx8rGau9bio1JN/QtXcGEFuSsQYau0IiqlsCwftsfVYjF1mOq6uLdmwNSspgpA==",
"license": "MIT",
"dependencies": {
"execa": "^0.6.1",
"path-is-absolute": "^1.0.1"
}
},
"node_modules/is-stream": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
"integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==",
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/isexe": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
@ -981,27 +863,6 @@
"node": ">= 0.6"
}
},
"node_modules/npm-run-path": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
"integrity": "sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==",
"license": "MIT",
"dependencies": {
"path-key": "^2.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/npm-run-path/node_modules/path-key": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
"integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==",
"license": "MIT",
"engines": {
"node": ">=4"
}
},
"node_modules/object-inspect": {
"version": "1.13.1",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz",
@ -1021,15 +882,6 @@
"node": ">= 0.8"
}
},
"node_modules/p-finally": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
"integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==",
"license": "MIT",
"engines": {
"node": ">=4"
}
},
"node_modules/package-json-from-dist": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz",
@ -1044,15 +896,6 @@
"node": ">= 0.8"
}
},
"node_modules/path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/path-key": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
@ -1095,12 +938,6 @@
"node": ">= 0.10"
}
},
"node_modules/pseudomap": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz",
"integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==",
"license": "ISC"
},
"node_modules/qs": {
"version": "6.11.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
@ -1402,15 +1239,6 @@
"node": ">=8"
}
},
"node_modules/strip-eof": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
"integrity": "sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==",
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/toidentifier": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
@ -1631,12 +1459,6 @@
}
}
},
"node_modules/yallist": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
"integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==",
"license": "ISC"
},
"node_modules/youtubei.js": {
"version": "9.0.2",
"resolved": "https://registry.npmjs.org/youtubei.js/-/youtubei.js-9.0.2.tgz",
@ -1942,67 +1764,6 @@
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
"integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg=="
},
"execa": {
"version": "0.6.3",
"resolved": "https://registry.npmjs.org/execa/-/execa-0.6.3.tgz",
"integrity": "sha512-/teX3MDLFBdYUhRk8WCBYboIMUmqeizu0m9Z3YF3JWrbEh/SlZg00vLJSaAGWw3wrZ9tE0buNw79eaAPYhUuvg==",
"requires": {
"cross-spawn": "^5.0.1",
"get-stream": "^3.0.0",
"is-stream": "^1.1.0",
"npm-run-path": "^2.0.0",
"p-finally": "^1.0.0",
"signal-exit": "^3.0.0",
"strip-eof": "^1.0.0"
},
"dependencies": {
"cross-spawn": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
"integrity": "sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==",
"requires": {
"lru-cache": "^4.0.1",
"shebang-command": "^1.2.0",
"which": "^1.2.9"
}
},
"lru-cache": {
"version": "4.1.5",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz",
"integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==",
"requires": {
"pseudomap": "^1.0.2",
"yallist": "^2.1.2"
}
},
"shebang-command": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
"integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==",
"requires": {
"shebang-regex": "^1.0.0"
}
},
"shebang-regex": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
"integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ=="
},
"signal-exit": {
"version": "3.0.7",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
"integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="
},
"which": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
"requires": {
"isexe": "^2.0.0"
}
}
}
},
"express": {
"version": "4.19.2",
"resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz",
@ -2096,21 +1857,6 @@
"hasown": "^2.0.0"
}
},
"get-stream": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
"integrity": "sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ=="
},
"git-commit-count": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/git-commit-count/-/git-commit-count-1.1.3.tgz",
"integrity": "sha512-w8BUANhsOvvEYUFmTBLL5vsSIwJ4/gnWouumdH1hljr9dTYoNGF80cyb5Dag22PF+v0yQSCBuQ24iMYs/gzrZQ==",
"requires": {
"execa": "^0.6.1",
"is-git-repository": "^1.0.1",
"path-is-absolute": "^1.0.1"
}
},
"glob": {
"version": "10.4.2",
"resolved": "https://registry.npmjs.org/glob/-/glob-10.4.2.tgz",
@ -2206,20 +1952,6 @@
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="
},
"is-git-repository": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/is-git-repository/-/is-git-repository-1.1.1.tgz",
"integrity": "sha512-hxLpJytJnIZ5Og5QsxSkzmb8Qx8rGau9bio1JN/QtXcGEFuSsQYau0IiqlsCwftsfVYjF1mOq6uLdmwNSspgpA==",
"requires": {
"execa": "^0.6.1",
"path-is-absolute": "^1.0.1"
}
},
"is-stream": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
"integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ=="
},
"isexe": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
@ -2317,21 +2049,6 @@
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
"integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg=="
},
"npm-run-path": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
"integrity": "sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==",
"requires": {
"path-key": "^2.0.0"
},
"dependencies": {
"path-key": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
"integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw=="
}
}
},
"object-inspect": {
"version": "1.13.1",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz",
@ -2345,11 +2062,6 @@
"ee-first": "1.1.1"
}
},
"p-finally": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
"integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow=="
},
"package-json-from-dist": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz",
@ -2360,11 +2072,6 @@
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
"integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="
},
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg=="
},
"path-key": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
@ -2393,11 +2100,6 @@
"ipaddr.js": "1.9.1"
}
},
"pseudomap": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz",
"integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ=="
},
"qs": {
"version": "6.11.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
@ -2598,11 +2300,6 @@
}
}
},
"strip-eof": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
"integrity": "sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q=="
},
"toidentifier": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
@ -2738,11 +2435,6 @@
"integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==",
"requires": {}
},
"yallist": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
"integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A=="
},
"youtubei.js": {
"version": "9.0.2",
"resolved": "https://registry.npmjs.org/youtubei.js/-/youtubei.js-9.0.2.tgz",

View file

@ -21,7 +21,6 @@
"@node-minify/core": "^8.0.6",
"@node-minify/uglify-js": "^8.0.6",
"express": "^4.18.2",
"git-commit-count": "^1.1.3",
"glob": "^10.4.2",
"himalaya": "^1.1.0",
"minify-html": "^0.0.2",

View file

@ -8,7 +8,7 @@ const path = require('path'),
himalaya = require("himalaya"),
glob = require("glob"),
api = require("./api.js"),
gitCommitCount = require("git-commit-count")
child_process = require("child_process")
var constants = JSON.parse(fs.readFileSync(path.join(__dirname, 'constants.json')))
@ -92,7 +92,7 @@ function pathReplacer(html) {
return html
}
function highlighter(json, full = true) {
function highlighter(json, full = true, linkParent = false) {
for (var i = 0; i < json.length; i++) {
var element = json[i]
if (element.type == "element") {
@ -113,7 +113,7 @@ function highlighter(json, full = true) {
}
if (valid) {
element.children = highlighter(element.children, full)
element.children = highlighter(element.children, full, linkParent || element.tagName == "a")
}
}
} else if (element.type == "text") {
@ -205,13 +205,15 @@ function highlighter(json, full = true) {
var stuff = (startContent + dict.words[x] + endContent).trim()
if (!stuff.includes("span")) {
var replacement = `<span ${style} ${classes} ${link}>${stuff}</span>`
var replacement = `<span ${style} ${classes}>${stuff}</span>`
if (link) {
if (link && !linkParent) {
replacement = `<a href="${link}">${replacement}</a>`
// console.log(replacement)
}
element.content = element.content.substring(0, spanStart) + replacement + element.content.substring(spanEnd)
} else {
element.content = element.content.replace(termKey, dict.words[x])
}
}
@ -284,10 +286,10 @@ function converter(html, dynamic = true) {
return ""
},
"SELECTED_VIDEO": () => {
if (config.dailyVideoURL) {
if (api.lanyard.video) {
return `<h2><hr/>Random video!</h2><p>I would call it random <em>daily</em> video but its not at all daily...</p>
<br/>
<video controls="true" src="${config.dailyVideoURL}"></video>`
<video controls="true" src="${api.lanyard.video.url}"></video>`
}
return ``
},
@ -307,7 +309,7 @@ function converter(html, dynamic = true) {
for (var x = 0; x < sitesTable.length; x++) {
var siteName = sitesTable[x]
var siteData = sites[siteName]
html += `<a class="chip" ${onlyIfExists(`href="${siteData.url}"`, siteData.url)}>${siteName}: <span class="noHighlight">${siteData.name.replaceAll("Violet", "{Violet}")}</span></a>`
html += `<a class="chip" ${onlyIfExists(`href="${siteData.url}"`, siteData.url)}>${siteName}: <span class="noHighlight">${siteData.name}</span></a>`
}
html += "</div></div>"
@ -445,8 +447,8 @@ module.exports = {
}
async function updateCommits() {
var commits = gitCommitCount()
// var commits = gitCommitCount()
var commits = child_process.execSync("git rev-list --count HEAD")
// var siteResponse = await (await fetch(`https://git.violets-purgatory.dev/bingus_violet/violets-purgatory/src/branch/${process.env.BRANCH || "origin"}`)).text()
// var commits = siteResponse.substring(0, siteResponse.indexOf("Commits"))
@ -456,7 +458,7 @@ async function updateCommits() {
// commits = commits.substring(commits.lastIndexOf(">") + 1)
// ^ This works for Github (fuck you Github)
commitCount = commits.toString()
commitCount = commits.toString().trim()
if (process.env.BRANCH == "dev") {
commitCount += " | Beta site"
}

View file

@ -80,6 +80,7 @@
<!-- <a class="chip">Matrix: matrix.violets-purgatory.dev</a> -->
<!-- <a href="https://element.violets-purgatory.dev" class="chip">Element: element.violets-purgatory.dev</a> -->
<a href="https://git.viois.gay" class="chip">Forgejo: <span class="noHighlight">git.viois.gay</span></a>
<a href="https://univerter.dev" class="chip">Univerter: <span class="noHighlight">univerter.dev</span></a>
<a class="chip">Thumbor: <span class="noHighlight">thumbor.violets-purgatory.dev</span></a>
<hr>
<h1>Socials</h1>

View file

@ -54,7 +54,7 @@ var firsttimeDebounce = true
var spinWaiting = false
function resetPFP() {
pfp.src = "https://api.violets-purgatory.dev/v1/pfp?" + new Date().getTime()
$(".pfp").attr("src", "https://api.violets-purgatory.dev/v1/pfp?" + new Date().getTime())
}
function lerp(a, b, t) {
@ -103,7 +103,6 @@ function spinLoop() {
}
spins += 1/spinSpeed / spinFactor
if (Math.floor(spins) != lastSent && sock && sock.OPEN) {
console.log("RAH")
$(".globalSpins").text(globalSpins + 1)
lastSent = Math.floor(spins)
// resetPFP()
@ -244,8 +243,8 @@ function socketeer() {
var statusInfo = discStatuses[lanyard.discord_status]
var lastStatus = $(".statusColor")
if (lastStatus.innerHTML != statusInfo.text) {
lastStatus.innerHTML = statusInfo.text
if (lastStatus.text() != statusInfo.text) {
lastStatus.text(statusInfo.text)
lastStatus.css("color", statusInfo.color)
pfp.css("borderColor", statusInfo.color)