cleanup
This commit is contained in:
parent
ccb771f1bb
commit
9bf53b5fb7
9 changed files with 11 additions and 1266 deletions
11
README.md
11
README.md
|
@ -40,3 +40,14 @@ all tasks
|
|||
```
|
||||
bb tasks
|
||||
```
|
||||
|
||||
#### Details
|
||||
|
||||
```
|
||||
bb.edn ⇒ babashka commands and tasks
|
||||
bb/
|
||||
brut/
|
||||
build_css.clj ⇒ clojure code that build the CSS
|
||||
site.clj ⇒ clojure code that build the BRUT website
|
||||
h/img/ ⇒ images for the site
|
||||
```
|
||||
|
|
1
brut-full.min.css
vendored
1
brut-full.min.css
vendored
File diff suppressed because one or more lines are too long
1
brut.min.css
vendored
1
brut.min.css
vendored
File diff suppressed because one or more lines are too long
44
build.clj
44
build.clj
|
@ -1,44 +0,0 @@
|
|||
#!/usr/bin/env bb
|
||||
(require '[babashka.fs :as fs]
|
||||
'[babashka.process :refer [process]])
|
||||
|
||||
(def dist "_build")
|
||||
(def tmp-dir (-> (fs/create-temp-dir)
|
||||
(fs/delete-on-exit)))
|
||||
|
||||
(def tmp-css (fs/file tmp-dir "tmp.css"))
|
||||
(def brut-css "brut.min.css")
|
||||
|
||||
(fs/create-dirs dist)
|
||||
|
||||
(def sub-css
|
||||
["colors"
|
||||
"general"
|
||||
"buttons"
|
||||
"grid"
|
||||
"components"
|
||||
"headings"
|
||||
"icons"
|
||||
"forms"
|
||||
"navbar"
|
||||
"tables"
|
||||
"messages"])
|
||||
|
||||
(defn current-year []
|
||||
(-> (new java.util.Date)
|
||||
.getYear
|
||||
;; yeah... it's dumb
|
||||
(+ 1900)))
|
||||
|
||||
(spit tmp-css (format "/* Copyright %s Yann Esposito; MIT licensed */" (current-year)))
|
||||
(doseq [item sub-css]
|
||||
(printf "building: %s\n" item)
|
||||
(let [css (fs/file tmp-dir (str item ".css"))
|
||||
min-css (fs/file dist (str item ".min.css"))
|
||||
_ @(process ["lessc" (format "src/%s.less" item)] {:out css})
|
||||
minified (-> @(process ["minify" css] {:out :string}) :out)]
|
||||
(spit min-css minified)))
|
||||
|
||||
(fs/move tmp-css brut-css {:replace-existing true
|
||||
:atomic-move true})
|
||||
(println "build: " brut-css)
|
28
build.sh
28
build.sh
|
@ -1,28 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
DIST="_build"
|
||||
TMPCSS="$DIST/tmp.css"
|
||||
DISTCSS="brut.min.css"
|
||||
|
||||
mkdir $DIST -p
|
||||
[ -f $TMPCSS ] && rm -f $TMPCSS
|
||||
|
||||
|
||||
subtypes=(general buttons grid components headings icons forms navbar tables messages colors )
|
||||
YEAR="$(date +"%Y")"
|
||||
echo -n "/* Copyright $YEAR Yann Esposito; MIT licensed */" >> $TMPCSS
|
||||
|
||||
for item in "${subtypes[@]}"; do
|
||||
echo "building: $item"
|
||||
lessc "src/$item.less" > "$DIST/$item.css"
|
||||
minify "$DIST/$item.css" -o "$DIST/$item.min.css"
|
||||
cat "$DIST/$item.min.css" >> $TMPCSS
|
||||
done
|
||||
|
||||
[ -f $DISTCSS.bak ] && rm -f $DISTCSS.bak
|
||||
[ -f $DISTCSS ] && mv $DISTCSS $DISTCSS.bak
|
||||
mv $TMPCSS $DISTCSS
|
||||
# cleanup
|
||||
rm -f $DISTCSS.bak
|
||||
rm -f $TMPCSS
|
||||
echo "Built: $DISTCSS"
|
1158
h/docs.html
1158
h/docs.html
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
|||
<head><meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /><meta content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no" name="viewport" /><title>BRUT - download</title><link href="../brut.min.css" rel="stylesheet" type="text/css" /></head><body class="col gapless"><div><nav class="nav" onclick="this.focus()" tabindex="-1"><div class="container"><a class="pagename" href="../index.html">BRUT</a><a href="../h/docs.html">Docs</a><a href="../h/download.html">Download</a><a href="https://gitea.esy.fun/yogsototh/brutcss">Code</a></div></nav><button class="btn sn btn-close">×</button></div><div class="central fill" style="background:url('../h/img/brutalism.webp')"><a class="btn warn huge" href="../brut.min.css">Download BRUT</a></div></body>
|
|
@ -1 +0,0 @@
|
|||
<head><meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /><meta content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no" name="viewport" /><title>BRUT</title><link href="brut.min.css" rel="stylesheet" type="text/css" /></head><body class="col gapless"><div><nav class="nav" onclick="this.focus()" tabindex="-1"><div class="container"><a class="pagename" href="index.html">BRUT</a><a href="h/docs.html">Docs</a><a href="h/download.html">Download</a><a href="https://gitea.esy.fun/yogsototh/brutcss">Code</a></div></nav><button class="btn sn btn-close">×</button></div><div><div class="hero" style="background: url(h/img/brutalism.webp)"><div class="container col middle"><div class="row middle"><div class="c2"></div><div class="c8 col block bg-neutral"><h1 class="tight huge">BRUT</h1><h4>A Brutalist and Minimalist CSS Framework</h4><p>This CSS framework is ideal to be used for <strong>private admin interfaces</strong>.</p><p> Just by the look of it, it will scream: <span class="hl">THIS IS NOT FOR NON-TECHNICAL PEOPLE!!!</span></p></div><div class="c2"></div></div></div></div><div class="container"><div class="row"><div class="card"><h3>Docs</h3><p>A few quick examples to show every components. This should be quick and straightforward.</p><p>This CSS framework makes its best to respect some expected composability accross classes. Here are a few examples:</p><div class="row"><div><p class="tight">A block: </p><div class="card"><div class="tb">textual btn</div><br /><div class="btn">classic btn</div><br /><div class="msg">Some message block</div></div></div><div><p class="tight">Then add the class <code>big</code>: </p><div class="card big"><div class="tb">textual btn</div><br /><div class="btn">classic btn</div><br /><div class="msg">Some message block</div></div></div></div><a class="btn big push" href="h/docs.html">Docs</a></div><div class="col card"><h3>Download</h3><p>Download BRUT</p><a class="btn warn big push" href="h/download.html">Download</a></div></div></div></div><footer><div class="container"><p>By <a href="https://yannesposito.com">Yann Esposito</a></p></div></footer></body>
|
32
optim-img.sh
32
optim-img.sh
|
@ -1,32 +0,0 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
src="$1"
|
||||
dst="$2"
|
||||
|
||||
sizeof() {
|
||||
stat --format="%s" "$*"
|
||||
}
|
||||
|
||||
|
||||
convert "$src" -resize 800x800\> "$dst"
|
||||
|
||||
before=$(sizeof $src)
|
||||
|
||||
if [[ "${src:e}" == "gif" ]]; then
|
||||
after=$(sizeof $dst)
|
||||
dest=$dst
|
||||
else
|
||||
cwebp "$dst" -quiet -o "$dst.webp"
|
||||
after=$(sizeof $dst.webp)
|
||||
dest=$dst.webp
|
||||
fi
|
||||
|
||||
|
||||
if (( before <= after )); then
|
||||
cp -f "$src" "$dst"
|
||||
print -- "[0%] cp $before => $before"
|
||||
else
|
||||
gain=$(( ( (before - after) * 100 ) / before ))
|
||||
print -- "[$gain%] convert $before => $after"
|
||||
fi
|
||||
|
Loading…
Reference in a new issue