INNER CODE UNIT · Python
full_path
netkiller/netkiller.github.io · generate_sitemaps.py:18
full_path = Path(root) / file
rel_path = full_path.relative_to(OUTPUT_DIR)
html_files.append(rel_path)
return sorted(html_files)
def get_lastmod(filepath):
"""Get last modification date of a file."""
mtime = os.path.getmtime(filepath)
return datetime.fromtimestamp(mtime).strftime('%Y-%m-%d')
def url_encode_path(path):
"""URL encode a file path."""
parts = str(path).split('/')
encoded_parts = [quote(part, safe='') for part in parts]
return '/'.join(encoded_parts)
def extract_title(filepath):
"""Extract title from HTML file."""