Skip to content

Commit

Permalink
build: fix aio ccl style
Browse files Browse the repository at this point in the history
  • Loading branch information
WakelessSloth56 committed Mar 12, 2024
1 parent ec20566 commit e56d512
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ terser --config-file temp/terser.json public/player.js >temp/player.js
html-minifier-terser --collapse-whitespace public/player.css >temp/player.css
# Download CCL style
curl -L https://github.com/jabbany/CommentCoreLibrary/raw/19db2962ed0ce637a2b99facdf8634d51bb1b503/dist/css/style.min.css >temp/ccl.css
# Build all.css
cat public/player.css >temp/all.css
cat temp/ccl.css >>temp/all.css
# Minify all.css
html-minifier-terser --collapse-whitespace temp/player.css >temp/all.css

# Minify index.html
html-minifier-terser --minify-js --collapse-whitespace public/index.html >temp/index.html

# Build AIO html
cp temp/index.html temp/aio.html
sed -i 's;<link[^>]*>;;g' temp/aio.html
sed -i 's^\\^\\\\^g' temp/all.css
sed -i "s^<\!--allcss-->^<style>$(cat temp/all.css)</style>^g" temp/aio.html
## Build all.min.css and fill into html
cat public/player.css >temp/all.css
cat temp/ccl.css >>temp/all.css
html-minifier-terser --collapse-whitespace temp/all.css >temp/all.min.css
sed -i 's^\\^\\\\^g' temp/all.min.css
sed -i "s^<\!--allcss-->^<style>$(cat temp/all.min.css)</style>^g" temp/aio.html
## Patch and fill script into html
sed -i 's;<script src="player.js"></script>;;g' temp/aio.html
sed 's^\\^\\\\^g' temp/player.js >temp/player.pathced.js
sed -i 's^\&^\\&^g' temp/player.pathced.js
Expand Down

0 comments on commit e56d512

Please sign in to comment.