{"id":51152389,"url":"https://github.com/sun-praise/hugo-admin","last_synced_at":"2026-06-26T07:02:40.923Z","repository":{"id":324315804,"uuid":"1094104548","full_name":"sun-praise/hugo-admin","owner":"sun-praise","description":"A lightweight web-based admin interface for managing Hugo static sites. Provides an intuitive GUI for browsing, searching, editing posts, and controlling the Hugo development server.","archived":false,"fork":false,"pushed_at":"2026-06-22T16:49:19.000Z","size":1446,"stargazers_count":4,"open_issues_count":5,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-22T18:24:14.814Z","etag":null,"topics":["alpinejs","blog-admin","cms","content-management","flask","hugo","hugo-admin","markdown-editor","python","sqlite","static-site-generator","tailwindcss","websocket"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sun-praise.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-11-11T09:05:39.000Z","updated_at":"2026-06-22T16:49:37.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sun-praise/hugo-admin","commit_stats":null,"previous_names":["svtter/hugo-admin","sun-praise/hugo-admin"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/sun-praise/hugo-admin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sun-praise%2Fhugo-admin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sun-praise%2Fhugo-admin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sun-praise%2Fhugo-admin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sun-praise%2Fhugo-admin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sun-praise","download_url":"https://codeload.github.com/sun-praise/hugo-admin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sun-praise%2Fhugo-admin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34806448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-26T02:00:06.560Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alpinejs","blog-admin","cms","content-management","flask","hugo","hugo-admin","markdown-editor","python","sqlite","static-site-generator","tailwindcss","websocket"],"created_at":"2026-06-26T07:02:40.033Z","updated_at":"2026-06-26T07:02:40.914Z","avatar_url":"https://github.com/sun-praise.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hugo Admin\n\n[![Tests](https://github.com/Svtter/hugo-admin/workflows/Tests/badge.svg)](https://github.com/Svtter/hugo-admin/actions)\n[![License](https://img.shields.io/github/license/Svtter/hugo-admin)](https://github.com/Svtter/hugo-admin/blob/main/LICENSE)\n[![Python](https://img.shields.io/badge/python-3.9%2B-blue)](https://www.python.org/downloads/)\n[![Hugo](https://img.shields.io/badge/hugo-compatible-ff4088)](https://gohugo.io/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n[中文](README.zh-CN.md) | English\n\n## Screenshot\n\n![Hugo Admin Dashboard](screenshot.png)\n\n## Features\n\n- **📊 Dashboard**: Overview of blog statistics and quick actions\n- **📝 Post Management**: Browse, search, and filter posts by category and tags\n- **✏️ Markdown Editor**: Online editing with auto-save and keyboard shortcuts\n- **🚀 Hugo Server Control**: Start/stop Hugo dev server with real-time logs\n- **🔍 Advanced Search**: Full-text search with category and tag filtering\n- **⚡ Real-time Updates**: WebSocket-based live log streaming\n- **💾 Cache System**: SQLite-based caching for fast post retrieval\n- **🔐 Password Login**: Single-admin authentication gates every API and the realtime channel\n\n## Tech Stack\n\n- **Backend**: Flask + Flask-SocketIO\n- **Frontend**: Tailwind CSS + Alpine.js\n- **Real-time Communication**: WebSocket (Socket.IO)\n- **Process Management**: psutil\n- **Database**: SQLite (for caching)\n\n## Installation\n### Docker (Recommended)\nPull the image from GHCR and run with Docker Compose:\n```bash\n# Clone the repository\ngit clone https://github.com/Svtter/hugo-admin.git\ncd hugo-admin\n# Start the service\ndocker compose up -d\n```\nOpen your browser and navigate to `http://127.0.0.1:5050`.\nSee [docker-compose.yml](docker-compose.yml) for volume mounts and environment variables. Adjust the volume paths to match your Hugo site layout.\n### Manual Setup\n#### Requirements\n- Python 3.9+\n- Hugo (installed and in PATH)\n#### Steps\n1. Clone the repository:\n```bash\ngit clone https://github.com/Svtter/hugo-admin.git\ncd hugo-admin\n```\n2. Install dependencies:\n```bash\npip install .\n```\n3. Configure the application:\n```bash\ncp config.py config_local.py\n# Edit config_local.py to set your Hugo root directory\n```\n4. Run the application:\n```bash\npython app.py\n```\n5. Open your browser and navigate to `http://127.0.0.1:5050`\n\n## Configuration\n\nEdit `config.py` or create `config_local.py` to customize:\n\n```python\n# Hugo root directory (parent of content/)\nHUGO_ROOT = '/path/to/your/hugo/site'\n\n# Content directory\nCONTENT_DIR = HUGO_ROOT + '/content'\n\n# Hugo server settings\nHUGO_SERVER_PORT = 1313\nHUGO_SERVER_HOST = '127.0.0.1'\n```\n\n## Usage\n\n### Dashboard\n- View blog statistics (post count, tags, categories)\n- Check Hugo server status\n- Quick access to common operations\n- Recent posts overview\n\n### Post Management\n- Browse all posts with pagination\n- Search posts by title, content, tags, or categories\n- Filter by specific category or tag\n- Click any post to edit\n\n### Editor\n- Edit Markdown files with syntax highlighting\n- Auto-save on changes\n- Keyboard shortcut: `Ctrl+S` / `Cmd+S` to save\n- Real-time save status indicator\n\n### Server Control\n- Start Hugo server (with or without drafts)\n- Stop running server\n- View server status (PID, uptime, CPU, memory)\n- Real-time log streaming\n\n## Development\n\n### Running Tests\n\n```bash\n# Install dev dependencies\npip install -r requirements-dev.txt\n\n# Run all tests\npytest\n\n# Run with coverage\npytest --cov=. --cov-report=html\n```\n\n### Project Structure\n\n```\nhugo-admin/\n├── app.py                 # Flask application\n├── config.py              # Configuration\n├── pyproject.toml         # Dependencies and project metadata\n├── Dockerfile             # Docker image build\n├── docker-compose.yml     # Docker Compose configuration\n├── pytest.ini             # Pytest configuration\n├── services/              # Business logic\n├── routes/                # Flask Blueprints (API routes)\n├── frontend/              # React + Vite SPA\n├── tests/                 # Test suite\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n## Security\n\n- **Login required**: every `/api/*` endpoint and the SocketIO realtime channel are gated behind a password-authenticated session; unauthenticated requests get `401`.\n- On first start a default `admin`/`admin` account is created — set `ADMIN_USERNAME`/`ADMIN_PASSWORD` (or change the password in-app) before exposing the service.\n- Passwords are stored only as salted hashes (`werkzeug.security`); credentials live in `data/auth.json` and are never committed. A corrupt/unreadable credential file fails closed (startup aborts) rather than silently resetting the admin.\n- File operations are restricted to the `content` directory, with path-traversal protection.\n- Set a strong `SECRET_KEY` in production and keep the service on a trusted network or behind a reverse proxy.\n\n## Roadmap\n\n- [x] Basic framework\n- [x] Hugo server control\n- [x] Post browsing and search\n- [x] Markdown editor\n- [x] Markdown preview\n- [x] SQLite caching system\n- [x] Test suite with CI/CD\n- [x] Image upload and management\n- [x] Docker support\n- [x] Git operations interface\n- [x] Password-based admin login\n- [ ] Batch operations\n- [ ] Multi-user support\n\n## License\n\nApache License 2.0 - see [LICENSE](LICENSE) file for details\n\n## Acknowledgments\n\nBuilt with ❤️ for the Hugo community.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsun-praise%2Fhugo-admin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsun-praise%2Fhugo-admin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsun-praise%2Fhugo-admin/lists"}