This commit is contained in:
partisan 2024-08-14 12:55:34 +02:00
parent 63c04a9b44
commit 0165c7e6f7
67 changed files with 55 additions and 45 deletions

24
main.go
View file

@ -89,13 +89,7 @@ func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
if r.URL.Path == "/" { if r.URL.Path == "/" {
pageData := PageData{ renderIndex(w)
Title: "My Blog",
Description: "Welcome to my blog about various topics.",
BlogLinks: getBlogLinks(),
Content: template.HTML(""),
}
renderTemplate(w, pageData)
return return
} }
@ -412,6 +406,22 @@ func renderTemplate(w http.ResponseWriter, pageData PageData) {
} }
} }
func renderIndex(w http.ResponseWriter) {
tmpl, err := template.ParseFiles(filepath.Join(templateDir, "index.html"))
if err != nil {
http.Error(w, "Internal Server Error", http.StatusInternalServerError)
log.Printf("Error parsing template: %v", err)
return
}
err = tmpl.Execute(w, nil)
if err != nil {
http.Error(w, "Internal Server Error", http.StatusInternalServerError)
log.Printf("Error executing template: %v", err)
}
}
func renderAllBlogs(w http.ResponseWriter, r *http.Request, page int) { func renderAllBlogs(w http.ResponseWriter, r *http.Request, page int) {
var allEntries []BlogEntry var allEntries []BlogEntry

View file

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View file

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View file

Before

Width:  |  Height:  |  Size: 780 B

After

Width:  |  Height:  |  Size: 780 B

View file

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

Before

Width:  |  Height:  |  Size: 915 B

After

Width:  |  Height:  |  Size: 915 B

View file

Before

Width:  |  Height:  |  Size: 1,013 B

After

Width:  |  Height:  |  Size: 1,013 B

View file

Before

Width:  |  Height:  |  Size: 414 B

After

Width:  |  Height:  |  Size: 414 B

View file

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View file

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View file

@ -100,19 +100,19 @@ sudo apk add --allow-untrusted spitfire-browser.apk</code></pre>
<ul class="icons"> <ul class="icons">
<li> <li>
<a href="#" class="icon alt"> <a href="#" class="icon alt">
<img src="images/icons/regular/heart.svg" alt="LibrePay"> <img src="static/images/icons/regular/heart.svg" alt="LibrePay">
<span class="label">LibrePay</span> <span class="label">LibrePay</span>
</a> </a>
</li> </li>
<li> <li>
<a href="https://weforgecode.xyz/Spitfire/" class="icon alt"> <a href="https://weforgecode.xyz/Spitfire/" class="icon alt">
<img src="images/icons/brands/git-alt.svg" alt="Forgejo"> <img src="static/images/icons/brands/git-alt.svg" alt="Forgejo">
<span class="label">Forgejo</span> <span class="label">Forgejo</span>
</a> </a>
</li> </li>
<li> <li>
<a href="#" class="icon alt"> <a href="#" class="icon alt">
<img src="images/icons/brands/youtube.svg" alt="YouTube"> <img src="static/images/icons/brands/youtube.svg" alt="YouTube">
<span class="label">YouTube</span> <span class="label">YouTube</span>
</a> </a>
</li> </li>

View file

@ -88,23 +88,23 @@
<h2>Stable Releases</h2> <h2>Stable Releases</h2>
<div class="download-buttons"> <div class="download-buttons">
<a href="#" class="download-button button"> <a href="#" class="download-button button">
<img src="images/icons/brands/windows.svg" alt="Windows"> <img src="static/images/icons/brands/windows.svg" alt="Windows">
<span>Windows</span> <span>Windows</span>
</a> </a>
<a href="#" class="download-button button"> <a href="#" class="download-button button">
<img src="images/icons/brands/apple.svg" alt="MacOS"> <img src="static/images/icons/brands/apple.svg" alt="MacOS">
<span>MacOS</span> <span>MacOS</span>
</a> </a>
<a href="download-linux.html" class="download-button button"> <a href="download-linux.html" class="download-button button">
<img src="images/icons/brands/linux.svg" alt="Linux"> <img src="static/images/icons/brands/linux.svg" alt="Linux">
<span>Linux</span> <span>Linux</span>
<!-- </a> <!-- </a>
<a href="#" class="download-button button"> <a href="#" class="download-button button">
<img src="images/icons/brands/linux.svg" alt="Linux (Appimage)"> <img src="static/images/icons/brands/linux.svg" alt="Linux (Appimage)">
<span>Linux (Appimage)</span> <span>Linux (Appimage)</span>
</a> --> </a> -->
<a href="#" class="download-button button"> <a href="#" class="download-button button">
<img src="images/icons/brands/chrome.svg" alt="ChromeOS"> <img src="static/images/icons/brands/chrome.svg" alt="ChromeOS">
<span>ChromeOS</span> <span>ChromeOS</span>
</a> </a>
</div> </div>
@ -115,11 +115,11 @@
<h2>Nightly Releases</h2> <h2>Nightly Releases</h2>
<div class="download-buttons"> <div class="download-buttons">
<a href="#" class="download-button button"> <a href="#" class="download-button button">
<img src="images/icons/brands/windows.svg" alt="Windows Nightly"> <img src="static/images/icons/brands/windows.svg" alt="Windows Nightly">
<span>Windows</span> <span>Windows</span>
</a> </a>
<a href="#" class="download-button button"> <a href="#" class="download-button button">
<img src="images/icons/brands/linux.svg" alt="Linux (Flatpak) Nightly"> <img src="static/images/icons/brands/linux.svg" alt="Linux (Flatpak) Nightly">
<span>Linux (Flatpak)</span> <span>Linux (Flatpak)</span>
</a> </a>
</div> </div>
@ -133,19 +133,19 @@
<ul class="icons"> <ul class="icons">
<li> <li>
<a href="#" class="icon alt"> <a href="#" class="icon alt">
<img src="images/icons/regular/heart.svg" alt="LibrePay"> <img src="static/images/icons/regular/heart.svg" alt="LibrePay">
<span class="label">LibrePay</span> <span class="label">LibrePay</span>
</a> </a>
</li> </li>
<li> <li>
<a href="https://weforgecode.xyz/Spitfire/" class="icon alt"> <a href="https://weforgecode.xyz/Spitfire/" class="icon alt">
<img src="images/icons/brands/git-alt.svg" alt="Forgejo"> <img src="static/images/icons/brands/git-alt.svg" alt="Forgejo">
<span class="label">Forgejo</span> <span class="label">Forgejo</span>
</a> </a>
</li> </li>
<li> <li>
<a href="#" class="icon alt"> <a href="#" class="icon alt">
<img src="images/icons/brands/youtube.svg" alt="YouTube"> <img src="static/images/icons/brands/youtube.svg" alt="YouTube">
<span class="label">YouTube</span> <span class="label">YouTube</span>
</a> </a>
</li> </li>

View file

@ -16,10 +16,10 @@
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" /> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<link rel="stylesheet" href="assets/css/main.css" /> <link rel="stylesheet" href="static/css/main.css" />
<link rel="stylesheet" href="assets/css/stars.css" /> <link rel="stylesheet" href="static/css/stars.css" />
<link rel="stylesheet" href="assets/css/fancy-gallery.css" /> <link rel="stylesheet" href="static/css/fancy-gallery.css" />
<noscript><link rel="stylesheet" href="assets/css/noscript.css" /></noscript> <noscript><link rel="stylesheet" href="static/css/noscript.css" /></noscript>
<style> <style>
/* Ensure the wrapper content remains above the background */ /* Ensure the wrapper content remains above the background */
#wrapper { #wrapper {
@ -64,7 +64,7 @@
<!-- Header --> <!-- Header -->
<header id="header" class="alt"> <header id="header" class="alt">
<span class="logo"><img src="images/logo.svg" alt="Spitfire Logo" /></span> <span class="logo"><img src="static/images/logo.svg" alt="Spitfire Logo" /></span>
<h1>Spitfire Browser</h1> <h1>Spitfire Browser</h1>
<p>Fast. Secure. Elegant.</p> <p>Fast. Secure. Elegant.</p>
<a href="download.html" class="button">Download Now</a> <a href="download.html" class="button">Download Now</a>
@ -91,8 +91,8 @@
<p>Spitfire Browser is your gateway to a fast, secure, and elegant browsing experience. Built on Firefox, Spitfire includes essential features like ad blocking, enhanced security, and anonymous browsing with Warp search engine.</p> <p>Spitfire Browser is your gateway to a fast, secure, and elegant browsing experience. Built on Firefox, Spitfire includes essential features like ad blocking, enhanced security, and anonymous browsing with Warp search engine.</p>
<div class="box alt"> <div class="box alt">
<div class="fancy-gallery"> <div class="fancy-gallery">
<div class="gallery-item"><img src="images/screenshots/1.png" alt="Screenshot 1" /></div> <div class="gallery-item"><img src="static/images/screenshots/1.png" alt="Screenshot 1" /></div>
<div class="gallery-item"><img src="images/screenshots/1.png" alt="Screenshot 2" /></div> <div class="gallery-item"><img src="static/images/screenshots/1.png" alt="Screenshot 2" /></div>
</div> </div>
</div> </div>
<ul class="actions"> <ul class="actions">
@ -148,31 +148,31 @@
<ul class="statistics"> <ul class="statistics">
<li class="style1"> <li class="style1">
<a class="icon icon-security"> <a class="icon icon-security">
<img src="images/icons/solid/lock.svg" alt="Lock"> <img src="static/images/icons/solid/lock.svg" alt="Lock">
</a> </a>
<strong>0</strong> Telemetry <strong>0</strong> Telemetry
</li> </li>
<li class="style2"> <li class="style2">
<a class="icon icon-security"> <a class="icon icon-security">
<img src="images/icons/regular/eye-slash.svg" alt="Eye-slash"> <img src="static/images/icons/regular/eye-slash.svg" alt="Eye-slash">
</a> </a>
<strong>100%</strong> Privacy <strong>100%</strong> Privacy
</li> </li>
<li class="style3"> <li class="style3">
<a class="icon icon-security"> <a class="icon icon-security">
<img src="images/icons/solid/arrows-rotate.svg" alt="arrows-rotate"> <img src="static/images/icons/solid/arrows-rotate.svg" alt="arrows-rotate">
</a> </a>
<strong>Auto</strong> Updates <strong>Auto</strong> Updates
</li> </li>
<li class="style4"> <li class="style4">
<a class="icon icon-security"> <a class="icon icon-security">
<img src="images/icons/brands/firefox-browser.svg" alt="Firefox"> <img src="static/images/icons/brands/firefox-browser.svg" alt="Firefox">
</a> </a>
<strong>Based</strong>on Firefox <strong>Based</strong>on Firefox
</li> </li>
<li class="style5"> <li class="style5">
<a class="icon icon-security"> <a class="icon icon-security">
<img src="images/icons/solid/code.svg" alt="code"> <img src="static/images/icons/solid/code.svg" alt="code">
</a> </a>
<strong>Open</strong> Source <strong>Open</strong> Source
</li> </li>
@ -207,19 +207,19 @@
<ul class="icons"> <ul class="icons">
<li> <li>
<a href="#" class="icon alt"> <a href="#" class="icon alt">
<img src="images/icons/regular/heart.svg" alt="LibrePay"> <img src="static/images/icons/regular/heart.svg" alt="LibrePay">
<span class="label">LibrePay</span> <span class="label">LibrePay</span>
</a> </a>
</li> </li>
<li> <li>
<a href="#" class="icon alt"> <a href="#" class="icon alt">
<img src="images/icons/brands/git-alt.svg" alt="Forgejo"> <img src="static/images/icons/brands/git-alt.svg" alt="Forgejo">
<span class="label">Forgejo</span> <span class="label">Forgejo</span>
</a> </a>
</li> </li>
<li> <li>
<a href="#" class="icon alt"> <a href="#" class="icon alt">
<img src="images/icons/brands/youtube.svg" alt="YouTube"> <img src="static/images/icons/brands/youtube.svg" alt="YouTube">
<span class="label">YouTube</span> <span class="label">YouTube</span>
</a> </a>
</li> </li>
@ -233,13 +233,13 @@
</div> </div>
<!-- Scripts --> <!-- Scripts -->
<script src="assets/js/jquery.min.js" defer></script> <script src="static/js/jquery.min.js" defer></script>
<script src="assets/js/jquery.scrollex.min.js" defer></script> <script src="static/js/jquery.scrollex.min.js" defer></script>
<script src="assets/js/jquery.scrolly.min.js" defer></script> <script src="static/js/jquery.scrolly.min.js" defer></script>
<script src="assets/js/browser.min.js" defer></script> <script src="static/js/browser.min.js" defer></script>
<script src="assets/js/breakpoints.min.js" defer></script> <script src="static/js/breakpoints.min.js" defer></script>
<script src="assets/js/util.js" defer></script> <script src="static/js/util.js" defer></script>
<script src="assets/js/main.js" defer></script> <script src="static/js/main.js" defer></script>
</body> </body>
</html> </html>

View file

@ -71,19 +71,19 @@
<ul class="icons"> <ul class="icons">
<li> <li>
<a href="#" class="icon alt"> <a href="#" class="icon alt">
<img src="images/icons/regular/heart.svg" alt="LibrePay"> <img src="static/images/icons/regular/heart.svg" alt="LibrePay">
<span class="label">LibrePay</span> <span class="label">LibrePay</span>
</a> </a>
</li> </li>
<li> <li>
<a href="https://weforgecode.xyz/Spitfire/" class="icon alt"> <a href="https://weforgecode.xyz/Spitfire/" class="icon alt">
<img src="images/icons/brands/git-alt.svg" alt="Forgejo"> <img src="static/images/icons/brands/git-alt.svg" alt="Forgejo">
<span class="label">Forgejo</span> <span class="label">Forgejo</span>
</a> </a>
</li> </li>
<li> <li>
<a href="#" class="icon alt"> <a href="#" class="icon alt">
<img src="images/icons/brands/youtube.svg" alt="YouTube"> <img src="static/images/icons/brands/youtube.svg" alt="YouTube">
<span class="label">YouTube</span> <span class="label">YouTube</span>
</a> </a>
</li> </li>