Skip to main content
Deno 2 is finally here ๐ŸŽ‰๏ธ
Learn more

๐Ÿ‹ FreshPress Made with Fresh

A modern static site generator based on the Fresh framework, designed specifically for personal blogs and portfolios. Built with Deno and Fresh, FreshPress offers high performance, multilingual support, and a modern development experience.

Made with Fresh License: MIT deno module

โœจ Key Features

  • Fresh Framework Integration: Leverages Freshโ€™s benefits with SSG support
  • Multilingual Support: Built-in English and Chinese internationalization
  • Smart Search System: Full-text search across all your content
  • Responsive Design: Perfect adaptation from mobile to desktop
  • Dark Mode Support: Automatic theme switching based on system preferences
  • Markdown Blog Engine: Write content in Markdown with code highlighting
  • Project Showcase: Dedicated area to highlight your projects
  • Island Architecture: Efficient and selective hydration for interactive components
  • Seamless Deployment: Easy deployment to Deno Deploy or static hosting

๐Ÿš€ Getting Started

Prerequisites

  • Deno 1.40.0 or higher

Quick Start

# Install FreshPress CLI
deno install -A -f https://deno.land/x/freshpress/cli.ts

# Create a new project
freshpress create my-website

# Navigate to project directory
cd my-website

# Start development server
deno task dev

Manual Setup

# Clone the repository
git clone https://github.com/username/freshpress.git my-website

# Navigate to project directory
cd my-website

# Start development server
deno task dev

๐Ÿ“ Usage Guide

Project Structure Overview

my-website/
โ”œโ”€โ”€ blog/             # Blog post Markdown files
โ”œโ”€โ”€ components/       # Reusable UI components
โ”œโ”€โ”€ data/             # Site configuration and data
โ”œโ”€โ”€ islands/          # Interactive components
โ”œโ”€โ”€ routes/           # Page routes and layouts
โ”œโ”€โ”€ static/           # Static assets (images, CSS)
โ”œโ”€โ”€ utils/            # Utility functions
โ”œโ”€โ”€ deno.json         # Deno configuration
โ””โ”€โ”€ fresh.config.ts   # Fresh framework config

Creating Content

Blog Posts

Create a Markdown file in the blog/ directory:

---
title: Getting Started with FreshPress
date: 2024-04-10
description: Learn how to use FreshPress to build your personal website
tags: [FreshPress, Deno, Fresh, Tutorial]
locale: en-US  # or zh-CN
---

# Getting Started with FreshPress

This is my first blog post using FreshPress!

## Features I Love

- Fast rendering
- Multilingual support
- Dark mode

Projects

Add your projects to the data/config.ts file:

export const siteConfig = {
  // ... other configuration
  projects: {
    items: [
      {
        title: "Personal Website",
        description: "Built with FreshPress and Deno",
        technologies: ["Deno", "Fresh", "TypeScript"],
        link: "https://github.com/yourusername/website",
        featured: true
      }
    ]
  }
}

Configuration

Site Settings

Configure your website in data/config.ts:

export const siteConfig = {
  site: {
    title: "My Personal Site",
    description: "Developer, writer, and open source enthusiast",
    author: "Your Name",
  },
  // Other configurations...
};

Internationalization

Add translations in utils/i18n.ts:

export const translations = {
  "en-US": {
    nav: {
      home: "Home",
      blog: "Blog",
      projects: "Projects",
    },
    // More translations...
  },
  "zh-CN": {
    nav: {
      home: "้ฆ–้กต",
      blog: "ๅšๅฎข",
      projects: "้กน็›ฎ",
    },
    // More translations...
  }
};

๐ŸŒ Deployment

Static Site Generation

# Build static site
deno task build

# The output will be in the dist/ directory

Deploy to Deno Deploy

  1. Create a new project on Deno Deploy
  2. Connect your GitHub repository
  3. Set the entry point to main.ts
  4. Deploy!

Other Hosting Options

For static hosting (Netlify, Vercel, GitHub Pages):

# Build the static site
deno task build

# Deploy the dist/ directory

๐Ÿ”„ Workflow Example

  1. Setup: Create a new FreshPress project
  2. Configuration: Customize data/config.ts with your details
  3. Content Creation: Add blog posts to the blog/ directory
  4. Customization: Modify styles in static/css/ or via Tailwind
  5. Development: Run deno task dev to see changes locally
  6. Build: Run deno task build to generate static output
  7. Deployment: Upload the dist/ directory to your hosting

๐Ÿ“Š Performance

FreshPress is built for speed and efficiency:

  • Lighthouse Score: 95+ across all categories
  • Page Load: Under 1s for most pages
  • First Contentful Paint: ~300ms
  • Minimal JS: Only loads JavaScript for interactive components

๐Ÿค Contributing

Contributions are welcome! Check out the contribution guidelines.

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.