> ## Documentation Index
> Fetch the complete documentation index at: https://docs.happycapy.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Publish & Remix

> 发布可 Remix 的 Project 快照，让别人或自己复制成新的 Project 继续使用。

export function LivePreview({url, label, linkLabel = "Open live result", fit = "content"}) {
  const isContentFit = fit === "content";
  return <div className={`hc-live-preview${isContentFit ? " hc-preview-content" : ""}`} style={{
    width: isContentFit ? "100%" : "clamp(320px, calc(100vw - 640px), 960px)",
    margin: isContentFit ? "18px 0 32px" : "18px 0 32px 50%",
    transform: isContentFit ? "none" : "translateX(-50%)",
    border: "1px solid rgba(46, 41, 41, 0.1)",
    borderRadius: "10px",
    overflow: "hidden",
    background: "rgba(255, 255, 255, 0.55)",
    boxShadow: "0 18px 45px rgba(46, 41, 41, 0.08)"
  }}>
      <style>{`
        .hc-live-preview-clip {
          position: relative;
          container-type: inline-size;
          aspect-ratio: 16 / 10;
          height: auto;
          overflow: hidden;
          background: white;
        }

        .hc-live-preview-frame {
          position: absolute;
          left: 0;
          top: 0;
          width: 1280px !important;
          height: 800px !important;
          max-width: none !important;
          border: 0;
          background: white;
          display: block;
          transform: scale(calc(100cqw / 1280px));
          transform-origin: top left;
        }

        @media (max-width: 1279px) {
          .hc-live-preview:not(.hc-preview-content) {
            width: 100% !important;
            margin-left: 0 !important;
            transform: none !important;
          }

          .hc-live-preview:not(.hc-preview-content) .hc-live-preview-clip {
            height: min(70vh, 520px);
          }

          .hc-live-preview:not(.hc-preview-content) .hc-live-preview-frame {
            width: 100%;
            height: 100%;
            transform: none;
          }
        }
      `}</style>
      <div style={{
    display: "flex",
    alignItems: "center",
    gap: "8px",
    padding: "10px 12px",
    borderBottom: "1px solid rgba(46, 41, 41, 0.08)",
    background: "rgba(46, 41, 41, 0.035)"
  }}>
        <span style={{
    width: "8px",
    height: "8px",
    borderRadius: "999px",
    background: "#F8A963"
  }} />
        <span style={{
    width: "8px",
    height: "8px",
    borderRadius: "999px",
    background: "rgba(46, 41, 41, 0.18)"
  }} />
        <span style={{
    width: "8px",
    height: "8px",
    borderRadius: "999px",
    background: "rgba(46, 41, 41, 0.18)"
  }} />
        <span style={{
    marginLeft: "8px",
    color: "rgba(46, 41, 41, 0.58)",
    fontSize: "0.82rem",
    overflow: "hidden",
    textOverflow: "ellipsis",
    whiteSpace: "nowrap"
  }}>{label}</span>
      </div>
      <div className="hc-live-preview-clip">
        <iframe className="hc-live-preview-frame" src={url} title={label} loading="lazy" style={{
    margin: 0,
    maxWidth: "none"
  }} />
      </div>
      <div style={{
    padding: "12px 14px",
    borderTop: "1px solid rgba(46, 41, 41, 0.08)",
    background: "rgba(255, 255, 255, 0.72)"
  }}>
        <a href={url} target="_blank" rel="noreferrer">{linkLabel}</a>
      </div>
    </div>;
}

## Publish & Remix 如何工作

如果只是想让别人查看一段对话、文件或结果，用 **Share**。

如果想让别人基于你的 Project 继续编辑，用 **Publish**。Publish 会保存一个可 Remix 的 Project 快照。拿到链接的人可以查看快照，也可以 **Remix** 成自己的可编辑 Project。

**Remix** 会从快照创建一个新的 Project。副本是独立的，Remix 里的修改不会影响原来的 Project。

你也可以 Remix 自己发布的快照，用来从一个稳定版本开始探索另一个方向。

## 什么时候使用 Publish & Remix

* 想让别人编辑或改造你的 Project
* 想保存一个别人可以复制的稳定版本
* 想自己从当前版本探索另一个方向
* 想让团队或社区复用你的 Project

<Note>
  任何拿到发布链接的人都可以查看这个快照。发布前请检查文件、聊天记录、令牌、密钥和隐私信息。
</Note>

## 发布快照

在 Project 右上角点击 **Publish**。

<div style={{ borderRadius: '14px', border: '1px solid rgba(45, 36, 27, 0.12)', boxShadow: '0 18px 46px rgba(56, 38, 20, 0.09)', overflow: 'hidden', background: '#FFFFFF', marginBottom: '24px' }}>
  <div style={{ padding: '12px 16px', borderBottom: '1px solid rgba(45, 36, 27, 0.08)', background: '#FFFFFF' }}>
    <span style={{ display: 'block', color: '#2E2929', fontFamily: 'Instrument Serif, Georgia, "Times New Roman", serif', fontSize: '28px', fontWeight: 400, lineHeight: '1' }}>Publish</span>
    <span style={{ display: 'block', marginTop: '6px', color: '#8A8178', fontFamily: 'Instrument Serif, Georgia, "Times New Roman", serif', fontSize: '18px', fontWeight: 400, lineHeight: '1.2' }}>保存一个可 Remix 的 Project 快照。</span>
  </div>

  <img src="https://mintcdn.com/happycapy/qu9DbeP3oO1Bbe3K/images/features/publish-snapshot.png?fit=max&auto=format&n=qu9DbeP3oO1Bbe3K&q=85&s=e295fcb80229d4704896f484304d4805" alt="Publish snapshot 面板" style={{ maxWidth: '100%', display: 'block', margin: '0 auto' }} width="1600" height="900" data-path="images/features/publish-snapshot.png" />
</div>

复制链接前，先选择要包含的内容：

* **Include chat history** — 把对话记录一起包含进快照
* **Files only** — 关闭聊天记录，只发布 Project 文件
* **Past snapshots** — 找回并重新分享之前发布过的链接

发布后复制链接，发给需要查看或 Remix 这个快照的人。

<Tip>
  快照记录的是发布那一刻的 Project 状态。如果之后做了重要修改，需要重新 Publish 才能分享新版本。
</Tip>

## Remix 快照

打开一个已发布的快照，然后点击 **Remix**。

<LivePreview url="https://happycapy.ai/snapshots/e4f0e3b2-a8c8-4c50-91df-0789f7017d37" label="happycapy.ai/snapshots/e4f0e3b2-a8c8-4c50-91df-0789f7017d37" linkLabel="打开快照" />

Happycapy 会把快照复制到你的工作空间，并作为新的 Project 打开。之后你可以修改文件、继续推进，或让 Happycapy 沿另一个方向处理。

这份副本是独立的：

* Remix 里的修改不会影响原始 Project
* 原始 Project 后续的修改不会自动同步到已有 Remix
* 不同的人可以 Remix 同一个快照，并各自独立工作
