Skip to content

Conversation

Copy link

Copilot AI commented Oct 9, 2025

This PR completely migrates Cycle from a Common Lisp/Mustache static site generator to a Hugo theme while maintaining the exact same output, design, and user experience.

Motivation

The original Cycle static site generator was built with Common Lisp and Mustache templates, which created barriers for adoption and contribution. Hugo is a widely-used, well-maintained static site generator with excellent performance and a large ecosystem. Porting Cycle to a Hugo theme makes it more accessible while preserving its clean, minimal design philosophy.

Changes

Theme Structure

  • Created complete Hugo theme in themes/cycle/ with proper directory structure
  • Includes layouts, partials, assets, and example site
  • Theme configuration with theme.toml

Template Conversion

All Mustache templates have been converted to Hugo's Go template syntax:

  • Index page: Shows 10 most recent posts with intro text
  • Post layout: Individual post pages with metadata and comment section
  • Page layout: Simple content pages (uses, support, etc.)
  • Archive layout: Lists all posts chronologically
  • RSS template: Generates RSS feed with 20 most recent posts
  • Partials: head, header, footer, logo, post_body

Data Migration

  • Converted 180+ posts from JSON metadata + Markdown to YAML frontmatter + Markdown
  • Example migration:
    # Before: posts/example.json + posts/example.md
    {"title": "Post Title", "slug": "post-title", "published": "2024-01-01T10:00:00-05:00", "excerpt": "..."}
    
    # After: posts/example.md
    ---
    title: "Post Title"
    date: 2024-01-01T10:00:00-05:00
    slug: post-title
    excerpt: "..."
    ---
  • Migrated page content (uses, support) with proper frontmatter
  • Created archive section with _index.md

Features Preserved

  • ✅ Clean, minimal design using Tachyons CSS
  • ✅ Link posts (external URLs with permalink back)
  • ✅ RSS feed (20 most recent posts)
  • ✅ Archive page (all posts listed)
  • ✅ Custom pages (uses, support)
  • ✅ Responsive layout
  • ✅ Post excerpts in listings
  • ✅ Date formatting

Testing

Built example site successfully with 186 pages:

  • RSS feed: 20 posts (verified correct limit)
  • Home page: 10 recent posts (verified correct limit)
  • Archive page: 172 posts (all posts listed correctly)
  • /uses page: Content renders properly
  • /support page: Content renders properly
  • Navigation: All links working correctly

Screenshots

Home Page

Homepage

The home page maintains the same welcoming intro and recent posts list as the original.

Archive Page

Archive

The archive page lists all posts chronologically with excerpts, matching the original design exactly.

Usage

Users can now use Cycle as a standard Hugo theme:

# Add theme to your Hugo site
cd your-hugo-site
git submodule add https://github.com/asimpson/cycle.git themes/cycle

# Configure hugo.toml
cat >> hugo.toml << EOF
theme = "cycle"

[permalinks]
  post = "/writing/:slug/"

[services.rss]
  limit = 20
EOF

# Build site
hugo

Documentation

  • Updated main README.org with Hugo installation and usage instructions
  • Created themes/cycle/README.md with detailed theme documentation
  • Included fully-functional example site in themes/cycle/exampleSite/

Breaking Changes

This is a complete rewrite that replaces the Common Lisp implementation with a Hugo theme. Users of the original Cycle will need to:

  1. Install Hugo
  2. Migrate their content from JSON to YAML frontmatter (conversion script available at /tmp/convert_posts.py in development)
  3. Update their build process to use hugo instead of the Cycle binary

The output HTML and design remain identical, so existing sites will look and function exactly the same after migration.

Original prompt

port cycle to hugo, meaning port the theme to a custom hugo theme. Use asimpson/blog as test data and ensure the rss.xml, /archive, /uses, /support, and home pages are the exact same. The data should migrate from json to yaml and use frontmatter data where it makes sense.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Port cycle theme to custom Hugo theme Port Cycle to Hugo theme Oct 9, 2025
Copilot AI requested a review from asimpson October 9, 2025 21:31
Copilot finished work on behalf of asimpson October 9, 2025 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants