-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcss.sh
More file actions
executable file
·72 lines (60 loc) · 1.82 KB
/
Copy pathcss.sh
File metadata and controls
executable file
·72 lines (60 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
set -e
# This script downloads the appropriate Dart Sass binary, fetches SCSS assets,
# and compiles them into CSS.
# 1. Setup temporary directory
echo "Creating temporary build directory..."
rm -rf _build_styles && mkdir _build_styles
cd _build_styles
# 2. Detect OS and architecture to download the correct Dart Sass binary
SASS_VERSION="1.54.3"
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)
SASS_ARCH=""
if [ "$OS" = "darwin" ]; then
OS="macos"
if [ "$ARCH" = "x86_64" ]; then
SASS_ARCH="x64"
elif [ "$ARCH" = "arm64" ]; then
SASS_ARCH="arm64"
fi
elif [ "$OS" = "linux" ] && [ "$ARCH" = "x86_64" ]; then
SASS_ARCH="x64"
fi
if [ -z "$SASS_ARCH" ]; then
echo "Error: Unsupported OS '$OS' or architecture '$ARCH'."
exit 1
fi
SASS_FILENAME="dart-sass-${SASS_VERSION}-${OS}-${SASS_ARCH}.tar.gz"
SASS_URL="https://github.com/sass/dart-sass/releases/download/${SASS_VERSION}/${SASS_FILENAME}"
echo "Downloading Dart Sass from $SASS_URL"
wget "$SASS_URL"
tar -xf "$SASS_FILENAME"
chmod +x dart-sass/sass
# 3. Download SCSS source files from the correct raw URLs
echo "Downloading SCSS source files..."
STYLES_SRC_ROOT="https://raw.githubusercontent.com/Neoteroi/mkdocs-plugins/v1.2.0/styles"
SCSS_FILES=(
"all.scss"
"timeline.scss"
"colors.scss"
"cards.scss"
"gantt.scss"
"spantable.scss"
"groups.scss"
"contribs.scss"
"oad.scss"
)
for f in "${SCSS_FILES[@]}"; do
wget "${STYLES_SRC_ROOT}/${f}"
done
# 4. Compile SCSS to CSS in the target directory
DEST_DIR="../docs/stylesheets"
echo "Compiling CSS to $DEST_DIR..."
./dart-sass/sass --no-source-map all.scss "${DEST_DIR}/neoteroi-mkdocs.css"
./dart-sass/sass --no-source-map timeline.scss "${DEST_DIR}/neoteroi-timeline.css"
# 5. Cleanup
echo "Cleaning up temporary directory..."
cd ..
rm -rf _build_styles
echo "CSS build complete."