This commit is contained in:
gauthiier 2017-07-02 15:20:44 +02:00
parent d818035d16
commit 56bea0a7ff
5 changed files with 88 additions and 11 deletions

View File

@ -47,16 +47,26 @@ table td img {
border: 2px grey ridge; border: 2px grey ridge;
} }
.lst p mat {
margin-left: : 2em;
}
.lst ul li { display: inline; } .lst ul li { display: inline; }
.lst ul li desc { .lst ul li desc {
bborder: 10px grey ridge;
margin: 2em; margin: 2em;
margin-bottom: 1em; margin-bottom: 1em;
width: 985; width: 985;
display: block; display: block;
} }
.lst ul li desc img {
border: 10px grey ridge;
margin: 0em;
margin-bottom: 2em;
width: 985;
display: block;
}
.lst ul li img { .lst ul li img {
border: 10px grey ridge; border: 10px grey ridge;
@ -72,6 +82,44 @@ table td img {
width: 450; width: 450;
} }
.lst ul li sound {
display: inline-block;
border: 10px grey ridge;
margin: 2em;
width: 440;
padding: 10;
}
.lst ul li sound track {
display: block;
margin-top: 0.3em;
margin-bottom: 0.3em;
}
.lst ul li sound info {
width: 100%;
}
.lst ul li sound audio {
width: 100%;
margin-top: 0.5em;
}
.lst ul li lo img {
border: none;
margin: 1em;
margin-top: 0.5em;
max-width: 300;
}
.lst ul li la img {
border: none;
margin: 1em;
margin-top: 0.5em;
max-width: 100;
max-height: 100;
}
address { address {
margin: 20px; margin: 20px;
} }

4
.gitignore vendored
View File

@ -1,3 +1,5 @@
+++/*.jpg +++/*.jpg
+++/*.jpeg
+++/*.pdf +++/*.pdf
+++/Screen-Shot-2014-05-26-at-20.40.24-b.png +++/Screen-Shot-2014-05-26-at-20.40.24-b.png
+++/bb15.png

38
gen.py
View File

@ -49,13 +49,37 @@ def translate(txt, dirname):
def escape_date(dirname): def escape_date(dirname):
return re.sub('^20\d{2}?.', '', dirname) return re.sub('^20\d{2}?.', '', dirname)
def emit_img(file): def emit_img(file, data_dir):
return '<a href="' + file + '"><img src="' + file + '" /></a>' return '<a href="' + file + '"><img src="' + file + '" /></a>'
def emit_video_mp4(file): def emit_video_mp4(file, data_dir):
return '<video controls><source src="' + file + '" type="video/mp4"</video>' return '<video controls><source src="' + file + '" type="video/mp4"</video>'
def default(file): def emit_audio(file, data_dir):
# an '.audio' file is a json file with a list of audio elements
# which need to be bundles as a type of list in a single <li>
filename = os.path.join(data_dir, file);
with open(filename) as f:
audio = json.loads(f.read())
out = "<sound>\n"
for a in audio:
out += "<track>\n"
out += "<info>\n"
out += "<name>" + a["name"] + "</name>\n"
#out += "<duration>" + a["length"] + "</duration>\n"
out += "</info>\n"
out += "<audio controls preload>\n"
out += '<source src="' + a["file"] + '" type="audio/' + a["type"] + '">'
out += "</audio>\n"
out += "</track>\n"
out += "</sound>\n"
return out
return "to do to do to do"
def default(file, data_dir):
return None; return None;
content_map = { content_map = {
@ -63,6 +87,7 @@ content_map = {
'.jpg': emit_img, '.jpg': emit_img,
'.m4v': emit_video_mp4, '.m4v': emit_video_mp4,
'.mov': emit_video_mp4, '.mov': emit_video_mp4,
'.audio': emit_audio,
'.html': default, '.html': default,
'.txt': default '.txt': default
}; };
@ -118,9 +143,10 @@ def index_content(dir_name, data_dir, index_txt, desc_txt, template):
for j in files: for j in files:
x, ext = os.path.splitext(j); x, ext = os.path.splitext(j);
element = content_map[ext](j); if ext in content_map:
if element: element = content_map[ext](j, data_dir);
content += "<li>" + content_map[ext](j) + "</li>" + "\n"; if element:
content += "<li>" + element + "</li>" + "\n";
#print content #print content

View File

@ -1,6 +1,7 @@
<html> <html>
<head> <head>
<title>Index of /gauthiier.info/2014.waveforms</title> <meta charset="utf-8">
<title>Index of /gauthiier.info/[[dir]]</title>
<link rel="stylesheet" type="text/css" href="../+++/lestyle.css"/> <link rel="stylesheet" type="text/css" href="../+++/lestyle.css"/>
<meta name="keywords" content="david gauthier, gauthiier, davidgauthier, dviid"> <meta name="keywords" content="david gauthier, gauthiier, davidgauthier, dviid">
</head> </head>

View File

@ -1,6 +1,6 @@
<html lang="en"> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta charset="utf-8">
<meta name="keywords" content="david gauthier, gauthiier, davidgauthier, dviid"> <meta name="keywords" content="david gauthier, gauthiier, davidgauthier, dviid">
<meta name="description" content="David Gauthier (b.1979, CA) - selected index of work."> <meta name="description" content="David Gauthier (b.1979, CA) - selected index of work.">
<link rel="icon" href="+++/jules-henri.ico" type="image/x-icon"> <link rel="icon" href="+++/jules-henri.ico" type="image/x-icon">