Makefile (1121B)
1 # SPDX-License-Identifier: AGPL-3.0-or-later
2 # SPDX-FileCopyrightText: 2024 JayVii <jayvii[AT]posteo[DOT]de>
3
4 # Deployment for git post-update hook
5 git-hook-deploy:
6 rsync -rlptD --chown=${USER}:www-data --chmod=750 ./ ~/ \
7 --exclude=".git/*" \
8 --exclude=".resue/*" \
9 --exclude="examples/*" \
10 --exclude="LICENSE/*" \
11 --exclude="Makefile" \
12 --exclude="README"
13
14 # Minify CSS
15 minify-css:
16 cat assets/style.css | \
17 sed -r ':a; s%(.*)/\*.*\*/%\1%; ta; /\/\*/ !b; N; ba' | \
18 tr -d '\t' | \
19 tr -d '\n' | \
20 tr -s ' ' ' ' | \
21 sed -E \
22 -e 's/\s*;\s*/;/g' \
23 -e 's/\s*:\s*/:/g' \
24 -e 's/\s*\{\s*/{/g' \
25 -e 's/\s*\}\s*/}/g' \
26 -e 's/\s*,\s*/,/g' \
27 -e 's/\s*>\s*/>/g' \
28 -e 's/\s*<\s*/</g' | \
29 tee assets/style.min.css > /dev/null
30 cat assets/index.css | \
31 sed -r ':a; s%(.*)/\*.*\*/%\1%; ta; /\/\*/ !b; N; ba' | \
32 tr -d '\t' | \
33 tr -d '\n' | \
34 tr -s ' ' ' ' | \
35 sed -E \
36 -e 's/\s*;\s*/;/g' \
37 -e 's/\s*:\s*/:/g' \
38 -e 's/\s*\{\s*/{/g' \
39 -e 's/\s*\}\s*/}/g' \
40 -e 's/\s*,\s*/,/g' \
41 -e 's/\s*>\s*/>/g' \
42 -e 's/\s*<\s*/</g' | \
43 tee assets/index.min.css > /dev/null