/[clonezilla-sysresccd]/trunk/www/working/scripts/2site
ViewVC logotype

Contents of /trunk/www/working/scripts/2site

Parent Directory Parent Directory | Revision Log Revision Log


Revision 37 - (show annotations)
Tue Mar 23 10:28:53 2010 UTC (11 years, 8 months ago) by sng
Original Path: trunk/www/2site
File size: 9391 byte(s)
Changed onepage.php to onepage.html
  2site: adding creation of onepage.html
  .template.html: changed onepage.php to onepage.html
  usb.html: fixing H2 tags
  partitions.html: fixing H2 tags
Site update

H2 tags should always be used without any style modifiers.
Exception: the first H2 tag of the page should have a
[style="margin-top: 0;"] modifier

1 #!/bin/bash
2 echo 'Creating files'
3 echo -n " template.html... "
4 myDate=`sed -n '1p' working/release-data `
5 myVersion=`sed -n '2p' working/release-data `
6 thisDate=`date '+%d/%m/%Y'`
7
8
9 whereIsTheISO=/e/clonezilla-sysresccd-full-mod-"$myVersion"/clonezilla-sysresccd-full-mod-"$myVersion".iso
10 whereIsTheISO=/e/clonezilla-sysresccd-full-mod-"$myVersion".iso
11
12 whereIsTheTarBall=/home/spiros/multibootcd/create-clonezilla-sysresccd-"$myVersion".tar.gz
13
14 # . "$HOME/.2site.conf"
15 [ -e "$whereIsTheISO" ] && isoSize=$(du -h "$whereIsTheISO" | sed "s|/.*||" |sed 's|\([kMG]\).*| \1|') || {
16 echo " Error: The variable \"whereIsTheISO\" is invalid
17 Please edit your ~/.2site.conf file"
18 # exit 1
19 }
20
21 md5sum="$(echo "$whereIsTheISO" | sed 's|/[^/]*$|/md5sum.txt|')"
22 md5sum="$(cat "$md5sum")"
23
24 tarballSize=$(du -h "$whereIsTheTarBall" | sed "s|/.*||" |sed 's|\([kMG]\).*| \1|')
25 isoSizeEN=$(echo "$isoSize" | sed 's|,|.|')
26 # isoSizeGR=$(echo "$isoSize" | sed 's|\.|,|')
27 tarballSizeEN=$(echo "$tarballSize" | sed 's|,|.|')
28 # tarballSizeGR=$(echo "$tarballSize" | sed 's|\.|,|')
29
30
31
32
33 tr -d '\n' < working/clonezilla-sysresccd.rss | sed 's|<[tT][iI][tT][lL][eE]>|\n<title>|g' | sed 's|</[pP][uU][bB][Dd][aA][tT][eE]>|</pubDate>\n|g' | grep '<title>' > ~/tmp/iaa.$$
34
35 rm ~/tmp/aai.$$ 2>/dev/null
36 while read line;do
37 dt="$(echo "$line" | sed 's|.*<guid isPermaLink="false">.*, ||' |sed 's| [0-9][0-9]:.*||' | sed 's|.*<pubDate>..., ||'| sed 's|\([^ ]*\) \([^ ]*\) \(.*\)|\3 \2 \1|' | sed 's|Jan|01|
38 s|Feb|02|
39 s|Mar|03|
40 s|Apr|04|
41 s|May|05|
42 s|Jun|06|
43 s|Jul|07|
44 s|Aug|08|
45 s|Sep|09|
46 s|Oct|10|
47 s|Nov|11|
48 s|Dec|12|
49 ')"
50 tit="$(echo "$line" | sed 's|</[Tt][iI][tT][lL][eE]>.*||' | sed 's|<title>||')"
51 echo "$dt - $tit" | grep '^[0-9]' >> ~/tmp/aai.$$
52 done < ~/tmp/iaa.$$
53 rm ~/tmp/iaa.$$
54
55 l="$(cat ~/tmp/aai.$$ | sort -r | sed 's|^\([0-9][0-9][0-9][0-9]\) \([0-9][0-9]\) \([0-9][0-9]\) - \(.*\)|<p><a href="news.php#\4">\3/\2/\1 - \4</a></p>|' | sed -n '1,$p' | sed 's|$| \\|')"
56
57
58
59 rm ~/tmp/aai.$$
60
61 sed "/<H1[^>]*>What's New<.H1>/a \
62 $l
63 " .template.html | sed "s|\"myDate\"|$myDate|" | sed "s|\"myVersion\"|$myVersion|g" | sed "s|Last update: [^<]*<|Last update: $thisDate<|" > template.html
64
65
66 echo 'done'
67
68 #
69 # Create news.php
70 #
71
72 echo -n ' news.php... '
73 sed -n '1,/<div id="content">/p' template.html > 1.$$
74 cat .news.php >> 1.$$
75 sed '1,/<div id="content">/d' template.html | sed '/<div id="menu">/,/<.div>/d' >> 1.$$
76
77 sed '/#content/s/width: 750px;/width: 950px/' 1.$$ | sed "s|background-image: url('images/line.png'); background-repeat:repeat-y;||
78 s|class=\"here\" ||
79 s|<a href=\"news.php\">|<a class=\"here\" href=\"news.php\">|
80 s|\"myTitle\"|What's New|
81 /<div id=\"header\">/a \
82 <a name=\"news-top\"></a>" > news.php
83 echo 'done'
84
85
86 #
87 # Create 404.html
88 #
89 echo -n ' 404.html... '
90 sed -n '1,/<div id="content">/p' template.html > 1.$$
91 sed '1,/<div id="content">/d' template.html | sed '/<div id="menu">/,/<.div>/d' >> 1.$$
92 sed '/#content/s/width: 750px;/width: 950px/' 1.$$ | sed "s|background-image: url('images/line.png'); background-repeat:repeat-y;||
93 s|class=\"here\" ||
94 s|\"myTitle\"|Error|
95 s|#content { float: left;|#content { |
96 " > xxx.html
97 rm 1.$$
98
99 sed -n '1,/<.[hH][eE][aA][dD]>/p' xxx.html | sed '$d' > p1.$$
100 sed -n '1,/<!--seperator-->/p' .404.html >> p1.$$
101 sed -n '/<.[hH][eE][aA][dD]>/,$p' xxx.html >> p1.$$
102 mv p1.$$ xxx.html
103
104 sed -n '1,/<[dD][iI][vV] [iI][dD]="content">/p' xxx.html> p1.$$
105 sed '1,/<!--seperator-->/d' .404.html >> p1.$$
106 sed -n '/<[dD][iI][vV] [iI][dD]="content">/,$p' xxx.html | sed '1d' >> p1.$$
107 sed '/<!--seperator-->/d' p1.$$ > 404.html
108 rm *.$$ xxx.html
109 echo 'done'
110
111
112
113 #
114 # Create files (main menu)
115 #
116 # for n in index.html features.html doc.html download.html screenshots.html credits.html links.html;do
117 echo 'Creating menu files'
118 # for n in index.html screenshots.html help.html doc.html;do
119
120
121
122 for n in working/*.html;do
123 # for n in working/boot-params.html;do
124 echo -n " ${n/working\//}... "
125 myTitle=`sed -n '/<[hH]3>/p' "$n" | sed '
126 2,$d
127 s/<[^<]*<[bB][rR] *\/*>\([^<]*\)<[bB][rR].*/\1/
128 s|<\/*[hH]3>||g'`
129
130
131 # fix first H2
132 sed '
133 s|<[hH]2[^>]*>|<H2>|g
134 0,/<[hH]2[^>]*><[aA] [nN][aA][mM][eE]/s//<H2 style="margin-top: 0;"><a name/
135 1,/<div id="content">/d
136 /<div id="footer">/,$d
137 /<div id="menu">/,$d
138 $d' "$n" > "$n".$$
139
140
141
142 # # echo "myTitle = $myTitle"
143 # X=`sed '1,/<[bB][oO][dD][yY]/d' "$n".$$ | sed '/<.[bB][oO][dD][yY]>/,$d'`
144 # X=`echo "$X" | sed 's|$| \\\\|'`
145 # sed "/<div id=\"content\">/a \
146 # $X
147 # " template.html > tpm.$$
148
149
150 sed "/<div id=\"content\">/ r "$n".$$" template.html > tpm.$$
151
152
153 fonly="$n"
154 fonly="${fonly/working\//}"
155 sed '/<!--txt-only-->/!b
156 :a
157 /<!--end-txt-only-->/!{
158 N
159 ba
160 }
161 s/<!--txt-only-->.*<!--end-txt-only-->//' tpm.$$ | sed 's| $||' | sed "s|\"myTitle\"|$myTitle|
162 s|\"myVersion\"|$myVersion|g
163 s|TARBALL_SIZE|$tarballSizeEN|g
164 s|ISO_SIZE|$isoSizeEN|g
165 s|\"MD5SUM\"|$md5sum|
166 /<[hH]1>.*<[bB][rR]/d
167 s|class=\"here\" ||
168 s|<a href=\"$fonly\">|<a class=\"here\" href=\"$fonly\">|
169 s|</div><div id=\"menu\">|<div id=\"menu\">|" > "${n/working\//}"
170
171 rm tpm.$$ "$n".$$
172 echo 'done'
173
174
175 done
176
177
178
179 # #Fix doc.html - Documentation menu
180 # num=`grep -n '<div id="linkline">' doc.html | sed 's|:.*||'`
181 #
182 # '
183 # s|class=\"here\" ||
184 # s|<a href=\"$n\">|<a class=\"here\" href=\"$n\">|' doc.html > doc.html.$$
185 # mv doc.html.$$ doc.html
186
187
188 echo '<H2 style="margin-top: 0;">Contents</H2>
189 <p>' >list
190
191 echo 'Fixing documentation files'
192 count=0
193
194
195
196 # for n in project.html \
197 # custom-cd.html \
198 # usb.html \
199 # boot-params.html \
200 # clonezilla.html \
201 # backup.html \
202 # backup-smb.html \
203 # restoration.html \
204 # restore.html \
205 # restore-burn.html \
206 # reloc-img.html \
207 # supergrubdisk.html \
208 # oldboot.html \
209 # sysresccd.html \
210 # partitions.html \
211 # recover.html \
212 # own-scripts.html \
213 # annex-a-devices.html
214
215 theFiles="usb.html
216 boot-params.html
217 clonezilla.html
218 backup.html
219 backup-smb.html
220 restoration.html
221 restore.html
222 restore-burn.html
223 reloc-img.html
224 supergrubdisk.html
225 oldboot.html
226 sysresccd.html
227 partitions.html
228 recover.html
229 own-scripts.html
230 annex-a-devices.html"
231 for n in $theFiles
232 do
233 html[count]="$n"
234 ((count++))
235 done
236
237
238 count=0
239 while [ -n "${html[$count]}" ]
240 do
241 if [ $count -eq 0 ];then
242 unset prev
243 else
244 prev="${html[$((count-1))]}"
245 fi
246 n="${html[$count]}"
247 next="${html[$((count+1))]}"
248 #
249 # for n in boot-params.html
250 # do
251
252 echo -n " $n... "
253
254 sed 's| $||' "$n" | sed "
255 /<[hH]1>.*<[bB][rR]/d
256 s|class=\"here\" ||
257 s|<a href=\"doc.html\">|<a class=\"here\" href=\"doc.html\">|
258 /#content/s/width: 750px;/width: 950px;/
259 /<div id=\"menu\">/,/<.div>/d
260 s|background-image: url('images/line.png'); background-repeat:repeat-y;||
261 " > "$n".$$
262 mv "$n".$$ "$n"
263
264
265 sed "/<!-- docline-top-->/a \
266 <div id=\"docline-top\">\
267 <a href=\"$prev\">&lt; PREV</a>\
268 <a href=\"doc.html\">UP</a>\
269 <a href=\"$next\">NEXT &gt;</a>\
270 </div>" "$n" | sed "/<div id=.footer.>/a \
271 <div id=\"docline-bottom\">\
272 <a href=\"$prev\">&lt; PREV</a>\
273 <a href=\"doc.html\">UP</a>\
274 <a href=\"$next\">NEXT &gt;</a>\
275 </div>" > "$n".$$
276 mv "$n".$$ "$n"
277
278
279
280 # contents list for doc.html
281 sed -n '/<[Hh][23]/p' "$n" | sed "1d
282 /<[Hh][0-9]>Clonezilla-SysRescCD<\/[Hh][0-9]>/d
283 s|<[sS][pP][aA][nN].*</[sS][pP][aA][nN]>||
284 s|\[.*\]||
285 s|<[hH][13]>\([^<]\)|<a href=\"$n\">\1|
286 s|<[hH]2[^>]*>|\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;|
287 s|<[hH]3[^>]*>|\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;|
288 s|</[aA]>||
289 s|<[aA] [nN][aA][mM][eE]=\"|<a href=\"$n#|
290 s|</[Hh][0-9]>|</a>|
291 s| [-]*[>]*</a>|</a>|
292 s|</a>|</a><br>|
293 s|Documentation: ||
294 ">> list
295
296
297
298 echo 'done'
299 ((count++))
300 done
301
302
303
304 echo '</p>' >> list
305 sed '/Identifying devices in Linux/i \
306 </p> \
307 <H2 >Annex</H2> \
308 <p>' list >list.$$ && mv list.$$ list
309
310 sed '/<div id="content">/ r list' < template.html |sed 's|class=\"here\" ||
311 s|<a href=\"doc.html\">|<a class=\"here\" href=\"doc.html\">|
312 s|\"myTitle\"|Documentation|g'> doc.html
313
314 rm *~ list template.html 2>/dev/null
315
316
317
318 #############################################################################
319 # #
320 # Creating onepage.html #
321 # #
322 #############################################################################
323
324 echo "Creating onepage.html"
325
326
327
328 sed '1,/<div id="menu">/!d
329 /<div id="menu">/d
330 s|<!--.*-->||g
331 s/margin-top: 0;/margin-top: 0; font-size: 2em;/
332 /^$/d' < index.html | sed '$d' > onepage.html
333
334
335 rm onepage-tmp.html 2>/dev/null
336 # exit
337 #for n in doc.html $theFiles
338 for n in $theFiles screenshots.html help.html
339 do
340 echo -n " $n... "
341 title=`sed '/<[tT][iI][tT][lL][eE]>/!d
342 s|<[^>]*>||g
343 s|Documentation: ||
344 s|Clonezilla-SysRescCD - ||' "$n"`
345
346 sed '1,/<div id="content">/d
347 /<div id="menu">/,$d
348 /<div id="footer">/,$d' "$n" | sed "s|</[aA]>Intro|</a>$title|
349 /<H2 style=\"margin-top: 0;\">/s|margin-top: 0;|font-size: 2em;|
350 s|<!--.*-->||g
351 /^$/d" | sed '$d' >> onepage-tmp.html
352 echo 'done'
353 done
354
355 cat onepage-tmp.html >> onepage.html
356 echo '</div>' >> onepage.html
357 sed '/<div id="menu">/,$!d' index.html |sed '/<div id="menu">/,/<.div>/d' >> onepage.html
358
359 sed '/#content/s/width: 750px;/width: 950px;/
360 s|background-image: url('images/line.png'); background-repeat:repeat-y;||g
361 s|images/line.png||g' onepage.html > o && mv o onepage.html
362
363 rm onepage-tmp.html 2>/dev/null
364

Properties

Name Value
svn:executable *

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26