A simple website to display the information from the following wikipedia articles:
- https://en.wikipedia.org/wiki/List_of_countries_by_body_mass_index
- https://en.wikipedia.org/wiki/National_dish
- Backend: Go
- Frontend: Standard Library
html/template, JavaScript - Data: CSV-based storage
- Environment:
godotenvfor configuration
- Go 1.16 or higher
- A
.envfile in the root directory - A
countries.csvfile in the root directory
-
Environment Configuration
Create a.envfile in the root directory and define your image source (CDN or local path):IMG_SOURCE=https://your-image-bucket.com -
Data Format
Ensure yourcountries.csvfollows this column structure:- 0: Country Name
- 1: BMI Value (Float)
- 4: National Dish Name
- 5: Wikipedia Link
- 6: Image Filename
- 7: Image Aspect Ratio (Float)
- 8: Order (2 Columns)
- 9: Order (3 Columns)
- 10: Order (4 Columns)
-
Run the Application
go run main.go
or
air
The server will start on
http://localhost:8083.
main.go: Handles CSV parsing, template rendering, and API logic for content updates.static/:base.html: The core HTML boilerplate.home.html: The main view containing the JavaScript observers and UI components.content.html: The partial template used for rendering the gallery grid.style.css: styling