summaryrefslogtreecommitdiffstats
path: root/init
blob: 6e2ebc19b079fa66efda5dbaff6810a2e333aa8a (plain)
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/env zsh
#
# WebNomad, your slick and static website publisher
#
# Copyright (C) 2012-2013 Denis Roio <jaromil@dyne.org>
#
# This source  code is free  software; you can redistribute  it and/or
# modify it under the terms of  the GNU Public License as published by
# the Free  Software Foundation; either  version 3 of the  License, or
# (at your option) any later version.
#
# This source code is distributed in  the hope that it will be useful,
# but  WITHOUT ANY  WARRANTY;  without even  the  implied warranty  of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# Please refer to the GNU Public License for more details.
#
# You should have received a copy of the GNU Public License along with
# this source code; if not, write to:
# Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
SYS=`dirname $0`
source $SYS/utils




act "Initializing $B $DIR $r"
pushd $DIR

act "Below is the log of files copied into this directory."
act "Init does not rewrite any existing file"
act

mkdir -p views/js
mkdir -p views/css
{ test -r views/index.html } || {
    cat <<EOF > views/index.html
<h1>Hello world</h1>

<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.</p>

EOF
}

mkdir -p tmpl
{ test -r tmpl/header.html } || {
    cp -v ${SYS}/tmpl/header.html tmpl }

{ test -r tmpl/footer.html } || {
    cp -v ${SYS}/tmpl/footer.html tmpl }

{ test -r tmpl/navbar.html } || {
    cp -v ${SYS}/tmpl/navbar.html tmpl }

{ test -r views/js/html5.js } || {
    cp -v ${SYS}/js/html5.js views/js }

{ test -r views/css/bootstrap.css } || {
    cp -v ${SYS}/js/bootstrap* views/js
    cp -v ${SYS}/css/bootstrap* views/css }

{ test -r views/css/blueimp-gallery.css } || {
    cp -v ${SYS}/js/*blueimp* views/js
    cp -v ${SYS}/css/*blueimp* views/css }

{ test -r config.zsh } || {
    cat <<EOF > config.zsh
TITLE="A new website made with WebNomad."
BRAND="WebNomad"
DESCRIPTION="WebNomad, your slick and static website publisher, powered by HTML5, Zsh and Bootstrap"
KEYWORDS="web, design, html"
EXTENSION=".html"
EOF
}


popd

act
notice "Initialization completed"
act "Look in your new WebNomad project: $B $DIR $r"
act "Customize $B config.zsh $r and then files in the $B tmpl/ $r folder"
act "Create new HTML pages in $B views/ $r"

{ test "$DIR" = "." } || { sleep 10 }