Inserting HTML into a file using the template

40 views
Skip to first unread message

p q

unread,
Oct 19, 2019, 4:53:47 PM10/19/19
to weewx-user
Hi,

Short version -
I want to insert a HTML file into index.html, probably when it is created by Cheetah. The HTML is created by python code so I can't just insert it. I took a quick look at the Cheetah documentation and it wasn't immediately obvious how to do this. 

Longer version - 
I want to have an interactive map showing recent earthquakes on my site. I wrote a little bit of python to query the USGS site to get the data and I'm using leaflet.js for the maps. I have this part all working if I manually insert the HTML into my index.html file. I suppose I could write a bit more javascript to read my HTML file and put it in the index.html, but it seems like a natural for Cheetah. Is there an easy way to do this?

Thomas Keffer

unread,
Oct 19, 2019, 5:52:40 PM10/19/19
to weewx-user
If you want to directly include another file, just use the Cheetah #include directive. There are many examples of this in the Seasons skin.



--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/e84120d5-46da-4d2a-a2cd-e89e37cb1256%40googlegroups.com.

p q

unread,
Oct 19, 2019, 6:48:06 PM10/19/19
to weewx...@googlegroups.com
Perfect. Thanks. I figured it was something easy. I have it all working on my dev VM now. 



--
Peter Quinn
(415)794-2264
Reply all
Reply to author
Forward
0 new messages