This commit is contained in:
gauthiier 2020-07-13 10:05:10 +02:00
parent 68de0eb54e
commit 1deea0e62d
2 changed files with 12 additions and 3 deletions

View File

@ -47,6 +47,11 @@ table td img {
border: 2px grey ridge;
}
table td video {
width: 100%;
border: 2px grey ridge;
}
.lst {
margin-right: 3em;
}

10
gen.py
View File

@ -19,7 +19,7 @@ def parse_args():
if args.output and os.path.isdir(args.output):
output_dir = args.output;
def translate(txt, dirname):
def translate_index_header(txt, dirname):
try:
table = open(os.path.join('.', '<table>'), 'r+');
except:
@ -28,7 +28,11 @@ def translate(txt, dirname):
href = None
sections = txt.count('- - -');
if sections == 1:
if sections == 0:
# not following the normal template -> direct html
txt = txt.replace('data/', dirname + '/'); #<--- replace reference to data/
return txt
elif sections == 1:
[text, link] = txt.split('- - -');
elif sections == 2:
[text, link, href] = txt.split('- - -');
@ -246,7 +250,7 @@ if __name__ == '__main__':
txt = indx.read();
dirname = os.path.basename(dd);
newdirname = escape_date(dirname) # trim date out of url -- permalink
content += translate(txt, newdirname);
content += translate_index_header(txt, newdirname);
content += '\n<br>\n';
# data dir / content