forked from pixelb/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgen_timeline
More file actions
executable file
·72 lines (63 loc) · 2.12 KB
/
gen_timeline
File metadata and controls
executable file
·72 lines (63 loc) · 2.12 KB
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
#!/bin/sh
# list the newest html files in the tree
# License: LGPLv2
exclude_re='(\.git/|xvpics|priv/|tmp/|timeline\.html|modified\.html|head\.html|footer\.html|footer-home\.html|adds\.html|last\.html|header.html|menu.html|left-blank.html|.htaccess)' #don't show these paths
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>sitemap/timeline</title>
<META NAME="generator" CONTENT="gen_timeline (a bash script)">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--#include virtual="/head.html"-->
<style type="text/css">
table.align td {
padding: 0px;
border: 0px;
}
</style>
</head>
<body>
<div id="content">
<div class="contentText">'
echo '<pre>
<table class="pixelbeat">
<tr class="pbtitle"><td align="center"><b>By Date</b></td><td align="center"><b>By Name</b></td></tr>
<tr>
<td><table class="align">'
find $1 -type f -printf "%P\t%T@\n" |
sort -k2,2nr |
cut -f1 |
#files starting with . | files without a . | files ending in .c .cpp ...
grep -E "(^|/)[.].+|(^|/)[^.]+$|[.](c|cpp|py|sh|rc|tips|fortune|html)$" |
grep -Ev "$exclude_re" |
while read file; do
time=`date --reference="$file" "+%b %e %Y"`
file=`echo "$file" | sed 's/\(.*\)\/index.html/\1\//'`
echo "<tr><td>$time </td><td><a href=\"$file\">$file</a></td></tr>"
done
echo '</table></td>
<td><table class="align">'
find $1 -type f -printf "%P\n" |
sed 's#\(.*/.*\)#¬\1#' | #setup to group paths in sort
LANG=C sort |
tr -d ¬ |
#files starting with . | files without a . | files ending in .c .cpp ...
grep -E "(^|/)[.].+|(^|/)[^.]+$|[.](c|cpp|py|sh|rc|tips|fortune|html)$" |
grep -Ev "$exclude_re" |
sed 's/\(.*\)\/index.html/\1\//' |
while read file; do
echo "<tr><td><a href=\"$file\">$file</a></td></tr>"
done
echo '</table></td>
</tr>'
echo '</table>'
echo '</pre>'
echo '<br>'
echo 'This sitemap/timeline was generated by <a href="scripts/gen_timeline">gen_timeline</a>'
echo '</div>
</div>
<div id="sidebar">
<!--#include virtual="/header.html"-->
<!--#include virtual="/footer.html"-->
</div>
</body>
</html>'