A dynamic content-driven web project featuring customizable hero sections, two-column layouts, image and text rows, carousels, and more. The project uses a YAML-based configuration to define page elements, enabling rapid updates and modular content management.
This project allows you to build modern, responsive web pages using predefined content blocks defined in YAML. Each block represents a UI component, such as a hero section, text block, image row, carousel, or jumbo section. By editing the YAML, you can easily update page content without touching the HTML.
-
Types:
centered_hero,centered_screenshot,text_left_img_right,border_crop_img -
Customizable fields:
image,width,height,title,text,primaryandsecondarybuttons with IDs
-
Flexible content and image placement (left or right)
-
Supports text and images with optional spacing
-
Types:
basicorfull_width -
Large text sections for highlighting important content
-
Text Row: Display multiple items in a row
-
Image Row: Display multiple images in a row
-
Supports multiple images
-
Configurable width and height
- Scroll to a specific element using IDs
- Global spacing control for sections
-
Clone the repository:
git clone https://github.com/ttiramisu/sharky.git cd sharky -
Install dependencies
pip install -r requirements.txt
-
Run the development server
python3 dev.py
-
Open
localhost:6767in your browser to view your project. -
To build the project for hosting
python3 main.py
sharky/
│
├─ assets/
│ └─ icon.jpg
│
├─ CONTENTS/
│ └─ CONFIG.yaml
│ └─ CONTENTS.yaml
│ └─ NAVIGATION.yaml
│
├─ dist/
│ └─ src/
│ └─ index.html
│
├─ utils/
│ └─ components/ # defines all components
│ └─ helper/ # defines all helper components
│ └─ contents.py # generates the contents in the final file
│ └─ maker.py # defines and generates the html frame
│ └─ structure.py # generates the navbar and footer of the final file
│
├─ dev.py
├─ main.py
├─ requirements.txt
└─ README.md
-
Open
CONTENTS/CONTENTS.yamland define your sections. -
Supported content blocks:
| Block Type | Description |
|---|---|
hero |
Highlighted section with optional buttons |
two-col |
Two-column layout with text and images |
text_row |
Row of text items |
img_row |
Row of images |
carousel |
Scrollable image carousel |
jumbo |
Large text sections |
spacing |
Custom spacing between sections |
scroll_to |
ID for scroll navigation |
- Open
CONTENTS/CONFIG.yamland define your global website settings. - Required Fields:
| Field | Description |
|---|---|
language |
Website language (ISO code) |
website-name |
The name of your website |
website-icon |
Path to the site icon |
description |
Meta description for SEO |
custom_css |
Optional path to a CSS file for custom styling |
Eample:
language: en
website-name: Lorem Ipsium
website-icon: src/assets/icon.jpg
description: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
custom_css: src/css/style.css- Open
CONTENTS/NAVIGATION.yamland define your website’s navigation menu, including nested items and IDs for links. - Required Fields:
| Field | Description |
|---|---|
nav_title |
Title or brand of the navigation bar |
logo |
Path to the logo image |
nav |
List of navigation items and their structure |
ids |
Corresponding IDs for each navigation item (used for scrolling or linking) |
Example:
nav_title: nav example
logo: src/assets/icon.jpg
nav:
- items:
- nav1:
- sub1
- sub2
- sub3
- nav2
- nav3
- nav4
- ids:
- nav1:
- sub1
- sub2
- sub3
- nav2
- susan
- sheliaNotes:
- Menu labels in nav must have matching entries in ids for proper scrolling or linking functionality.
- Submenus allow multi-level navigation. Example: nav1 → sub1, sub2, sub3.
- Top-level items like nav2, nav3, nav4 can directly link to IDs or sections on the page.
To ensure each block renders properly, the following fields must be in your YAML:
type→centered_hero,centered_screenshot,text_left_img_right, orborder_crop_imgimg→ Path to the imageimg_width→ Width of the image in pixelsimg_height→ Height of the image in pixelstitle→ Heading texttext→ Main paragraph or description
btn_primary→ Label for primary buttonbtn_secondary→ Label for secondary buttonbtn_primary_id→ ID for primary button (used for scroll or JS actions)btn_secondary_id→ ID for secondary button
Example:
- hero:
- type: centered_hero
- img: src/assets/icon.jpg
- img_width: 57
- img_height: 500
- title: Lorem Ipsium
- text: |
lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
- btn_primary: Primary Button
- btn_secondary:
- btn_primary_id: lorem-right
- btn_secondary_id: title→ Heading texttext→ Description or paragraphimg→ Path to imageimg_position→ left or right
class→ CSS class for styling
Example:
- two-col:
- class: ''
- title: lorem ipsum
- text: |
lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
- img : src/assets/icon.jpg
- img_position : lefttype→ basic or full_widthtitle→ Heading texttext→ Paragraph text
Example:
- jumbo:
- type: full_width
- title: lorem ipsum
- text: |
lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.items→ List of text items
class→ CSS class for styling
Example:
- text_row:
- class: 'johnny'
- items:
- john
- peter
- susanitems→ List of image paths
class→ CSS class for styling
Example:
- img_row:
- class: ''
- items:
- src/assets/icon.jpg
- src/assets/icon.jpg
- src/assets/icon.jpgcontent→ List of image pathswidth→ Carousel width in pixelsheight→ Carousel height in pixels
Example:
- carousel:
- content:
- src/assets/icon.jpg
- src/assets/icon.jpg
- src/assets/icon.jpg
- width: 500
- height: 100spacing→ Represents spacing between sections in pixels
Example:
- spacing: 50scroll_to→ ID of the element you want to scroll to (must match a btn_primary_id, btn_secondary_id or a ids in NAVIGATION.yaml)
Example:
- scroll_to: lorem-right-
Update hero images, titles, and buttons directly in YAML.
-
Modify the number of items in text or image rows.
-
Adjust carousel width, height, and images.
-
Set global spacing between sections for visual layout consistency.
MIT License. See LICENSE file for details.