A modern, responsive Hugo theme designed for news and media websites. Built with Tailwind CSS and Alpine.js.
- 🎨 Modern design with Tailwind CSS
- 🔍 Built-in search functionality
- 📱 Fully responsive
- 🏷️ Support for categories, tags, and authors
- 🖼️ Featured articles with large images
- 🔄 Dynamic category browsing
- 👥 Author profiles
- 🔍 Search functionality with Fuse.js
- ⚡ Fast loading with minimal JavaScript
- 🎨 Clean typography and spacing
- 📊 Google Analytics 4 integration
- In your Hugo site directory, run:
git submodule add https://github.com/professionalaf/hugo-news themes/hugo-news- Update your
hugo.tomlconfiguration:
theme = "hugo-news"The theme includes built-in support for Google Analytics 4 (GA4). To enable tracking:
- Get your GA4 Measurement ID from your Google Analytics account (format: G-XXXXXXXXXX)
- Add it to your site's config file:
googleAnalytics = "G-XXXXXXXXXX" # Replace with your GA4 measurement IDThe analytics code will:
- Only load when a valid measurement ID is provided
- Respect user privacy settings and cookie consent
- Load asynchronously to not impact page performance
- Track page views and basic user interactions
If you don't want analytics, simply leave the googleAnalytics parameter commented out:
# googleAnalytics = "G-MEASUREMENT_ID"Example hugo.toml configuration:
baseURL = 'https://example.org/'
languageCode = 'en-US'
title = 'My Hugo News Site'
[taxonomies]
category = "categories"
tag = "tags"
author = "authors"
[outputs]
home = ["HTML", "RSS", "JSON"]
[[menus.main]]
name = "Home"
url = "/"
weight = 10
[[menus.main]]
name = "Categories"
url = "/categories"
weight = 20
[[menus.main]]
name = "Tags"
url = "/tags"
weight = 30content/
├── _index.md
├── articles/
│ ├── first-post.md
│ └── second-post.md
├── authors/
│ ├── _index.md
│ └── john-doe/
│ ├── _index.md
│ └── avatar.jpg
└── categories/
└── _index.md
---
title: "Article Title"
date: 2024-01-01
author: "Author Name"
categories: ["Category1", "Category2"]
tags: ["tag1", "tag2"]
featured_image: "path/to/image.jpg"
description: "Article description"
------
title: "Author Name"
bio: "Author biography"
avatar: "author-image.jpg"
social:
twitter: "twitterhandle"
linkedin: "linkedinprofile"
---The theme includes two types of comment systems:
Static comments are stored alongside the article content in a comments.json file. They are visible to all users and persist across sessions. To add static comments:
- Create a
comments.jsonfile in your article's directory (next to your article's markdown file) - Use this structure:
{
"comments": [
{
"name": "Author Name",
"content": "Comment text",
"date": "2024-01-11T15:30:00Z",
"isStatic": true
}
]
}Example directory structure:
content/
└── articles/
└── my-article/
├── index.md
├── featured-image.jpg
└── comments.json
Dynamic comments are stored in the user's browser localStorage. These comments:
- Only visible to the user who created them
- Persist across page refreshes but only in the same browser
- Are not shared with other users
- Will be cleared if the user clears their browser data
Dynamic comments are automatically handled by the theme's JavaScript and don't require any setup.
Requirements:
- Hugo Extended Version (>= 0.116.0)
- Node.js (for Tailwind CSS development)
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Released under the MIT License.
- Built with Tailwind CSS
- Interactive components powered by Alpine.js
- Search functionality using Fuse.js