generated from hjess/PythonTemplateProject
Bug somewhere
Some checks failed
Build, Push, and Deploy to Nomad / docker-nomad (push) Failing after 4m38s
Some checks failed
Build, Push, and Deploy to Nomad / docker-nomad (push) Failing after 4m38s
This commit is contained in:
@@ -47,30 +47,16 @@ def slider(options, images):
|
||||
width = options.get("width", 500)
|
||||
height = options.get("height", 375)
|
||||
|
||||
# First image with a <figure> and <figcaption>
|
||||
first_image_html = f'''
|
||||
<figure class="relative my-0 slider-bg">
|
||||
<img src="{images[0]}" width="{width}" height="{height}">
|
||||
<figcaption class="absolute inset-0 flex flex-col justify-end p-6">
|
||||
<h1 class="my-0">Fylgja CSS Slider</h1>
|
||||
</figcaption>
|
||||
</figure>
|
||||
'''
|
||||
## Todo: https://codepen.io/dp_lewis/pen/WNZQzN
|
||||
# Remaining images as plain <img> tags
|
||||
other_images_html = "".join([
|
||||
f'<img src="{img}" width="{width}" height="{height}">' for img in images[1:]
|
||||
])
|
||||
html_content = []
|
||||
button_content = []
|
||||
|
||||
#for i, val in enumerate(images):
|
||||
# html_content.append(f"""<button onclick="openModal('modal{i}')" class="open"> Open Modal {i} </button>""")
|
||||
# button_content.append(f"""<div class="modal" id="modal{i}"> <div class="modal-content"> <h2>Modal {i}</h2> <p>This is modal {i}.</p> <button onclick="closeModal('modal{i}')">Close</button> </div> </div>""")
|
||||
#html = '\n'.join( html_content )
|
||||
#print(html)
|
||||
return """Hej"""
|
||||
|
||||
# Final combined HTML
|
||||
return f'''
|
||||
<main>
|
||||
<div class="scroll-slider hide-scrollbar">
|
||||
{first_image_html}
|
||||
{other_images_html}
|
||||
</div>
|
||||
</main>
|
||||
'''
|
||||
|
||||
def create_jinja_environment():
|
||||
"""Create and configure the Jinja2 environment."""
|
||||
@@ -102,6 +88,7 @@ def render_markdown_with_jinja(markdown_content: str):
|
||||
|
||||
# Step 2: Pass the resulting HTML with Jinja2 custom tags through Jinja2
|
||||
env = create_jinja_environment()
|
||||
|
||||
template = env.get_template("base_template")
|
||||
final_html = template.render(content=intermediate_html)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user