Hugoifier
docs: rewrite README with accurate docs and attribution to Hugo + Decap CMS
Commit
42566c93a59959f18888ab5b62c82edeae623897b55d17eb27daefa41aa7909a
Parent
61250904d75e2f3…
1 file changed
+87
-64
+87
-64
| --- README.md | ||
| +++ README.md | ||
| @@ -1,64 +1,87 @@ | ||
| 1 | -# Hugoifier (AI-Powered Theme Converter) | |
| 2 | - | |
| 3 | -A utility that takes your HTML template/website or Hugo them and generates a production-ready Hugo theme with Decap CMS integration. | |
| 4 | - | |
| 5 | -## What is it? | |
| 6 | - | |
| 7 | -Hugoifier is a Python-based utility that: | |
| 8 | - | |
| 9 | -- Converts any HTML/JS/CSS theme into a Hugo-compatible theme using AI. | |
| 10 | -- Extracts layout data into structured files (`data/*.yaml` or `data/*.json`) to make the theme editable via Decap CMS. | |
| 11 | -- Generates and wires Decap CMS into the Hugo setup, making it fully ready for content management. | |
| 12 | -- Uses OpenAI's efficient AI models to analyze theme files and determine the best Hugo template tag placements. | |
| 13 | - | |
| 14 | -## Core Features & Workflow | |
| 15 | - | |
| 16 | -### Step 1: AI-Powered HTML Conversion | |
| 17 | - | |
| 18 | -- Uses GPT-4-Turbo to analyze an HTML theme and suggest where Hugo template tags (`{{ .Title }}`, `{{ .Content }}`, etc.) should be placed. | |
| 19 | -- Identifies partials (e.g., `header.html`, `footer.html`) and reusable elements. | |
| 20 | -- Converts all hardcoded links, images, and text into Hugo-friendly components. | |
| 21 | - | |
| 22 | -### Step2 2: Decap CMS Integration | |
| 23 | - | |
| 24 | -- Extracts the site structure elements (navigation, hero sections, footers) into YAML/JSON files in Hugo's `data/` directory. | |
| 25 | -- Generates a Decap CMS `config.yml` file with proper collections for pages, posts, and layout elements. | |
| 26 | -- Ensures the generated theme is fully editable via Decap CMS. | |
| 27 | - | |
| 28 | -### Step3 3: Automation & Deployment | |
| 29 | - | |
| 30 | -- Provides a Python CLI tool to automate the entire conversion process. | |
| 31 | -- Offer interactive mode for customization and auto mode for full automation. | |
| 32 | -- Ensure themes are deployable on Cloudflare Pages CMS setups. | |
| 33 | -- Deploy the CMS on Cloudflare Pages. | |
| 34 | - | |
| 35 | -## Getting Started | |
| 36 | - | |
| 37 | -### Prerequisites | |
| 38 | - | |
| 39 | -- Python 3.11.4 | |
| 40 | -- Hugo extended version | |
| 41 | -- OpenAI API key | |
| 42 | -- Cloudflare account (for deployment) | |
| 43 | - | |
| 44 | -### Installation | |
| 45 | - | |
| 46 | -1. **Clone the repository:** | |
| 47 | - | |
| 48 | - ```bash | |
| 49 | - git clone https://github.com/yourusername/hugo-ifier.git | |
| 50 | - ``` | |
| 51 | - | |
| 52 | -2. **Install the required Python packages:** | |
| 53 | - | |
| 54 | - ```bash | |
| 55 | - pip install -r requirements.txt | |
| 56 | - ``` | |
| 57 | - | |
| 58 | -## Usage | |
| 59 | - | |
| 60 | -Run the CLI tool to start the conversion process: | |
| 61 | - | |
| 62 | -```bash | |
| 63 | -python cli.py convert --input theme.html --output hugo-theme | |
| 64 | -``` | |
| 1 | +# Hugoifier | |
| 2 | + | |
| 3 | +Convert any website to a production-ready [Hugo](https://gohugo.io/) site with [Decap CMS](https://decapcms.org/) — pixel-perfect, no content loss. | |
| 4 | + | |
| 5 | +## How it works | |
| 6 | + | |
| 7 | +Hugoifier takes three types of input and produces a deployable Hugo site with CMS: | |
| 8 | + | |
| 9 | +| Input | Method | AI needed? | | |
| 10 | +|-------|--------|-----------| | |
| 11 | +| **Hugo theme** | Assembles, patches deprecated APIs, adds CMS | No | | |
| 12 | +| **Next.js app** | Captures rendered HTML from dev server | No | | |
| 13 | +| **Raw HTML** | Extracts head/body directly into Hugo templates | No | | |
| 14 | + | |
| 15 | +AI is only used as a fallback (Next.js without a running dev server) or for lightweight structural analysis. | |
| 16 | + | |
| 17 | +## Quick start | |
| 18 | + | |
| 19 | +```bash | |
| 20 | +pip install hugoifier | |
| 21 | + | |
| 22 | +# Convert a Hugo theme | |
| 23 | +hugoifier complete themes/my-theme | |
| 24 | + | |
| 25 | +# Convert a Next.js app (start your dev server first) | |
| 26 | +hugoifier complete path/to/nextjs-app | |
| 27 | + | |
| 28 | +# Convert a raw HTML site | |
| 29 | +hugoifier complete path/to/html-site | |
| 30 | +``` | |
| 31 | + | |
| 32 | +Output goes to `output/{name}/` — a complete Hugo site ready to serve: | |
| 33 | + | |
| 34 | +```bash | |
| 35 | +cd output/my-site && hugo serve | |
| 36 | +``` | |
| 37 | + | |
| 38 | +## What you get | |
| 39 | + | |
| 40 | +- Hugo site with all content, styles, and assets preserved | |
| 41 | +- Decap CMS at `/admin/` with GitHub OAuth (Cloudflare Pages Functions) | |
| 42 | +- `functions/api/auth.js` + `callback.js` for OAuth flow | |
| 43 | +- Whitelabel CMS branding (`--cms-name`, `--cms-logo`, `--cms-color`) | |
| 44 | + | |
| 45 | +### Deploy to Cloudflare Pages | |
| 46 | + | |
| 47 | +```bash | |
| 48 | +hugo --minify | |
| 49 | +npx wrangler pages deploy public --project-name my-site | |
| 50 | +``` | |
| 51 | + | |
| 52 | +Set `GITHUB_CLIENT_ID` and `GITHUB_CLIENT_SECRET` as environment variables for CMS auth. | |
| 53 | + | |
| 54 | +## Configuration | |
| 55 | + | |
| 56 | +```bash | |
| 57 | +# Choose AI backend (only needed for fallback conversion) | |
| 58 | +HUGOIFIER_BACKEND=anthropic # or openai, google | |
| 59 | +ANTHROPIC_API_KEY=sk-... | |
| 60 | + | |
| 61 | +# Whitelabel CMS | |
| 62 | +hugoifier complete my-site --cms-name "My CMS" --cms-logo https://... --cms-color "#515be3" | |
| 63 | +``` | |
| 64 | + | |
| 65 | +## Development | |
| 66 | + | |
| 67 | +```bash | |
| 68 | +git clone https://github.com/ConflictHQ/hugoifier.git | |
| 69 | +cd hugoifier | |
| 70 | +pip install -e ".[dev]" | |
| 71 | +pytest | |
| 72 | +``` | |
| 73 | + | |
| 74 | +## Built with | |
| 75 | + | |
| 76 | +Hugoifier is built on top of two excellent open-source projects: | |
| 77 | + | |
| 78 | +- **[Hugo](https://gohugo.io/)** — The world's fastest static site generator. Apache 2.0 licensed. Created by [Steve Francia](https://github.com/spf13) and [Bjarne Pedersen](https://github.com/bep) and [contributors](https://github.com/gohugoio/hugo/graphs/contributors). | |
| 79 | +- **[Decap CMS](https://decapcms.org/)** (formerly Netlify CMS) — Open-source content management for Git workflows. MIT licensed. Maintained by the [Decap community](https://github.com/decaporg/decap-cms/graphs/contributors). | |
| 80 | + | |
| 81 | +We're grateful to both communities for building the tools that make this project possible. | |
| 82 | + | |
| 83 | +## License | |
| 84 | + | |
| 85 | +MIT — see [LICENSE](LICENSE) for details. | |
| 86 | + | |
| 87 | +Made by [Conflict](https://weareconflict.com). | |
| 65 | 88 |
| --- README.md | |
| +++ README.md | |
| @@ -1,64 +1,87 @@ | |
| 1 | # Hugoifier (AI-Powered Theme Converter) |
| 2 | |
| 3 | A utility that takes your HTML template/website or Hugo them and generates a production-ready Hugo theme with Decap CMS integration. |
| 4 | |
| 5 | ## What is it? |
| 6 | |
| 7 | Hugoifier is a Python-based utility that: |
| 8 | |
| 9 | - Converts any HTML/JS/CSS theme into a Hugo-compatible theme using AI. |
| 10 | - Extracts layout data into structured files (`data/*.yaml` or `data/*.json`) to make the theme editable via Decap CMS. |
| 11 | - Generates and wires Decap CMS into the Hugo setup, making it fully ready for content management. |
| 12 | - Uses OpenAI's efficient AI models to analyze theme files and determine the best Hugo template tag placements. |
| 13 | |
| 14 | ## Core Features & Workflow |
| 15 | |
| 16 | ### Step 1: AI-Powered HTML Conversion |
| 17 | |
| 18 | - Uses GPT-4-Turbo to analyze an HTML theme and suggest where Hugo template tags (`{{ .Title }}`, `{{ .Content }}`, etc.) should be placed. |
| 19 | - Identifies partials (e.g., `header.html`, `footer.html`) and reusable elements. |
| 20 | - Converts all hardcoded links, images, and text into Hugo-friendly components. |
| 21 | |
| 22 | ### Step2 2: Decap CMS Integration |
| 23 | |
| 24 | - Extracts the site structure elements (navigation, hero sections, footers) into YAML/JSON files in Hugo's `data/` directory. |
| 25 | - Generates a Decap CMS `config.yml` file with proper collections for pages, posts, and layout elements. |
| 26 | - Ensures the generated theme is fully editable via Decap CMS. |
| 27 | |
| 28 | ### Step3 3: Automation & Deployment |
| 29 | |
| 30 | - Provides a Python CLI tool to automate the entire conversion process. |
| 31 | - Offer interactive mode for customization and auto mode for full automation. |
| 32 | - Ensure themes are deployable on Cloudflare Pages CMS setups. |
| 33 | - Deploy the CMS on Cloudflare Pages. |
| 34 | |
| 35 | ## Getting Started |
| 36 | |
| 37 | ### Prerequisites |
| 38 | |
| 39 | - Python 3.11.4 |
| 40 | - Hugo extended version |
| 41 | - OpenAI API key |
| 42 | - Cloudflare account (for deployment) |
| 43 | |
| 44 | ### Installation |
| 45 | |
| 46 | 1. **Clone the repository:** |
| 47 | |
| 48 | ```bash |
| 49 | git clone https://github.com/yourusername/hugo-ifier.git |
| 50 | ``` |
| 51 | |
| 52 | 2. **Install the required Python packages:** |
| 53 | |
| 54 | ```bash |
| 55 | pip install -r requirements.txt |
| 56 | ``` |
| 57 | |
| 58 | ## Usage |
| 59 | |
| 60 | Run the CLI tool to start the conversion process: |
| 61 | |
| 62 | ```bash |
| 63 | python cli.py convert --input theme.html --output hugo-theme |
| 64 | ``` |
| 65 |
| --- README.md | |
| +++ README.md | |
| @@ -1,64 +1,87 @@ | |
| 1 | # Hugoifier |
| 2 | |
| 3 | Convert any website to a production-ready [Hugo](https://gohugo.io/) site with [Decap CMS](https://decapcms.org/) — pixel-perfect, no content loss. |
| 4 | |
| 5 | ## How it works |
| 6 | |
| 7 | Hugoifier takes three types of input and produces a deployable Hugo site with CMS: |
| 8 | |
| 9 | | Input | Method | AI needed? | |
| 10 | |-------|--------|-----------| |
| 11 | | **Hugo theme** | Assembles, patches deprecated APIs, adds CMS | No | |
| 12 | | **Next.js app** | Captures rendered HTML from dev server | No | |
| 13 | | **Raw HTML** | Extracts head/body directly into Hugo templates | No | |
| 14 | |
| 15 | AI is only used as a fallback (Next.js without a running dev server) or for lightweight structural analysis. |
| 16 | |
| 17 | ## Quick start |
| 18 | |
| 19 | ```bash |
| 20 | pip install hugoifier |
| 21 | |
| 22 | # Convert a Hugo theme |
| 23 | hugoifier complete themes/my-theme |
| 24 | |
| 25 | # Convert a Next.js app (start your dev server first) |
| 26 | hugoifier complete path/to/nextjs-app |
| 27 | |
| 28 | # Convert a raw HTML site |
| 29 | hugoifier complete path/to/html-site |
| 30 | ``` |
| 31 | |
| 32 | Output goes to `output/{name}/` — a complete Hugo site ready to serve: |
| 33 | |
| 34 | ```bash |
| 35 | cd output/my-site && hugo serve |
| 36 | ``` |
| 37 | |
| 38 | ## What you get |
| 39 | |
| 40 | - Hugo site with all content, styles, and assets preserved |
| 41 | - Decap CMS at `/admin/` with GitHub OAuth (Cloudflare Pages Functions) |
| 42 | - `functions/api/auth.js` + `callback.js` for OAuth flow |
| 43 | - Whitelabel CMS branding (`--cms-name`, `--cms-logo`, `--cms-color`) |
| 44 | |
| 45 | ### Deploy to Cloudflare Pages |
| 46 | |
| 47 | ```bash |
| 48 | hugo --minify |
| 49 | npx wrangler pages deploy public --project-name my-site |
| 50 | ``` |
| 51 | |
| 52 | Set `GITHUB_CLIENT_ID` and `GITHUB_CLIENT_SECRET` as environment variables for CMS auth. |
| 53 | |
| 54 | ## Configuration |
| 55 | |
| 56 | ```bash |
| 57 | # Choose AI backend (only needed for fallback conversion) |
| 58 | HUGOIFIER_BACKEND=anthropic # or openai, google |
| 59 | ANTHROPIC_API_KEY=sk-... |
| 60 | |
| 61 | # Whitelabel CMS |
| 62 | hugoifier complete my-site --cms-name "My CMS" --cms-logo https://... --cms-color "#515be3" |
| 63 | ``` |
| 64 | |
| 65 | ## Development |
| 66 | |
| 67 | ```bash |
| 68 | git clone https://github.com/ConflictHQ/hugoifier.git |
| 69 | cd hugoifier |
| 70 | pip install -e ".[dev]" |
| 71 | pytest |
| 72 | ``` |
| 73 | |
| 74 | ## Built with |
| 75 | |
| 76 | Hugoifier is built on top of two excellent open-source projects: |
| 77 | |
| 78 | - **[Hugo](https://gohugo.io/)** — The world's fastest static site generator. Apache 2.0 licensed. Created by [Steve Francia](https://github.com/spf13) and [Bjarne Pedersen](https://github.com/bep) and [contributors](https://github.com/gohugoio/hugo/graphs/contributors). |
| 79 | - **[Decap CMS](https://decapcms.org/)** (formerly Netlify CMS) — Open-source content management for Git workflows. MIT licensed. Maintained by the [Decap community](https://github.com/decaporg/decap-cms/graphs/contributors). |
| 80 | |
| 81 | We're grateful to both communities for building the tools that make this project possible. |
| 82 | |
| 83 | ## License |
| 84 | |
| 85 | MIT — see [LICENSE](LICENSE) for details. |
| 86 | |
| 87 | Made by [Conflict](https://weareconflict.com). |
| 88 |