Structure: pages, layout, and navigation¶
In this section, we'll create three pages, design a layout template with header and footer, and build navigation that works across all pages.
Creating pages¶
By default, Silex creates an index page (the homepage). Let's add two more.
In the Pages panel (left sidebar):
- Click the + button to add a new page
- Name it
about - Click + again and name the second new page
contact
You now have three pages: index, about, and contact.
(Silex automatically creates index.html, about.html, and contact.html when you publish.)
Building the layout template¶
All three pages will have the same header and footer. We'll build this once using Symbols so changes sync across all pages.
Start with the index page (make sure you're on it). The general structure is:
Step 1: Add the main page structure¶
- On the canvas, click to select the root page element (the background)
- In the Blocks panel, add a Div — this will be our main page container
- Set this Div to Display: Flex, Flex-direction: Column (stacks sections vertically)
- Set Width to
100%and add a Max-width (e.g.,1200px) and margin:autoto center it (see Flexbox for details)
Step 2: Create the header¶
Inside the main container:
- Add a Div — this will be the header
- Label it "header" by adding a class (in the Element settings (gear icon), add class
agency-header) - Inside the header, add two elements side by side:
- Image — the logo (for now, use a placeholder or find an agency logo image)
-
Nav element — for the navigation links
-
Style the header:
- Display: Flex
- Justify-content: space-between (logo left, nav right)
- Align-items: center
- Add Padding (e.g.,
20px) - Add a Bottom border or Background color for visual separation
Step 3: Build the navigation¶
Inside the Nav element:
- Add a Div — call it
agency-nav-links - Set it to Display: Flex
- Add three Links (the
<a>tag) inside, one for each page: - Link text: "Home", Href:
./index.html(relative path) - Link text: "About", Href:
./about.html -
Link text: "Contact", Href:
./contact.html -
Add Column-gap to the nav-links Div (e.g.,
24px) to space the links - Style the links: set Font-size, Font-weight, Color. Optionally add padding or margin
Step 4: Create the main content area¶
After the header, inside the page container:
- Add a Div with class
agency-content(oragency-main) - This is where page-specific content goes (hero section, cards, forms, etc.)
- Set it to Flex-grow: 1 so it expands to fill available space
- Add Padding (e.g.,
60px 20px) for breathing room
Step 5: Create the footer¶
After the main content:
- Add a Div with class
agency-footer - Inside, add a Paragraph (for copyright text) or multiple elements for footer links
- Style the footer:
- Top border or background color for separation
- Add Padding
- Set a smaller Font-size (e.g.,
14px) - Center text with Text-align: center
Converting header and footer to Symbols¶
Now we'll convert the header and footer to Symbols so they sync across all pages.
Make the header a Symbol¶
- Select the header Div (with class
agency-header) - Right-click → Create Symbol (or use the Symbols panel)
- Name it
Header - A dialog appears asking to confirm. Click OK
The header is now a Symbol. Any change you make to it updates on all three pages automatically.
Make the footer a Symbol¶
- Select the footer Div
- Right-click → Create Symbol
- Name it
Footer
Now both are Symbols. You can edit them from any page and changes apply everywhere.
Copy the layout to other pages¶
The index page is now complete with the template. Let's copy this layout to the about and contact pages.
Option A: Fastest way — Duplicate and customize
- On the
indexpage, select all content (Ctrl+A or Cmd+A) - Copy it (Ctrl+C or Cmd+C)
- Switch to the
aboutpage - Paste (Ctrl+V or Cmd+V)
- Delete the main content area placeholder and add your own
- Repeat for
contact
The Symbols (header and footer) will sync automatically across all pages.
Option B: Slower but explicit — Rebuild
- Switch to
about - Recreate the page structure manually
- Add the main page container with flexbox
- From the Symbols panel, drag the Header Symbol onto the page
- Drag the Footer Symbol to the bottom
- Add the main content area between them
Setting the homepage¶
The homepage must be named index. Silex does this automatically, so you're already set.
When you publish, index.html is your homepage and is served at the root of your domain (e.g., mysite.com/ loads index.html).
Testing internal links¶
Before moving on, test that internal navigation works:
- In the editor, click one of the navigation links
- In the Element settings (gear icon), verify the
hrefstarts with./(relative path) - Publish the site to GitLab Pages (see Publish or Publish to GitLab)
- On the live site, click a link. You should navigate to that page
If links don't work, double-check:
- Href uses relative paths (
./about.html, not/about.htmlor absolute URLs) - You're clicking Links, not plain text
- The page names match exactly (case-sensitive:
about.htmlnotAbout.html)
Next steps¶
Your three pages are now connected with consistent header and footer. Head to Styling to build a design system with CSS variables and consistent spacing.
Related pages¶
- Pages — creating and managing pages
- Flexbox — layout with flex
- Symbols — synced reusable components
- The editor — editor interface overview