Add timestamp to the template variables
Add index generation timestamp as a variable available to template authors ("timestamp"). Change-Id: I7607f0c7eebaad1adca2d6e92a356a3dab1f015b
This commit is contained in:
parent
74cb5acd5f
commit
ff513f9efe
@ -16,3 +16,5 @@ Chair (to contact for more information): {{ meeting.chair }}</p>
|
||||
{{ meeting.description|urlize }}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
<p><i>Page generated on {{ timestamp }} UTC</i></p>
|
||||
|
@ -10,6 +10,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import datetime
|
||||
import jinja2
|
||||
import logging
|
||||
import os
|
||||
@ -31,6 +32,7 @@ def convert_meetings_to_index(meetings, template, output_file):
|
||||
template = env.get_template(template_file)
|
||||
|
||||
with open(output_file, "w") as out:
|
||||
out.write(template.render(meetings=meetings))
|
||||
out.write(template.render(meetings=meetings,
|
||||
timestamp=datetime.datetime.utcnow()))
|
||||
|
||||
logging.info('Wrote %d meetings to index.' % (len(meetings)))
|
||||
|
Loading…
Reference in New Issue
Block a user