A multipage static site template using semantic HTML5 and responsive CSS3 layouts.
- Semantic HTML5 structure
- Responsive CSS3 design
- What you had last week
- Basic static HTML5 and CSS3 files
To see it in action use "Go Live" & open index.html in a web browser.
- Improved layout and styling
- Enhanced styling with CSS3 Flexbox and Grid
- Improved accessibility features with switches for dark mode
- Hero area
- Article sections with images and captions
To see it in action use "Go Live" & open v2/ in a web browser.
You should be able to combine the features from v2 with your code from last week.
- What is wrong with the About page? Fix it.
- What would be a better fix?
- Optional advanced version using Jinja2 templating and Python build script
- Static site generation using Jinja2 templates
- Automated build process with Python script
- Modular template structure for easy maintenance
- Output static files in build directory
-
Ensure you have Python and Jinja2 installed.
-
Run the build script to generate the static site:
python build-v3.py
-
The generated static files will be available in the
builddirectory.
This repository includes a GitHub Actions workflow at .github/workflows/deploy-pages.yml that can deploy one of three site variants:
v1(root directory)v2(thev2/directory)v3(build output fromv3-src/usingbuild-v3.py)
Follow these steps to enable deployment via GitHub Actions and choose which variant to publish.
-
In the repository, go to Settings → Pages.
- Under Source, change from "Deploy from a branch" to "GitHub Actions".
- By default, the workflow deploys the root directory (v1).
-
(Optional) Set the deployment variant using a Repository Variable:
- To deploy a different variant, go to Settings → Secrets and variables → Actions → Variables.
- Click "New repository variable" and add:
- Name:
SITE_TYPE - Value:
v2to deploy thev2/site, orv3to build and deploy fromv3-src/. - Leave blank or set to
v1for the default root directory deployment.
- Name:
-
Trigger a deployment:
- Push to the
mainbranch, or - Run the workflow manually from the Actions tab ("Deploy site to GitHub Pages").
- Push to the
How it works:
- When
SITE_TYPEisv3, the workflow sets up Python, installs Jinja2, runspython build-v3.py, and uploads thebuild/directory. - When
SITE_TYPEisv2, the workflow uploads thev2/directory. - When
SITE_TYPEisv1or blank (default), the workflow uploads the repository root (./).
After a successful run, the site will be available at the Pages URL shown in Settings → Pages and in the workflow run summary.
- Choose your own order to implement these features!
- add make sure you are doing them in the correct folder (the base folder
or v3-src)
Create a new HTML page (e.g., services.html) in the appropriate directory.
Embed a responsive YouTube video in your webpage.
- HTML Structure
- Use a
<figure>element to contain the video and caption - Inside the
<figure>, add a<div>with a class (e.g.,video-container) to hold the iframe - Add an
<iframe>element with the YouTube embed URL which you can get from the "Share" -> "Embed" option on YouTube - Set the
widthandheightattributes to100%for responsiveness - Add a
<figcaption>for the video description
- Use a
Great for flowcharts, sequence diagrams, and more.
Add the Mermaid.js library to your HTML file by including the following script tag in the <head> section:
<script src="https://unpkg.com/mermaid/dist/mermaid.min.js"></script>Then add the diagram where you like in the main content area:it will work best in the art
<figure>
<div class="mermaid">
graph TD;
A-->B;
B-->C;
</div>
<figcaption>Simple Mermaid Diagram</figcaption>
</figure>You can use any Mermaid syntax to create different types of diagrams. Visit https://mermaid.js.org/ and use the Free version to design your diagrams.
Embed an OpenStreetMap map into your webpage.
-
Search for a place you want
-
Click on HTML and copy the iframe code and paste it into your HTML document
Create a hero section with a full-width background image and centered text overlay.
You already have a hero section in `index.html` with the class `hero`.
1. Pick a high-quality image and add it to the `assets/images/` directory.
2. In your CSS file, set the `.hero` class to use the image as a background:
- Use `background-image: url('path/to/your/image.jpg');`
- Set `background-size: cover;` and `background-position: center;`
- Set a fixed height for the hero section (e.g., `height: 400px;`)
3. Center the text overlay using flexbox:
- `display: flex; justify-content: center; align-items:
Add a hamburger menu button that shows/hides a navigation menu on smaller screens.
-
HTML Structure
- Add a
<button>element with idmenu-buttonin your header - Add an id
nav-menuto your existing<nav>element - Use the
aria-labelandaria-expandedattributes for accessibility
- Add a
-
CSS Styling
- Hide the button by default with
display: none - Use a media query
@media (max-width: 768px)to show it on mobile - Position the menu absolutely when it appears on mobile
- Add a
.activeCSS class that shows/hides the menu (usemax-heightordisplayto toggle visibility) - Add a smooth
transitionfor the menu opening/closing animation
- Hide the button by default with
-
JavaScript Event Listeners
- Listen for clicks on the menu button and toggle the
.activeclass on the nav menu - Update the
aria-expandedattribute when the menu opens/closes - Add a click listener to all nav links so the menu closes when a user navigates
- Bonus: Close the menu if the user clicks outside of it (use
event.targetand.contains())
- Listen for clicks on the menu button and toggle the
-
Testing
- Test on desktop (button should be hidden)
- Test on mobile/tablet (button should appear)
- Test that clicking the button toggles the menu
- Test that clicking a nav link closes the menu
- Use
document.getElementById()anddocument.querySelectorAll()to select elements - Use
classList.toggle()andclassList.remove()to manage the.activeclass - Use
addEventListener('click', ...)to handle user interactions
A widget is html/css/javascript that you can drop into you page fairly easily to do a task or add information.
I comes with other peoples images and styles so be careful to check it works well with your own design.
Embed a simple weather widget using a third-party service like WeatherWidget.io.
- https://www.forecast.co.uk/widget/
- https://weatherwidget.io/
- https://www.theweather.com/widget/
- https://meteo.uk/widget/
- https://www.geeksforgeeks.org/html/decorating-your-website-for-christmas-and-new-year-html-css-code-snippets/
- https://www.perssondennis.com/articles/33-christmas-animations-to-easily-add-to-your-website
Application Programming Interfaces (APIs) allow you to fetch data from other services and display it on your own site.
They usually require some JavaScript to make the request and handle the response. And often require you to sign up for an API key.
Fetch weather data from a public API (like OpenWeatherMap) and display it on your webpage.
- https://www.geeksforgeeks.org/javascript/weather-app-using-vanilla-javascript/
- https://medium.com/@ravipatel.it/a-comprehensive-guide-to-fetching-weather-data-using-javascript-fetch-api-13133d0bc2e6
- https://javascript.plainenglish.io/build-a-real-time-weather-app-with-javascript-and-openweathermap-api-bcf8111df1fe




