date in template: year, month, day

andre
Castro0o 5 years ago
parent c6a4e6ca0c
commit 595fcb0ccd

@ -39,17 +39,17 @@ pub_parts_html = '' # to append all content
for answer in site.ask(args.ask): for answer in site.ask(args.ask):
publication_title = '' publication_title = ''
# print(answer, answer.keys()) print(answer, answer.keys())
printout_dict = unpack_response(answer) printout_dict = unpack_response(answer)
# pprint(printout_dict) # pprint(printout_dict)
img_info = images_info[printout_dict['page']] img_info = images_info[printout_dict['page']]
page = site.pages[[printout_dict['page']]] page = site.pages[[printout_dict['page']]]
pagetext = page.text() pagetext = page.text()
pagetext_html = pandoc(pwd=wd, content=pagetext, format_in='mediawiki', format_out='html') pagetext_html = pandoc(pwd=wd, content=pagetext, format_in='mediawiki', format_out='html')
print(pagetext_html)
img_local = os.path.join(imgdir, img_info.get('filename')) img_local = os.path.join(imgdir, img_info.get('filename'))
# pprint(img_info) # pprint(img_info)
# print(img_local) # print(img_local)
# import pdb; pdb.set_trace()
pub_part_html = pub_part_template.render( pub_part_html = pub_part_template.render(
imgsrc=os.path.join(imgdir, img_info.get('filename')), imgsrc=os.path.join(imgdir, img_info.get('filename')),
text=pagetext_html, text=pagetext_html,
@ -71,5 +71,9 @@ for answer in site.ask(args.ask):
# print(pub_html, '\n') # print(pub_html, '\n')
pub_parts_html = '' # Reset pub_parts_html pub_parts_html = '' # Reset pub_parts_html
# TODO: queries wihout Part? # TODO: queries without Part?
# TODO: include Creator Property value # TODO: include Creator Property value
# TODO: address Dates:
# * date values coming from mw with timestamp, the missing valus are one
# This a MW issue!

@ -7,7 +7,7 @@
</head> </head>
<body> <body>
<h1>{{ title }}</h1> <h1>{{ title }}</h1>
<p><time datetime="{{date}}">{{date}}</time></p> <p><time datetime="{{date}}">{{ date.year }} {{ date.month }} {{ date.day }} </time></p>
<div id="content"> <div id="content">
{{ content }} {{ content }}
</div> </div>

Loading…
Cancel
Save