mirror of
https://gitlab.com/octtspacc/sitoctt
synced 2024-12-27 08:32:40 +01:00
35 lines
629 B
Bash
Executable File
35 lines
629 B
Bash
Executable File
#!/bin/sh
|
|
|
|
HeadInject="
|
|
<style>
|
|
body {
|
|
color: #000000;
|
|
background-color: #FFFFFF;
|
|
}
|
|
@media (prefers-color-scheme: dark) {
|
|
body {
|
|
color: #FFFFFF;
|
|
background-color: #000000;
|
|
}
|
|
}
|
|
img {
|
|
max-width: 100%;
|
|
max-height: 100vh;
|
|
}
|
|
</style>
|
|
"
|
|
|
|
cp -r ./public ./public.plain
|
|
mv ./public.plain ./public/Plain
|
|
cd ./public/Plain
|
|
|
|
find . -name "*.html" \
|
|
-exec sed -i "s|<style>|<!--style>|g" {} \; \
|
|
-exec sed -i "s|</style>|</style--->|g" {} \;
|
|
|
|
find . -name "*.html" \
|
|
-exec sed -i "s|<head>|<head>\n$(echo $HeadInject)|" {} \;
|
|
|
|
find . -name "*.css" \
|
|
-exec sh -c 'if [ "$(basename {})" != "Global.css" ]; then echo > {}; fi' \;
|