diff --git a/build_site.py b/build_site.py index a3ebce75079029433b1a749a102baa503ebaea9a..a31bfa10265c0128e1ed613076c20dfc51e3515b 100644 --- a/build_site.py +++ b/build_site.py @@ -38,7 +38,9 @@ for filename in files: # Add to projects projects.append(project) +social_icons = json.load(open("templates/social_icons.json", "r")) + # Format template template = env.get_template("index.html") with open("public/index.html", "w") as f: - f.write(template.render(projects=projects)) + f.write(template.render(projects=projects, social_icons=social_icons)) diff --git a/templates/index.html b/templates/index.html index 367d14391c557c96b895040193728e663aad4772..13e4f0b5a9fbdf58d218f87cf3bce0fd88872f06 100644 --- a/templates/index.html +++ b/templates/index.html @@ -22,14 +22,16 @@ <div class="row mx-auto p-2 text-center"> <!-- Social icons --> <p> - <a class="social-link" target="_blank" - href="https://rb9.xyz/yt"><i class="bi bi-youtube"></i></a> - <a class="social-link" target="_blank" - href="https://git.rb9.xyz/TheJoeCoder"><i class="bi bi-gitlab"></i></a> - <a class="social-link" target="_blank" - href="https://github.com/TheJoeCoder"><i class="bi bi-github"></i></a> - <a class="social-link" target="_blank" - href="https://chat.radialbog9.com/@radialbog9"><i class="bi bi-mastodon"></i></a> + {% for icon in social_icons %} + <a + class="social-link" + {% if icon.blank_target %}target="_blank"{% endif %} + href="{{ icon.url }}" + {% if icon.title %}title="{{ icon.title }}"{% endif %} + > + <i class="bi {{ icon.icon }}"></i> + </a> + {% endfor %} </p> </div> <div class="row mx-auto p-2 text-center"> diff --git a/templates/social_icons.json b/templates/social_icons.json new file mode 100644 index 0000000000000000000000000000000000000000..0330475928c5345559903e73cfb974fa4185e594 --- /dev/null +++ b/templates/social_icons.json @@ -0,0 +1,32 @@ +[ + { + "title": "Buy Me A Coffee", + "url": "https://buymeacoff.ee/Radialbog9", + "icon": "bi-wallet", + "blank_target": true + }, + { + "title": "YouTube", + "url": "https://rb9.xyz/yt", + "icon": "bi-youtube", + "blank_target": true + }, + { + "title": "GitLab", + "url": "https://git.rb9.xyz/TheJoeCoder", + "icon": "bi-gitlab", + "blank_target": true + }, + { + "title": "GitHub", + "url": "https://github.com/TheJoeCoder", + "icon": "bi-github", + "blank_target": true + }, + { + "title": "Mastodon", + "url": "https://chat.radialbog9.com/@radialbog9", + "icon": "bi-mastodon", + "blank_target": true + } +] \ No newline at end of file