Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Haaretz-Inspired News Website Template

A lightweight Flask template for building a news-style website from Markdown articles.

This project is designed for quick publishing workflows:

  • Write article content in Markdown
  • Add metadata in YAML front matter
  • Render everything into a styled, article-first website

It includes example articles so you can clone, run, and start customizing immediately.

Features

  • Flask-based server with simple routing
  • Markdown article rendering
  • YAML front matter parsing for metadata
  • Homepage feed with featured and sidebar sections
  • Category filtering page
  • Individual article page
  • RTL-ready layout and Hebrew sample content

Tech Stack

  • Python
  • Flask
  • python-frontmatter
  • Markdown (python-markdown)
  • HTML + CSS templates (Jinja2)

Project Structure

.
|-- app.py
|-- articles/
|   |-- food-review.md
|   |-- lebanon-blunder.md
|   |-- rabin-obituary.md
|   `-- trump-iran.md
|-- static/
|   |-- css/
|   |   `-- style.css
|   `-- images/
`-- templates/
    |-- article.html
    `-- index.html

Quick Start

1) Clone the repository

git clone https://github.com/<your-username>/haaretz_project.git
cd haaretz_project

2) Create and activate a virtual environment

Windows (PowerShell):

python -m venv .venv
.\.venv\Scripts\Activate.ps1

macOS / Linux:

python3 -m venv .venv
source .venv/bin/activate

3) Install dependencies

pip install flask python-frontmatter markdown

4) Run the app

python app.py

Open:

http://127.0.0.1:5000

How Articles Work

Each article is a Markdown file in the articles/ folder.

Article metadata is defined in YAML front matter.

Required metadata fields

  • title
  • author
  • category
  • date

Optional metadata fields

  • main_image
  • main_caption

Example article file

---
title: "My Headline"
author: "Your Name"
category: "News"
date: "2026-04-17"
main_image: "https://example.com/image.jpg"
main_caption: "Photo description"
---

This is the article body in Markdown.

You can use **bold**, lists, links, and other Markdown features.

Routes

  • / - Homepage with all articles
  • /category/<name> - Category view
  • /article/<slug> - Full article page

The slug is derived from the filename. Example: articles/food-review.md -> /article/food-review

Included Sample Articles

Notes

  • Keep date format consistent for reliable sorting (recommended: YYYY-MM-DD).
  • Categories are read directly from front matter.
  • Templates are in templates/, and styling is in static/css/style.css.

Customize for Your News Brand

  • Replace the sample Markdown files with your own content
  • Adjust colors, typography, and layout in CSS
  • Update navigation category links in templates
  • Add favicon, logo assets, and analytics as needed

License

This project is licensed under the MIT License.

See LICENSE for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages