PocketHugo is a browser-first publishing app for GitHub-hosted Markdown content, built around Hugo workflows and optimized for desktop browsers while remaining usable on tablet and phone.
It now includes a higher-efficiency WebP upload pipeline powered by @jsquash/webp (WASM), with browser-safe fallbacks for mobile devices that cannot complete the WASM path.
Pocket publishing for Hugo across desktop, tablet, and phone.
- GitHub repo: https://github.com/h2dcc/pocket-hugo
- Production landing: https://leftn.com
- Production app entry: https://leftn.com/app
- Demo (Vercel): https://pockethugo.lawtee.com
- Demo (Cloudflare Workers): https://pocket-hugo.rpwi.workers.dev
Recommended public entry:
- Prefer
https://leftn.comandhttps://leftn.com/appwhen sharing or using the hosted app. - That domain is bound to the Cloudflare Workers deployment and uses stricter SSL handling, which is the preferred public endpoint for reducing avoidable transport-layer risk.
- Project author: Lawtee
PocketHugo currently focuses on three Hugo-compatible content layouts:
Bundle / Single indexExample:content/posts/my-post/index.mdwith images in the same folder.Bundle / MultilingualExample:content/posts/my-post/index.md,index.en.md,index.de.md, with shared images in the same folder.Flat MarkdownExample:content/posts/my-post.mddirectly under the posts path.
These three modes can be selected from the home page under Publishing Preferences -> Post Structure Mode.
content/
└── posts/
├── article.md # 1. Flat Markdown
├── my-post/ # 2. Multilingual Bundle
│ ├── index.md
│ ├── index.en.md
│ └── cover.jpg
└── my-post-single/ # 3. Single-language Bundle
├── index.md
└── cover.jpg
| Feature | Flat Markdown | Single-language Bundle | Multilingual Bundle |
|---|---|---|---|
| Images | ❌ | ✅ | ✅ |
| Multilingual | ❌ | ❌ | ✅ |
| Typical use case | quick text-first notes | richer posts with local assets | localized content |
PocketHugo does not support image management for "separated text and media" workflows, for example:
- Markdown files in one folder while images are stored in another global folder
- Date-based image archives such as
/images/2026/... - CMS-like media libraries that are independent from the post location
In other words, PocketHugo works best when the Markdown file and its assets stay together, or when you use flat Markdown and do not rely on per-post image folders at all.
PocketHugo is designed for Hugo first, but some projects in other SSGs can still use it if they follow one of the supported structures above and rely on regular frontmatter-based Markdown files.
Possible fit:
- Astro content folders that keep Markdown files and assets together
- Hexo posts that are stored as Markdown files under a Git-tracked content path
- Other static site generators that use GitHub-hosted Markdown plus frontmatter
Not a good fit:
- systems that depend on a central media library
- projects that require automatic handling of "text here, images elsewhere"
- content pipelines that are not folder-oriented or do not map cleanly to GitHub file commits
PocketHugo reduces Git friction while preserving a Hugo-friendly publishing structure:
- write and edit in desktop, tablet, or mobile browser
- choose among three Hugo-compatible post structure modes
- compress, convert, and auto-name images during upload
- use higher-efficiency WebP compression in the browser with WASM-backed encoding
- keep local drafts in the browser and reopen them later
- optionally auto-commit post drafts back to GitHub with
draft: true - reload already-published posts from GitHub and edit again
- publish Markdown and related assets back to GitHub in one batch commit
- GitHub OAuth sign-in
- repository / branch / posts path selection
- local draft storage and continue editing
- load already-published posts from GitHub and edit again
- publish confirmation before pushing
- publish result page with changed file list
Bundle / Single index: direct folder open usingindex.mdBundle / Multilingual: open a folder, then chooseindex.en.md,index.de.md, and similar filesFlat Markdown: list and publish standalone.mdfiles directly under the posts path
- optional auto conversion and compression
- higher-efficiency WebP encoding via
@jsquash/webpwith mobile-safe fallback paths - configurable max width and quality
- optional auto file naming (
1.webp,2.webp, ...) - batch upload up to 9 images
- preview, copy filename, insert Markdown, set cover, and delete assets
Note:
- Image workflow is meant for bundle-style content where Markdown and assets live together.
- In
Flat Markdownmode, PocketHugo does not manage a separate image folder for you.
- browser-first layout with solid desktop workflow
- usable on tablet and phone when needed
- collapsible sections
- slash command helper (
/) in the body editor - Markdown preview
- autosave plus manual save
- optional timed auto-commit of post drafts to GitHub
- light/dark theme and Chinese/English switch
- Standalone Page mode
- Quick Timeline mode
- quick status publishing
- turn timeline content into a post draft
PocketHugo is local-first:
- drafts and preferences are stored in the browser
- session/config cookies are encrypted and stored client-side
- backend does not maintain a user content database
- GitHub token usage is server-side only
- Next.js (App Router)
- React + TypeScript
- GitHub OAuth + GitHub APIs
- OpenNext adapter for Cloudflare Workers
@jsquash/webpfor higher-efficiency in-browser WebP encoding
nextandreactfor the browser-first app shellgray-matterfor Markdown frontmatter parsingreact-markdownfor in-app preview rendering@jsquash/webpfor WASM-backed WebP compression in the browser- GitHub OAuth + GitHub REST APIs for repository access and publishing
- Node.js
22+ - npm
npm install
npm run devCreate .env.local:
APP_URL=http://localhost:3000
APP_SESSION_SECRET=replace-with-a-long-random-secret
GITHUB_CLIENT_ID=your-client-id
GITHUB_CLIENT_SECRET=your-client-secretPocketHugo also provides a local-only repository mode for desktop testing or personal local workflows.
This mode:
- does not use GitHub sign-in
- reads and writes directly to a local repository on your machine
- is intended for local use only
Example:
APP_URL=http://localhost:3000
APP_SESSION_SECRET=replace-with-a-long-random-secret
GITHUB_CLIENT_ID=dummy
GITHUB_CLIENT_SECRET=dummy
LOCAL_REPO_MODE=true
LOCAL_REPO_ROOT=D:/Hugo/my-blogOptional:
LOCAL_POSTS_BASE_PATH=content/postsNotes:
- When
LOCAL_REPO_MODE=true, localhost/opens/appdirectly. - In this mode, PocketHugo works with local repository files instead of GitHub APIs.
- This is an additional local workflow, not a replacement for the GitHub workflow.
- Running
npm run devdoes not mean GitHub mode is unavailable. If you turn local mode off, the normal GitHub sign-in and publishing flow still works in local development.
Go to:
GitHub -> Settings -> Developer settings -> OAuth Apps -> New OAuth App
Then:
- Set
Application name - Set
Homepage URLto your deployment domain - Set
Authorization callback URLtohttps://your-domain/api/auth/callback - Register the app
- Copy
Client IDtoGITHUB_CLIENT_ID - Generate a client secret and copy it to
GITHUB_CLIENT_SECRET
Required:
APP_URLAPP_SESSION_SECRETGITHUB_CLIENT_IDGITHUB_CLIENT_SECRET
Optional:
LANDING_PAGE_HOSTSLOCAL_REPO_MODELOCAL_REPO_ROOTLOCAL_POSTS_BASE_PATH
Generate APP_SESSION_SECRET example:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"APP_URL=https://pockethugo.lawtee.com
APP_SESSION_SECRET=replace-with-a-long-random-secret
GITHUB_CLIENT_ID=your-vercel-oauth-client-id
GITHUB_CLIENT_SECRET=your-vercel-oauth-client-secretAPP_URL=https://leftn.com
APP_SESSION_SECRET=replace-with-a-long-random-secret
GITHUB_CLIENT_ID=your-workers-oauth-client-id
GITHUB_CLIENT_SECRET=your-workers-oauth-client-secret
LANDING_PAGE_HOSTS=leftn.com,www.leftn.comFor production use, leftn.com is the recommended public domain because it is the Workers-bound entry with stricter SSL handling enabled.
- When the request host matches
LANDING_PAGE_HOSTS,/shows the landing page. /appalways opens the application directly.- If the current host does not match
LANDING_PAGE_HOSTS,/opens the app directly.
npm run build:vercelnpm run build:cloudflare- Keep
.env.localout of git - Rotate
GITHUB_CLIENT_SECRETimmediately if exposed - Use a strong
APP_SESSION_SECRET - Use production domains in OAuth callback URLs
PocketHugo is released under the MIT License.
PocketHugo is an independent project built with technologies including Next.js, React, TypeScript, GitHub APIs, and OpenNext for Cloudflare Workers. It is designed primarily for Hugo-compatible publishing workflows, while remaining compatible with some Hexo, Astro, and similar frontmatter-based Markdown workflows.
PocketHugo is not affiliated with or endorsed by Hugo, Vercel, GitHub, or Cloudflare.
Third-party libraries, frameworks, and related assets remain under their own respective licenses.

