Serve pre-rendered PDF as static file for instant download
All checks were successful
Build and Deploy Erika CV / build-and-deploy (push) Successful in 1m10s
All checks were successful
Build and Deploy Erika CV / build-and-deploy (push) Successful in 1m10s
- Render PDF once with WeasyPrint, save to static/Erika_Nielsen_CV.pdf - Change download button from WeasyPrint route to direct static file link - Faster download, no server-side rendering on each click
This commit is contained in:
@@ -384,6 +384,8 @@
|
||||
box-shadow: 0 4px 20px rgba(74, 143, 232, 0.5);
|
||||
transition: background 0.2s, transform 0.1s;
|
||||
z-index: 999;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
}
|
||||
.pdf-btn:hover { background: #2f72d0; transform: scale(1.04); }
|
||||
|
||||
@@ -732,7 +734,7 @@
|
||||
</div>
|
||||
|
||||
{% if not pdf_mode %}
|
||||
<button class="pdf-btn" onclick="window.location='/download'">⬇ Download CV som PDF</button>
|
||||
<a class="pdf-btn" href="/static/Erika_Nielsen_CV.pdf" download="Erika_Nielsen_CV.pdf">⬇ Download CV som PDF</a>
|
||||
{% endif %}
|
||||
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user