<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0"
  xmlns:atom="http://www.w3.org/2005/Atom"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Writing - Pocket Hugo</title>
    <link>https://theme.leftn.com/zh-cn/categories/writing/</link>
    <description>Writing</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>zh-cn</language>
    <lastBuildDate>Mon, 20 Apr 2026 02:51:39 &#43;0000</lastBuildDate>
    <atom:link href="https://theme.leftn.com/zh-cn/categories/writing/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Pocket Hugo：面向浏览器的 Hugo 发布工具</title>
      <link>https://theme.leftn.com/zh-cn/article/pocket-hugo-project/</link>
      <pubDate>Mon, 23 Mar 2026 07:30:00 &#43;0000</pubDate>
      <guid>https://theme.leftn.com/zh-cn/article/pocket-hugo-project/</guid>
      <description>Pocket Hugo 是一款以浏览器为核心的 Hugo 发布工具，围绕写作、图片处理和基于 GitHub 的 Markdown 工作流设计，可覆盖桌面、平板与手机。</description>
      <content:encoded><![CDATA[<p>Pocket Hugo 是一款面向桌面、平板和手机的浏览器优先 Hugo 发布工具。它是为那些把内容放在 GitHub 仓库里、又希望直接在浏览器中完成 Markdown 写作、管理与发布的人设计的，而不必依赖某一台主力电脑。</p>
<p>它有意思的地方，不只是“能在浏览器里运行”。它的首页其实说得更直接：Pocket Hugo 把 GitHub 发布、本地草稿、更高效率的 WebP 图片处理，以及页面编辑整合进同一套浏览器工作流，同时仍然尽量贴近真实的 Hugo 内容结构。这也让它天然成为 <code>pocket-hugo-theme</code> 的姊妹项目。</p>
<ul>
<li>GitHub 仓库：https://github.com/h2dcc/pocket-hugo</li>
<li>正式落地页：https://leftn.com</li>
<li>正式应用入口：https://leftn.com/app</li>
</ul>
<h2 id="why-it-exists">Why it exists</h2>
<p>很多 Hugo 工作流至今仍然假定：写作发生在一台主力电脑上，而图片处理、front matter 编辑和发布则分散在不同步骤里。Pocket Hugo 试图减少这种摩擦。</p>
<p>它尤其适合以下场景：</p>
<ul>
<li>你想在手机或平板上继续写草稿</li>
<li>你的内容直接发布到 GitHub 托管的仓库</li>
<li>你希望图片处理尽量贴近文章本身</li>
<li>你使用多语言 bundle，并需要快速创建翻译版本</li>
</ul>
<p><figure class="article-image">
    <a class="article-image__link" href="/article/pocket-hugo-project/where-to-start.webp" data-lightbox-image>
        <img
            src="/article/pocket-hugo-project/where-to-start_hu_9eecf91f78338e3f.webp"
            alt="Pocket Hugo 入口与初始设置"
            loading="lazy"
            decoding="async"
            srcset="/article/pocket-hugo-project/where-to-start_hu_633ef2a1634e34de.webp 640w, /article/pocket-hugo-project/where-to-start_hu_9eecf91f78338e3f.webp 960w"
            sizes="100vw"
            width="1080"
            height="589"
             title="Pocket Hugo 入口与初始设置"
        >
    </a>
    <figcaption>Pocket Hugo 入口与初始设置</figcaption>
</figure>
</p>
<h2 id="what-it-brings-together">What it brings together</h2>
<p>与其把 Pocket Hugo 理解成一个通用 Markdown 编辑器，不如把它看作一套发布工作流。它把多个实用环节整合到了一起：</p>
<ul>
<li>GitHub 登录与直接发布</li>
<li>对三种 Hugo 友好内容结构的支持</li>
<li>上传时的图片压缩、转换和自动命名</li>
<li>浏览器中的本地草稿恢复</li>
<li>从 GitHub 重新加载已发布文章，继续编辑</li>
<li>独立页面编辑与 Quick Timeline 更新</li>
</ul>
<p>这也是为什么它的首页看起来更像产品落地页，而不是开发者工具页。它卖点不是“一个文本框”，而是一套更顺手的 Hugo 工作流。</p>
<h2 id="writing-around-hugo-structures">Writing around Hugo structures</h2>
<p>Pocket Hugo 当前最适合三种内容结构：</p>
<ol>
<li>扁平 Markdown 文件，适合更简单的纯文本笔记。</li>
<li>单语言 bundle，适合带本地资源的丰富文章。</li>
<li>多语言 bundle，适合共享同一目录和资源的翻译文章。</li>
</ol>
<p>这种“理解结构”的能力很重要。它会影响新文章如何创建、已有文章如何读取，以及内容最终如何推回 GitHub。</p>
<h2 id="post-editor-and-publishing-flow">Post editor and publishing flow</h2>
<p>编辑器被划分成几个非常实用的部分：基础信息、正文内容、图片和 front matter。在 bundle 模式下，图片上传与资源管理会直接出现在写作流程中。</p>
<p>这让工具更像一个专注的发布界面，而不是通用 Markdown 编辑器。你不只是在写文字，而是在按网站真正需要的结构准备一篇 Hugo 文章，然后把它送回 Git 工作流。</p>
<p><figure class="article-image">
    <a class="article-image__link" href="/article/pocket-hugo-project/writing-posts.webp" data-lightbox-image>
        <img
            src="/article/pocket-hugo-project/writing-posts_hu_d08468cfe6819089.webp"
            alt="Pocket Hugo 写作编辑器"
            loading="lazy"
            decoding="async"
            srcset="/article/pocket-hugo-project/writing-posts_hu_a73bb7b59bb37cc3.webp 640w, /article/pocket-hugo-project/writing-posts_hu_d08468cfe6819089.webp 960w"
            sizes="100vw"
            width="1080"
            height="881"
             title="Pocket Hugo 写作编辑器"
        >
    </a>
    <figcaption>Pocket Hugo 写作编辑器</figcaption>
</figure>
</p>
<h2 id="multilingual-workflow">Multilingual workflow</h2>
<p>Pocket Hugo 比较有辨识度的一点，是它对多语言 bundle 的支持。预览区域可以直接展示当前 Markdown，方便你把内容复制到其他翻译流程中，再把译文带回到诸如 <code>index.zh-cn.md</code>、<code>index.de.md</code> 这样的新文件里。</p>
<p>对于需要用多种语言发布、但又不想维护一套沉重 CMS 的作者来说，这一点尤其有价值。</p>
<p><figure class="article-image">
    <a class="article-image__link" href="/article/pocket-hugo-project/create-multi-versions.webp" data-lightbox-image>
        <img
            src="/article/pocket-hugo-project/create-multi-versions_hu_2f2e06ad9be2ca5d.webp"
            alt="在 Pocket Hugo 中创建多语言版本"
            loading="lazy"
            decoding="async"
            srcset="/article/pocket-hugo-project/create-multi-versions_hu_5a32186169c83eaa.webp 640w, /article/pocket-hugo-project/create-multi-versions_hu_2f2e06ad9be2ca5d.webp 960w"
            sizes="100vw"
            width="1080"
            height="784"
             title="在 Pocket Hugo 中创建多语言版本"
        >
    </a>
    <figcaption>在 Pocket Hugo 中创建多语言版本</figcaption>
</figure>
</p>
<h2 id="image-handling">Image handling</h2>
<p>Pocket Hugo 同样非常重视图片工作流。它支持上传、预览、转换、封面选择、文件插入以及更轻量的压缩处理。当前这条管线尤其适合在发布前先把手机和平板拍出来的大图减重，然后再提交进仓库。</p>
<p>这种对 bundle 内容的重视，也正是主题和编辑器能配合得很好的原因之一。主题本身偏向封面驱动、bundle 友好的文章结构；而 Pocket Hugo 刚好能生产出这种内容。</p>
<p><figure class="article-image">
    <a class="article-image__link" href="/article/pocket-hugo-project/images-flow.webp" data-lightbox-image>
        <img
            src="/article/pocket-hugo-project/images-flow_hu_755179ba511effc6.webp"
            alt="Pocket Hugo 的图片工作流"
            loading="lazy"
            decoding="async"
            srcset="/article/pocket-hugo-project/images-flow_hu_51ff0ddf00c1706a.webp 640w, /article/pocket-hugo-project/images-flow_hu_755179ba511effc6.webp 960w"
            sizes="100vw"
            width="1080"
            height="865"
             title="Pocket Hugo 的图片工作流"
        >
    </a>
    <figcaption>Pocket Hugo 的图片工作流</figcaption>
</figure>
</p>
<h2 id="publishing-back-to-github">Publishing back to GitHub</h2>
<p>当文章准备好之后，Pocket Hugo 会把 Markdown 文件和相关资源一起提交回配置好的仓库。结果页会显示仓库、分支、路径以及本次改动的文件列表，让输出过程更透明。</p>
<p>这会让发布步骤更值得信任，尤其是在你不处于常规开发环境、而是在浏览器里完成写作的时候。</p>
<p><figure class="article-image">
    <a class="article-image__link" href="/article/pocket-hugo-project/published-uccessfully.webp" data-lightbox-image>
        <img
            src="/article/pocket-hugo-project/published-uccessfully_hu_2451d5bb0ff33e72.webp"
            alt="Pocket Hugo 发布结果"
            loading="lazy"
            decoding="async"
            srcset="/article/pocket-hugo-project/published-uccessfully_hu_60c351f0f49dccab.webp 640w, /article/pocket-hugo-project/published-uccessfully_hu_2451d5bb0ff33e72.webp 960w"
            sizes="100vw"
            width="1080"
            height="731"
             title="Pocket Hugo 发布结果"
        >
    </a>
    <figcaption>Pocket Hugo 发布结果</figcaption>
</figure>
</p>
<h2 id="why-it-fits-this-theme">Why it fits this theme</h2>
<p><code>pocket-hugo-theme</code> 是为长期个人写作设计的主题，强调封面呈现、安静的阅读节奏和多语言支持。Pocket Hugo 则让写作端变得更轻、更顺手。</p>
<p>两者结合起来，非常适合这些需求：</p>
<ul>
<li>轻量的浏览器写作流程</li>
<li>Hugo 原生内容结构</li>
<li>不依赖大型 CMS 的多语言发布</li>
<li>在移动端依然好读的文章卡片和封面</li>
</ul>
<p>Pocket Hugo 并不是想替代所有静态网站工作流。当你的内容已经存在于一个 Hugo 形状的仓库里，而你又希望写作体验更快、更轻、更适合移动端时，它的价值就最明显。</p>
<p>它首页上的定位其实也总结得很好：首先为 Hugo 而生，但当仓库结构相近时，也兼容 Astro、Hexo 等相邻的 Markdown 工作流。</p>
]]></content:encoded>
    </item>
    <item>
      <title>短代码演示</title>
      <link>https://theme.leftn.com/zh-cn/article/shortcodes-demo/</link>
      <pubDate>Fri, 06 Mar 2026 01:00:00 &#43;0000</pubDate>
      <guid>https://theme.leftn.com/zh-cn/article/shortcodes-demo/</guid>
      <description>一篇把多个实用短代码集中展示在一起的示例页面，适合内容密集型 Hugo 站点。</description>
      <content:encoded><![CDATA[<p>这篇页面汇总了几个很适合内容型 Hugo 主题使用的实用短代码。它们都尽量保持简单、容易复制，适合随笔、笔记和文档类页面。</p>
<h2 id="fold">Fold</h2>
<p>当某一段内容不想一开始就占太多纵向空间时，可以使用 <code>fold</code>。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">{{&lt; fold &#34;Why this shortcode exists&#34; &gt;}}
</span></span><span class="line"><span class="cl">This hidden block is rendered inside a native `&lt;details&gt;` element.
</span></span><span class="line"><span class="cl">{{&lt; /fold &gt;}}</span></span></code></pre></div><details>
    <summary>Why this shortcode exists</summary>
    这个隐藏区块会被渲染成原生的 <code>&lt;details&gt;</code> 元素，因此不依赖 JavaScript，也很适合长文阅读场景。
</details>

<h2 id="note">Note</h2>
<p><code>note</code> 适合用来放提示、警告或旁注。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">{{&lt; note type=&#34;info&#34; title=&#34;Content-first&#34; &gt;}}
</span></span><span class="line"><span class="cl">Pocket Hugo Theme keeps callouts readable without making them look like app UI.
</span></span><span class="line"><span class="cl">{{&lt; /note &gt;}}</span></span></code></pre></div><div class="shortcode-note shortcode-note--info"><div class="shortcode-note__title">Content-first</div><div class="shortcode-note__body">
    Pocket Hugo Theme 会让这类提示块保持清晰易读，而不会看起来像一套应用界面组件。
  </div>
</div>

<div class="shortcode-note shortcode-note--tip"><div class="shortcode-note__title">Tip</div><div class="shortcode-note__body">
    这类短代码很适合教程、更新记录和写作指南。
  </div>
</div>

<div class="shortcode-note shortcode-note--warn"><div class="shortcode-note__title">Experimental</div><div class="shortcode-note__body">
    如果你要新增自定义短代码，尽量保持它们足够小、足够容易理解。读者不应该先研究布局，才能开始阅读内容。
  </div>
</div>

<h2 id="badge">Badge</h2>
<p>Badge 适合在段落中放置简短的状态标签。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">{{&lt; badge &#34;Stable&#34; &gt;}}
</span></span><span class="line"><span class="cl">{{&lt; badge text=&#34;Optional&#34; type=&#34;info&#34; &gt;}}
</span></span><span class="line"><span class="cl">{{&lt; badge text=&#34;Experimental&#34; type=&#34;warn&#34; &gt;}}</span></span></code></pre></div><p><span class="shortcode-badge shortcode-badge--default">Stable</span>

<span class="shortcode-badge shortcode-badge--info">Optional</span>

<span class="shortcode-badge shortcode-badge--warn">Experimental</span>
</p>
<h2 id="button">Button</h2>
<p>当你想要比普通文本链接更醒目的行内跳转入口时，可以使用 <code>button</code>。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">{{&lt; button href=&#34;https://theme.leftn.com/guide/&#34; label=&#34;Open the Guide&#34; &gt;}}
</span></span><span class="line"><span class="cl">{{&lt; button href=&#34;https://theme.leftn.com/links/&#34; label=&#34;Browse Links&#34; style=&#34;ghost&#34; &gt;}}</span></span></code></pre></div><p><a class="shortcode-button shortcode-button--primary" href="/guide/">Open the Guide</a>

<a class="shortcode-button shortcode-button--ghost" href="/links/">Browse Links</a>
</p>
<h2 id="video-and-audio">Video and audio</h2>
<p>这些短代码可以让常见的媒体嵌入方式和主题整体风格保持一致。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">{{&lt; video src=&#34;https://theme.leftn.com/media/demo.mp4&#34; title=&#34;Local video&#34; &gt;}}Caption{{&lt; /video &gt;}}
</span></span><span class="line"><span class="cl">{{&lt; audio src=&#34;https://theme.leftn.com/media/demo.mp3&#34; title=&#34;Audio clip&#34; &gt;}}Caption{{&lt; /audio &gt;}}
</span></span><span class="line"><span class="cl">{{&lt; youtube id=&#34;rdwz7QiG0lk&#34; &gt;}}YouTube embed{{&lt; /youtube &gt;}}
</span></span><span class="line"><span class="cl">{{&lt; bilibili bvid=&#34;BV1xx411c7mu&#34; &gt;}}Bilibili embed{{&lt; /bilibili &gt;}}</span></span></code></pre></div><figure class="shortcode-media shortcode-media--video">
  <video
    controls
    preload="metadata"
    title="HTML5 video"
    
    
    
    
    playsinline>
    <source src="https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4" />
  </video>
  <figcaption>一个普通的 HTML5 视频包装，沿用主题默认的圆角和留白。</figcaption>
</figure>

<figure class="shortcode-media shortcode-media--audio">
  <div class="shortcode-audio__title">HTML5 audio</div>
  <audio controls preload="metadata">
    <source src="https://interactive-examples.mdn.mozilla.net/media/cc0-audio/t-rex-roar.mp3">
  </audio>
  <figcaption>一个风格统一的音频播放器，适合短音频、播客片段或语音笔记。</figcaption>
</figure>

<figure class="shortcode-media shortcode-media--embed">
  <div class="shortcode-embed">
    <iframe
      src="https://www.youtube-nocookie.com/embed/rdwz7QiG0lk"
      title="YouTube video"
      loading="lazy"
      referrerpolicy="strict-origin-when-cross-origin"
      allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
      allowfullscreen>
    </iframe>
  </div>
  <figcaption>使用同样媒体外壳包裹的 YouTube 嵌入。</figcaption>
</figure>

<figure class="shortcode-media shortcode-media--embed">
  <div class="shortcode-embed">
    <iframe
      src="https://player.bilibili.com/player.html?bvid=BV1xx411c7mu&page=1"
      title="Bilibili video"
      loading="lazy"
      scrolling="no"
      frameborder="0"
      allowfullscreen>
    </iframe>
  </div>
  <figcaption>使用相同响应式容器的 Bilibili 嵌入。</figcaption>
</figure>

<h2 id="timeline">Timeline</h2>
<p>当你想表达一个过程、更新记录或时间序列时，可以使用 <code>timeline</code>。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">{{&lt; timeline &gt;}}
</span></span><span class="line"><span class="cl">{{&lt; timeline-item date=&#34;2026-01&#34; title=&#34;Planning&#34; &gt;}}Outline the scope.{{&lt; /timeline-item &gt;}}
</span></span><span class="line"><span class="cl">{{&lt; timeline-item date=&#34;2026-02&#34; title=&#34;Build&#34; &gt;}}Ship the first version.{{&lt; /timeline-item &gt;}}
</span></span><span class="line"><span class="cl">{{&lt; /timeline &gt;}}</span></span></code></pre></div><div class="shortcode-timeline">
  
<div class="shortcode-timeline__item">
  <div class="shortcode-timeline__rail"></div>
  <div class="shortcode-timeline__content">
    <div class="shortcode-timeline__date">2026-01</div>
    <div class="shortcode-timeline__title">Planning</div>
    <div class="shortcode-timeline__body">先勾勒功能的第一版范围，并让数据格式保持精简。</div>
  </div>
</div>

<div class="shortcode-timeline__item">
  <div class="shortcode-timeline__rail"></div>
  <div class="shortcode-timeline__content">
    <div class="shortcode-timeline__date">2026-02</div>
    <div class="shortcode-timeline__title">Build</div>
    <div class="shortcode-timeline__body">做出一个简单实现，更偏向长文内容而不是应用式界面。</div>
  </div>
</div>

<div class="shortcode-timeline__item">
  <div class="shortcode-timeline__rail"></div>
  <div class="shortcode-timeline__content">
    <div class="shortcode-timeline__date">2026-03</div>
    <div class="shortcode-timeline__title">Polish</div>
    <div class="shortcode-timeline__body">继续打磨文案、留白和多语言示例。</div>
  </div>
</div>


</div>

<h2 id="columns">Columns</h2>
<p>当两组内容需要并排比较时，可以使用 <code>columns</code>。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">{{&lt; columns &gt;}}
</span></span><span class="line"><span class="cl">{{&lt; column &gt;}}Left side{{&lt; /column &gt;}}
</span></span><span class="line"><span class="cl">{{&lt; column &gt;}}Right side{{&lt; /column &gt;}}
</span></span><span class="line"><span class="cl">{{&lt; /columns &gt;}}</span></span></code></pre></div><div class="shortcode-columns">
  
<div class="shortcode-columns__item shortcode-columns__item--1">
  <h3 id="better-for">Better for</h3>
<ul>
<li>简短对比</li>
<li>功能摘要</li>
<li>前后变化说明</li>
</ul>

</div>

<div class="shortcode-columns__item shortcode-columns__item--1">
  <h3 id="avoid-for">Avoid for</h3>
<ul>
<li>很长的文章段落</li>
<li>过深的嵌套列表</li>
<li>必须线性阅读的内容</li>
</ul>

</div>


</div>

<h2 id="gallery">Gallery</h2>
<p>当一篇文章里需要一个紧凑的图片网格，而你又不想手写多张 Markdown 图片块时，可以使用 <code>gallery</code>。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">{{&lt; gallery pattern=&#34;sample*.webp&#34; columns=&#34;3&#34; &gt;}}</span></span></code></pre></div><p>这个短代码会读取当前页面 bundle 中匹配的图片文件，把它们渲染成响应式相册网格，并在点击时复用主题内置灯箱。</p>
<section class="shortcode-gallery" style="--gallery-columns: 3; --article-content-image-desktop-max-height: none; --article-content-image-tablet-max-height: none; --article-content-image-mobile-max-height: none;"><figure class="shortcode-gallery__item">
      <a class="shortcode-gallery__link" href="/article/shortcodes-demo/sample1.webp" data-lightbox-image>
        <img
          src="/article/shortcodes-demo/sample1_hu_769169bf8aa436a6.webp"
          alt="sample1.webp"
          loading="lazy"
          decoding="async"
          width="1200"
          height="634"
        >
      </a>
    </figure><figure class="shortcode-gallery__item">
      <a class="shortcode-gallery__link" href="/article/shortcodes-demo/sample2.webp" data-lightbox-image>
        <img
          src="/article/shortcodes-demo/sample2_hu_30929b063163d0c7.webp"
          alt="sample2.webp"
          loading="lazy"
          decoding="async"
          width="1200"
          height="647"
        >
      </a>
    </figure><figure class="shortcode-gallery__item">
      <a class="shortcode-gallery__link" href="/article/shortcodes-demo/sample3.webp" data-lightbox-image>
        <img
          src="/article/shortcodes-demo/sample3_hu_14c5b80a4fe9479e.webp"
          alt="sample3.webp"
          loading="lazy"
          decoding="async"
          width="1200"
          height="610"
        >
      </a>
    </figure><figure class="shortcode-gallery__item">
      <a class="shortcode-gallery__link" href="/article/shortcodes-demo/sample4.webp" data-lightbox-image>
        <img
          src="/article/shortcodes-demo/sample4_hu_c2bdf2377283164c.webp"
          alt="sample4.webp"
          loading="lazy"
          decoding="async"
          width="1200"
          height="892"
        >
      </a>
    </figure><figure class="shortcode-gallery__item">
      <a class="shortcode-gallery__link" href="/article/shortcodes-demo/sample5.webp" data-lightbox-image>
        <img
          src="/article/shortcodes-demo/sample5_hu_bd8ccefce6c594d9.webp"
          alt="sample5.webp"
          loading="lazy"
          decoding="async"
          width="1200"
          height="1190"
        >
      </a>
    </figure><figure class="shortcode-gallery__item">
      <a class="shortcode-gallery__link" href="/article/shortcodes-demo/sample6.webp" data-lightbox-image>
        <img
          src="/article/shortcodes-demo/sample6_hu_5a08dc0e4d4206dd.webp"
          alt="sample6.webp"
          loading="lazy"
          decoding="async"
          width="1200"
          height="2058"
        >
      </a>
    </figure></section>
<h2 id="why-this-matters">Why this matters</h2>
<p>这些短代码并不是为了把主题变成一个组件库。它们的目的只是给写作者提供一些可复用的小积木，让内容更容易表达，同时又不需要引入额外框架。</p>]]></content:encoded>
    </item>
  </channel>
</rss>
