monochromatic

monochromatic blog: http://blog.z3bra.org
git clone git://z3bra.org/monochromatic
Log | Files | Refs

commit fe49eb5a2192ee643bbe4aaf6ab6bf874b8ee3ac
parent b189c7fb3c446b1504ff4ba53b0f010dddb88f1a
Author: Willy Goiffon <w.goiffon@gmail.com>
Date:   Sat, 10 Aug 2013 13:08:12 +0200

moved helpers to a subdirectory

Diffstat:
body.template | 15---------------
check.sh | 25-------------------------
foot.template | 9---------
head.template | 12------------
post.sh | 5-----
tools/body.template | 15+++++++++++++++
tools/check.sh | 25+++++++++++++++++++++++++
tools/foot.template | 9+++++++++
tools/head.template | 12++++++++++++
tools/post.sh | 11+++++++++++
tools/update.sh | 11+++++++++++
update.sh | 11-----------
12 files changed, 83 insertions(+), 77 deletions(-)

diff --git a/body.template b/body.template @@ -1,15 +0,0 @@ - <div id='wrapper'> - <section> - <h1> - <a href='#'></a> - </h1> - <h2> - &mdash; - </h2> - <article> - <p> - - </p> - </article> - </section> - </div> diff --git a/check.sh b/check.sh @@ -1,25 +0,0 @@ -#!/bin/bash - -http=http://validator.w3.org/check -uri=blog.z3bra.org -charset=utf-8 -doctype=Inline -profile=css3 - - -check="${http}?uri=${uri}&charset=${charset}&$doctype=${doctype}" - -if [[ -n "$(curl -s "$check" | grep -o 'Passed')" ]]; then - echo -e "\033[1;32mHTML validated!\033[0m" -else - echo -e "\033[1;31mHTML not valid!\033[0m\ncheck $check" -fi - -http=http://jigsaw.w3.org/css-validator/validator -check="${http}?uri=${uri}&profile=${profile}" - -if [[ -n "$(curl -s "$check" | grep -o 'No Error')" ]]; then - echo -e "\033[1;32mCSS validated!\033[0m" -else - echo -e "\033[1;31mCSS not valid!\033[0m\ncheck $check" -fi diff --git a/foot.template b/foot.template @@ -1,9 +0,0 @@ - <!-- footer {{{ --> - <footer> - &copy; 2013 WTFPL &mdash; <a href='http://www.wtfpl.net/about/'>Do What the Fuck You Want to Public License</a> - &mdash; contact : &lt;<a href='mailto:willy@mailoo.org'>willy at mailoo dot org</a>&gt; - </footer> - <!-- }}} --> - </body> -</html> -<!-- vim: set sw=2 et ai fdm=marker: --> diff --git a/head.template b/head.template @@ -1,12 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <meta charset='utf-8'/> - <link rel='stylesheet' href='/css/monochrome.css'/> - <link rel='stylesheet' href='/css/phone.css' media='screen and (max-width: 540px)'/> - <title>monochromatic</title> - </head> - <body> - <header> - <h1><a href='/'>Monochromatic</a></h1> <h2>&mdash; <a href='/about.html'>z3bra</a>, the stripes appart</h2> - </header> diff --git a/post.sh b/post.sh @@ -1,5 +0,0 @@ -#!/bin/bash - -[[ -z "$1" ]] && exit 1 - -cat head.template body.template foot.template >> $(date +%Y)/$(date +%m)/${1// /-}.html diff --git a/tools/body.template b/tools/body.template @@ -0,0 +1,15 @@ + <div id='wrapper'> + <section> + <h1> + <a href='#'></a> + </h1> + <h2> + &mdash; + </h2> + <article> + <p> + + </p> + </article> + </section> + </div> diff --git a/tools/check.sh b/tools/check.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +http=http://validator.w3.org/check +uri=blog.z3bra.org +charset=utf-8 +doctype=Inline +profile=css3 + + +check="${http}?uri=${uri}&charset=${charset}&$doctype=${doctype}" + +if [[ -n "$(curl -s "$check" | grep -o 'Passed')" ]]; then + echo -e "\033[1;32mHTML validated!\033[0m" +else + echo -e "\033[1;31mHTML not valid!\033[0m\ncheck $check" +fi + +http=http://jigsaw.w3.org/css-validator/validator +check="${http}?uri=${uri}&profile=${profile}" + +if [[ -n "$(curl -s "$check" | grep -o 'No Error')" ]]; then + echo -e "\033[1;32mCSS validated!\033[0m" +else + echo -e "\033[1;31mCSS not valid!\033[0m\ncheck $check" +fi diff --git a/tools/foot.template b/tools/foot.template @@ -0,0 +1,9 @@ + <!-- footer {{{ --> + <footer> + &copy; 2013 WTFPL &mdash; <a href='http://www.wtfpl.net/about/'>Do What the Fuck You Want to Public License</a> + &mdash; contact : &lt;<a href='mailto:willy@mailoo.org'>willy at mailoo dot org</a>&gt; + </footer> + <!-- }}} --> + </body> +</html> +<!-- vim: set sw=2 et ai fdm=marker: --> diff --git a/tools/head.template b/tools/head.template @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset='utf-8'/> + <link rel='stylesheet' href='/css/monochrome.css'/> + <link rel='stylesheet' href='/css/phone.css' media='screen and (max-width: 540px)'/> + <title>monochromatic</title> + </head> + <body> + <header> + <h1><a href='/'>Monochromatic</a></h1> <h2>&mdash; <a href='/about.html'>z3bra</a>, the stripes appart</h2> + </header> diff --git a/tools/post.sh b/tools/post.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +[[ -z "$1" ]] && exit 1 + +POST="$(date +%Y)/$(date +%m)/${1// /-}.html" + +cat tools/{head,body,foot}.template >> $POST + +echo "$POST created" + + diff --git a/tools/update.sh b/tools/update.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +for file in $(find . -name '*.html'); do + if [[ -n "$(cat $file|tr -d '\n' |grep -E '</header>.*<footer>')" ]]; then + cat tools/head.template > buffer.html + sed '1,/<\/header>/d;/<!-- footer/,$d' $file >> buffer.html + cat tools/foot.template >> buffer.html + + mv buffer.html $file + fi +done diff --git a/update.sh b/update.sh @@ -1,11 +0,0 @@ -#!/bin/bash - -for file in $(find . -name '*.html'); do - if [[ -n "$(cat $file|tr -d '\n' |grep -E '</header>.*<footer>')" ]]; then - cat head.template > buffer.html - sed '1,/<\/header>/d;/<!-- footer/,$d' $file >> buffer.html - cat foot.template >> buffer.html - - mv buffer.html $file - fi -done