import os def read_module_content(file_path): with open(file_path, 'r', encoding='utf-8') as file: return file.read() def main(): modules_dir = 'modules' pages_dir = 'pages' output_dir = 'output' os.makedirs(output_dir, exist_ok=True) # Read the header and footer content header_content = read_module_content(os.path.join(modules_dir, 'header.html')) footer_content = read_module_content(os.path.join(modules_dir, 'footer.html')) # Process each page in the pages directory for page in os.listdir(pages_dir): if page.endswith('.html'): with open(os.path.join(pages_dir, page), 'r', encoding='utf-8') as file: page_content = file.read() # Construct the full page content full_content = (f'\n\n
\n' f' \n' f' \n' f' \n' f'