Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added content/docs-blog/images/theme-cards-article.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/docs-blog/images/theme-cards-home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
115 changes: 115 additions & 0 deletions content/docs-blog/module.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# Blog Generator

<details>
slug: docs/blog
published: 03/15/2026
author: Gopher Guides
seo_description: Hype documentation — Blog Generator. Learn how to use this feature in the Hype dynamic Markdown engine.
tags: docs, blog, hype
</details>


Create beautiful static blogs with hype's signature code execution feature. Write articles in markdown, include runnable code examples, and deploy to GitHub Pages with a single workflow.

**Live Demo:** [gopherguides.github.io/hype-blog-sample](https://gopherguides.github.io/hype-blog-sample)

## Quick Start

```bash
# Install hype
go install github.com/gopherguides/hype/cmd/hype@latest

# Create a new blog
hype blog init mysite
cd mysite

# Create your first article
hype blog new hello-world

# Build and preview
hype blog build
hype blog serve
```

Your site is now live at `http://localhost:3000`.

## Features

- **Code Execution** - Run code blocks and include real output (hype's signature feature)
- **3 Built-in Themes** - suspended (minimal), developer (terminal-style), cards (grid layout)
- **Hugo-style Templates** - Layered template system with easy customization
- **Live Reload** - `--watch` flag for automatic rebuilds during development
- **SEO Ready** - Meta tags, Open Graph, Twitter cards, sitemap, RSS feed
- **GitHub Pages** - Deploy automatically with the included workflow

## Commands

| Command | Description |
|---------|-------------|
| `hype blog init <name>` | Create a new blog project |
| `hype blog new <slug>` | Create a new article |
| `hype blog build` | Build the static site |
| `hype blog serve` | Start local preview server |
| `hype blog serve --watch` | Preview with live reload |
| `hype blog theme list` | List available themes |
| `hype blog theme add <name>` | Add a theme to your project |

## Themes

### Suspended (Default)

Minimal, typography-focused theme perfect for technical writing.

![Suspended Theme](images/theme-suspended-home.png)

### Developer

Dark, terminal-inspired theme for code-heavy blogs.

![Developer Theme](images/theme-developer-home.png)

### Cards

Modern card-based layout with visual hierarchy.

![Cards Theme](images/theme-cards-home.png)

Switch themes by updating `config.yaml`:

```yaml
theme: "developer"
```

## Deploy to GitHub Pages

Add this workflow to `.github/workflows/deploy.yaml`:

&lt;code src="src/deploy.yaml">&lt;/code&gt;

Then enable GitHub Pages in your repo settings (Settings > Pages > Source: GitHub Actions).

## Project Structure

&lt;code src="src/structure.txt">&lt;/code&gt;

## Article Format

Articles use a `<details>` block for metadata:

```markdown
# My Article Title

<details>
slug: my-article
published: 01/25/2026
author: Your Name
seo_description: Brief description for SEO
tags: go, tutorial
</details>

Your content here...
```

## Full Documentation

For complete documentation including theme customization, template overrides, and advanced features, see [docs/blog/README.md](README.md).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Point Full Documentation link to an existing page

The Full Documentation link targets README.md, but there is no content/docs-blog/README.md (or corresponding routed page), so users on /docs/blog/ will hit a 404 when they click it. Since this section is presented as the next step for advanced usage, it should link to a valid on-site URL (or a concrete GitHub URL) instead of a missing relative file.

Useful? React with 👍 / 👎.

257 changes: 257 additions & 0 deletions content/docs-cli-reference/module.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
# CLI Reference

<details>
slug: docs/cli-reference
published: 03/15/2026
author: Gopher Guides
seo_description: Hype documentation — CLI Reference. Learn how to use this feature in the Hype dynamic Markdown engine.
tags: docs, cli-reference, hype
</details>


Hype provides several commands for working with dynamic markdown documents.

## Commands Overview

| Command | Description |
|---------|-------------|
| `export` | Export documents to different formats (markdown, HTML) |
| `preview` | Start a live preview server with auto-reload |
| `marked` | Integration with Marked 2 app |
| `slides` | Web-based presentation server |
| `blog` | Static blog generator |

---

## export

Export hype documents to markdown or HTML.

```bash
hype export [options]
```

### Options

| Flag | Default | Description |
|------|---------|-------------|
| `-f` | `hype.md` | Input file to process |
| `-format` | `markdown` | Output format: `markdown` or `html` |
| `-o` | stdout | Output file path |
| `-theme` | `github` | Theme for HTML export |
| `-css` | | Path to custom CSS file |
| `-no-css` | `false` | Output raw HTML without styling |
| `-themes` | | List available themes and exit |
| `-timeout` | `30s` | Execution timeout |
| `-v` | `false` | Verbose output |

### Examples

```bash
# Export to markdown (default)
hype export -f hype.md > README.md

# Export to HTML
hype export -f docs.md -format html > docs.html

# Export with a theme
hype export -f docs.md -format html -theme solarized-dark

# Export with custom CSS
hype export -f docs.md -format html -css ./styles.css

# Export raw HTML (no styling)
hype export -f docs.md -format html -no-css

# List available themes
hype export -themes

# Output directly to file
hype export -f hype.md -format markdown -o README.md
```

---

## preview

Start a live preview server with file watching and auto-reload.

```bash
hype preview [options]
```

### Options

| Flag | Alias | Default | Description |
|------|-------|---------|-------------|
| `-f` | | `hype.md` | Source file to preview |
| `-port` | | `3000` | Server port |
| `-w` | `-watch` | | Additional directories to watch (repeatable) |
| `-e` | `-ext` | | File extensions to watch (comma-separated) |
| `-i` | `-include` | | Glob patterns to include (repeatable) |
| `-x` | `-exclude` | | Glob patterns to exclude (repeatable) |
| `-d` | `-debounce` | `300ms` | Debounce delay before rebuild |
| `-v` | `-verbose` | `false` | Verbose output |
| `-open` | | `false` | Auto-open browser on start |
| `-theme` | | `github` | Preview theme |
| `-css` | | | Custom CSS file path |
| `-themes` | | | List available themes |
| `-timeout` | | `0` | Execution timeout |

### Examples

```bash
# Basic preview
hype preview -f hype.md

# Open browser automatically
hype preview -f hype.md -open

# Watch additional directories
hype preview -f hype.md -w ./src -w ./images

# Filter by extension
hype preview -f hype.md -e md,go,html

# Use a dark theme
hype preview -f hype.md -theme solarized-dark
```

---

## marked

Integration with [Marked 2](https://marked2app.com/) for macOS.

```bash
hype marked [options]
```

### Options

| Flag | Default | Description |
|------|---------|-------------|
| `-f` | | Input file (uses `MARKED_PATH` if not set) |
| `-p` | `false` | Parse only (no execution) |
| `-timeout` | `5s` | Execution timeout |
| `-context` | | Context folder path |
| `-section` | `0` | Target section number |
| `-v` | `false` | Verbose output |

### Environment Variables

- `MARKED_PATH` - Set by Marked 2 to the current file path
- `MARKED_ORIGIN` - Set by Marked 2 to the file's directory

---

## slides

Web-based presentation server.

```bash
hype slides [options] [file]
```

### Options

| Flag | Default | Description |
|------|---------|-------------|
| `-port` | `3000` | Server port |

### Examples

```bash
# Start slides server
hype slides presentation.md

# Use a different port
hype slides -port 8080 presentation.md
```

---

## blog

Static blog generator with theming support.

```bash
hype blog <command> [options]
```

### Subcommands

| Command | Description |
|---------|-------------|
| `init <name>` | Create a new blog project |
| `build` | Build static site to `public/` |
| `serve` | Start local preview server |
| `new <slug>` | Create a new article |
| `theme` | Manage themes (add, list, remove) |

### Options

| Flag | Default | Description |
|------|---------|-------------|
| `-timeout` | `30s` | Execution timeout |
| `-v` | `false` | Verbose output |

### Examples

```bash
# Create a new blog
hype blog init mysite

# Create with a theme
hype blog init mysite --theme developer

# Build the site
hype blog build

# Start preview server
hype blog serve

# Create a new article
hype blog new hello-world

# List available themes
hype blog theme list

# Add a theme
hype blog theme add suspended
```

---

## Common Options

These options are available across most commands:

| Flag | Description |
|------|-------------|
| `-f` | Input file path |
| `-timeout` | Execution timeout for code blocks |
| `-v` | Enable verbose/debug output |

---

## Exit Codes

| Code | Meaning |
|------|---------|
| `0` | Success |
| `1` | General error |

---

## Getting Help

```bash
# Show available commands
hype

# Show help for a specific command
hype export --help
hype preview --help
hype blog --help
```
Loading
Loading