Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,16 @@ def about():
return render_template("about.html", data=about_data, current_page="about")


@app.route("/gallery")
def gallery():
"""Gallery page"""
gallery_images = get_gallery_images()
return render_template(
"gallery.html", gallery_images=gallery_images, current_page="gallery"
)



@app.errorhandler(404)
def not_found(error):
return render_template("404.html"), 404
Expand Down Expand Up @@ -318,4 +328,4 @@ def get_image_filter(image_name, image_type="blog"):
os.makedirs("static/images", exist_ok=True)
os.makedirs("static/images/gallery", exist_ok=True)

app.run(debug=True, host="0.0.0.0", port=3000)
app.run(debug=True, host="0.0.0.0", port=3008)
13 changes: 11 additions & 2 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ def build_sitemap(self):
{"url": "/event/", "priority": "0.8"},
{"url": "/about/", "priority": "0.6"},
{"url": "/organizer/", "priority": "0.6"},
{"url": "/gallery/", "priority": "0.6"},
]

# Add blog posts
Expand Down Expand Up @@ -398,8 +399,16 @@ def build_all(self, custom_domain=None):
self.build_event_pages()
self.build_other_pages()
self.build_error_pages()

# Generate additional files
self.build_gallery_page()

def build_gallery_page(self):
"""Build gallery page"""
with self.app.app_context():
with self.app.test_request_context():
gallery_images = self.get_gallery_images()
current_url = f"{self.app.jinja_env.globals['base_url']}/gallery/"
html = render_template("gallery.html", gallery_images=gallery_images, current_url=current_url, current_page="gallery")
self.save_page(html, "gallery/index.html")
print("\n🔧 Generating additional files...")
self.create_nojekyll_file()
self.build_sitemap()
Expand Down
10 changes: 5 additions & 5 deletions dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ dev_server() {
print_warning "Server will run on http://localhost:3000"
export FLASK_ENV=development
export FLASK_DEBUG=1
python3 app.py
uv run python3 app.py
}

# Function to build static site
Expand All @@ -112,7 +112,7 @@ build_static() {
build_css

# Build static site
python3 build.py $1
uv run python3 build.py $1

print_success "Static site built successfully in 'dist' directory"
}
Expand All @@ -126,10 +126,10 @@ serve_static() {
build_static
fi

print_status "Starting local server on http://localhost:8080"
print_status "Starting local server on http://localhost:8888"
print_warning "Press Ctrl+C to stop the server"

cd dist && python3 -m http.server 8080
cd dist && uv run python3 -m http.server 8888 --bind 0.0.0.0
}

# Function to clean build artifacts
Expand All @@ -139,7 +139,7 @@ clean() {
# Remove dist directory
if [ -d "dist" ]; then
rm -rf dist
print_status "Removed dist directory"
print_status "Removed dist directory"
fi

# Remove CSS build artifacts
Expand Down
Loading