mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-03-25 09:05:47 +00:00
Update plan and compile script
This commit is contained in:
parent
652d192560
commit
ed9ad222b2
2 changed files with 3 additions and 29 deletions
|
|
@ -103,7 +103,7 @@ Execution, trying TDD for the first time:
|
|||
|
||||
- [ ] Generate JSON feed
|
||||
|
||||
- [ ] Munge HTML files to make them available without an extension (index.html hack, do it in the SiteGenerator)
|
||||
- [x] Munge HTML files to make them available without an extension (index.html hack, do it in the SiteGenerator)
|
||||
|
||||
- [ ] Inline CSS?
|
||||
|
||||
|
|
|
|||
30
bin/compile
30
bin/compile
|
|
@ -10,23 +10,16 @@ TARGET_DIR="$2"
|
|||
function main() {
|
||||
rm -rf "$TARGET_DIR"
|
||||
|
||||
echo "* generate site from $SOURCE_DIR into $TARGET_DIR"
|
||||
"$THIS_DIR/sitegen" "$SOURCE_DIR" "$TARGET_DIR"
|
||||
|
||||
# echo "* compile rss feed"
|
||||
# compile_feeds
|
||||
|
||||
# echo "* harp compile $SOURCE_DIR $TARGET_DIR"
|
||||
# rm -rf "$TARGET_DIR/*" "$TARGET_DIR/.*"
|
||||
# "$HARP" compile "$SOURCE_DIR" "$TARGET_DIR"
|
||||
echo "* generate site from $SOURCE_DIR into $TARGET_DIR"
|
||||
"$THIS_DIR/sitegen" "$SOURCE_DIR" "$TARGET_DIR"
|
||||
|
||||
# clean up temporary feeds
|
||||
# rm $SOURCE_DIR/public/feed.xml
|
||||
# rm $SOURCE_DIR/public/feed.json
|
||||
|
||||
# echo "* munge html files to make them available without an extension"
|
||||
# munge_html
|
||||
|
||||
# echo "* inline CSS"
|
||||
# ruby -w $THIS_DIR/inline-css "$TARGET_DIR"
|
||||
|
||||
|
|
@ -38,25 +31,6 @@ function compile_feeds() {
|
|||
ruby -w $THIS_DIR/feeds $SOURCE_DIR/public
|
||||
}
|
||||
|
||||
function munge_html() {
|
||||
for FILE in "$TARGET_DIR"/*.html "$TARGET_DIR"/posts/*/*/*.html "$TARGET_DIR"/posts/drafts/*.html "$TARGET_DIR"/projects/*.html; do
|
||||
FILENAME="${FILE##*/}"
|
||||
case "$FILENAME" in
|
||||
index.html)
|
||||
continue
|
||||
;;
|
||||
missing.html)
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
|
||||
# make posts available without an .html extension
|
||||
FILE_DIR="${FILE%.html}"
|
||||
mkdir -p "$FILE_DIR"
|
||||
mv "$FILE" "$FILE_DIR/index.html"
|
||||
done
|
||||
}
|
||||
|
||||
# function minify_js() {
|
||||
# for FILE in "$TARGET_DIR"/js/*.js; do
|
||||
# $THIS_DIR/minify-js.sh "$FILE" > /tmp/minified.js && mv /tmp/minified.js "$FILE" || echo "* failed to minify $FILE"
|
||||
|
|
|
|||
Loading…
Reference in a new issue