Enable dynamic ordering of sections

This commit is contained in:
Yan Lin 2025-07-09 14:10:52 +02:00
parent ddadc8685e
commit 51d12d7ab1
9 changed files with 100 additions and 62 deletions

View file

@ -26,9 +26,22 @@ if __name__ == '__main__':
print(f'Generated {output_path}')
# Always generate the main index page
render_template('index.html', 'dist/index.html', data=profile_data, is_home_page=True)
render_template('publications.html', 'dist/publications/index.html', data=profile_data, is_home_page=False)
render_template('projects.html', 'dist/projects/index.html', data=profile_data, is_home_page=False)
render_template('presentations.html', 'dist/presentations/index.html', data=profile_data, is_home_page=False)
render_template('teaching.html', 'dist/teaching/index.html', data=profile_data, is_home_page=False)
# Generate individual section pages only if they're in the sections list
sections = profile_data.get('sections', [])
if 'publications' in sections:
render_template('publications.html', 'dist/publications/index.html', data=profile_data, is_home_page=False)
if 'projects' in sections:
render_template('projects.html', 'dist/projects/index.html', data=profile_data, is_home_page=False)
if 'presentations' in sections:
render_template('presentations.html', 'dist/presentations/index.html', data=profile_data, is_home_page=False)
if 'teaching' in sections:
render_template('teaching.html', 'dist/teaching/index.html', data=profile_data, is_home_page=False)
print('Static site generation complete!')