Skip to content

Commit

Permalink
fixed broken html
Browse files Browse the repository at this point in the history
  • Loading branch information
quantumbagel committed Mar 21, 2024
1 parent fb80aa1 commit 2216a14
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 31 deletions.
Binary file modified assets/images/finitecraft_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 16 additions & 16 deletions generate.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import markdown
import datetime
import time
import ruamel.yaml
import minify_html
import markdown
import requests

print("Loading...")
INFO_TEMPLATE = """
<li class="contact-item">
<div class="icon-box">
Expand Down Expand Up @@ -230,9 +235,6 @@
</section>
"""




FILTER_ITEM_TEMPLATE = """
<li class="filter-item">
<button data-filter-btn>CATEGORY</button>
Expand Down Expand Up @@ -267,25 +269,24 @@ def markdown_text_parsing(txt):


def generate_timeline_item(variables):
for item in variables:
variables[item] = markdown_text_parsing(variables[item])
# for item in variables:
# if item != "TIME_PERIOD":
variables["description"] = markdown_text_parsing(variables["description"]).replace("<p>", "").replace("</p>", "")
return TIMELINE_ITEM_TEMPLATE.replace("NAME", variables['name']).replace("TIME_PERIOD",
variables['time_period']).replace(
"DESCRIPTION", variables['description'])


def generate_skills_item(variables):
for item in variables:
variables[item] = markdown_text_parsing(variables[item])
return SKILLS_ITEM_TEMPLATE.replace("NAME", variables['name']).replace("AMOUNT", variables['level'])


def generate_text(variables):

ret = TEXT_TEMPLATE.replace("TEXT", markdown_text_parsing(variables["text"]["text"]).replace("\n", ""))
# print(ret)
return ret


def generate_header(variables):
return OPTIONAL_HEADER_TEMPLATE.replace("NAME", markdown_text_parsing(variables["name"])).replace("ICON",
variables["icon"])
Expand Down Expand Up @@ -327,7 +328,6 @@ def generate_project_item(variables):
.replace("CATEGORY", variables["tag"].lower()))



def generate_projects(variables):
variables = variables['projects']
projects_internal = ''
Expand Down Expand Up @@ -368,7 +368,7 @@ def generate_article(variables, is_first=True):

def generate_html(variables):
html = (HTML_TEMPLATE.replace("configuration.favicon", variables['favicon']).replace("configuration.name",
variables["name"]).replace(
variables["name"]).replace(
"configuration.username", variables["username"]).replace("configuration.sidebar.image",
variables["sidebar"]["image"]).replace(
"configuration.sidebar.title", variables["sidebar"]["title"])
Expand Down Expand Up @@ -400,6 +400,7 @@ def generate_html(variables):
variables["analytics"]["tag_manager_id"]))
return html


def generate_sitemap(links):
sitemap = ''
for link in links:
Expand All @@ -408,8 +409,6 @@ def generate_sitemap(links):




import requests
js = open("assets/js/script.js")
resp = requests.post("https://www.toptal.com/developers/javascript-minifier/api/raw", data={"input": js.read()})
minified = open("assets/js/minified_script.js", "w")
Expand All @@ -418,9 +417,10 @@ def generate_sitemap(links):
minified.close()
js.close()

import ruamel.yaml
import minify_html


print("Starting...")
start_time = time.time()
y = ruamel.yaml.YAML()
jobs = y.load(open("generate_execute.yaml"))["jobs"]
links = []
Expand All @@ -441,7 +441,7 @@ def generate_sitemap(links):
f.write(minify_html.minify(generate_html(data), minify_js=True, remove_processing_instructions=True))
f.close()

print(f"Regenerated {len(jobs)} jobs.")
print(f"Completed {len(jobs)} jobs in {round((time.time() - start_time) * 100, 2)}ms.")

f = open("sitemap.xml", "w")
f.truncate(0)
Expand Down
2 changes: 1 addition & 1 deletion index.html

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
minify-html
ruamel.yaml
requests
requests
markdown
26 changes: 13 additions & 13 deletions sitemap.xml
Original file line number Diff line number Diff line change
@@ -1,79 +1,79 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
<url>
<loc>https://quantumbagel.github.io#about</loc>
<lastmod>2024-03-03T19:00:35Z</lastmod>
<lastmod>2024-03-21T20:47:09Z</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://quantumbagel.github.io#experience</loc>
<lastmod>2024-03-03T19:00:35Z</lastmod>
<lastmod>2024-03-21T20:47:09Z</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://quantumbagel.github.io#projects</loc>
<lastmod>2024-03-03T19:00:35Z</lastmod>
<lastmod>2024-03-21T20:47:09Z</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://quantumbagel.github.io#contact</loc>
<lastmod>2024-03-03T19:00:35Z</lastmod>
<lastmod>2024-03-21T20:47:09Z</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://quantumbagel.github.io/pyaerial#about</loc>
<lastmod>2024-03-03T19:00:35Z</lastmod>
<lastmod>2024-03-21T20:47:09Z</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://quantumbagel.github.io/triggered#about</loc>
<lastmod>2024-03-03T19:00:35Z</lastmod>
<lastmod>2024-03-21T20:47:09Z</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://quantumbagel.github.io/piranha#about</loc>
<lastmod>2024-03-03T19:00:35Z</lastmod>
<lastmod>2024-03-21T20:47:09Z</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://quantumbagel.github.io/statify#about</loc>
<lastmod>2024-03-03T19:00:35Z</lastmod>
<lastmod>2024-03-21T20:47:09Z</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://quantumbagel.github.io/cameradistance#about</loc>
<lastmod>2024-03-03T19:00:35Z</lastmod>
<lastmod>2024-03-21T20:47:09Z</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://quantumbagel.github.io/molotov#about</loc>
<lastmod>2024-03-03T19:00:35Z</lastmod>
<lastmod>2024-03-21T20:47:09Z</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://quantumbagel.github.io/finitecraft#about</loc>
<lastmod>2024-03-03T19:00:35Z</lastmod>
<lastmod>2024-03-21T20:47:09Z</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://quantumbagel.github.io/chess-challenge#about</loc>
<lastmod>2024-03-03T19:00:35Z</lastmod>
<lastmod>2024-03-21T20:47:09Z</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://quantumbagel.github.io/airstrik.py#about</loc>
<lastmod>2024-03-03T19:00:35Z</lastmod>
<lastmod>2024-03-21T20:47:09Z</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
Expand Down

0 comments on commit 2216a14

Please sign in to comment.