Pass variables between HTML files and streamlit

I’m trying to render HTML files from streamlit using st.makdown and unsafe_allow_html=True. But the same time, I want to be able to pass variables between streamlit and HTML.

Can something like jinja2 templates be used for this purpose ? If yes, how ?

Here is an example of the code:

Import streamline as st


With open('navbar.html') as navbar:
   St.markdown(f'{}', unsafe_allow_html=True)

With open('content.html') as body:
   St.markdown(f'{}', unsafe_allow_html=True)

With open('footer.html') as footer:
   St.markdown(f'', unsafe_allow_html=True)