Skip to content

Commit

Permalink
Fixed sitemap (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
KareemMAX authored Dec 6, 2023
1 parent 661ea20 commit 4bfca06
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/database_generator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import yaml
import json
import os
import logging
Expand All @@ -7,10 +6,11 @@
import math
from dataclasses import dataclass
from typing import Optional
import xml.etree.cElementTree as ET
import xml.etree.ElementTree as ET
import datetime

import git
import yaml

TAGS_PATH = "tags.yaml"
# Index file is used to specify tags for all entries in a directory,
Expand Down Expand Up @@ -263,7 +263,7 @@ def generate_sitemap(database: dict[str, list[str]]):
ET.SubElement(url, "loc").text = entry[SITE_URL_ENTRY_NAME]
ET.SubElement(url, "lastmod").text = datetime.datetime.fromtimestamp(
int(entry[LAST_MOD_ENTRY_NAME])
).isoformat()
).isoformat() + "+00:00"

tree = ET.ElementTree(root)
tree.write("build/sitemap.xml", encoding="utf-8", xml_declaration=True)
Expand Down

0 comments on commit 4bfca06

Please sign in to comment.