<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>六爻手记</title><description>SRC</description><link>https://blog.minggh.cn/</link><language>zh_CN</language><item><title>Astro分离文章仓库最佳实践</title><link>https://blog.minggh.cn/posts/public-content/tutorial/astro%E6%9C%80%E4%BD%B3%E5%AE%9E%E8%B7%B501/</link><guid isPermaLink="true">https://blog.minggh.cn/posts/public-content/tutorial/astro%E6%9C%80%E4%BD%B3%E5%AE%9E%E8%B7%B501/</guid><pubDate>Mon, 15 Jun 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Astro分离文章仓库最佳实践&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;[!TIP]&lt;/p&gt;
&lt;p&gt;Astro 站点主框架与文章分离，且文章按公开/私有分别存放于不同仓库&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;1. 整体架构&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;[ 主框架仓库 (core) ]          ← 私有，包含 Astro 项目、页面模板、样式、组件
    ├── src/content/public/    ← Git 子模块 → [ 公开文章仓库 (public-posts) ] 公开
    └── src/content/private/   ← Git 子模块 → [ 私有文章仓库 (private-posts) ] 私有
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;核心仓库&lt;/strong&gt;：负责网站框架、布局、路由。建议设为私有（避免暴露私有子模块地址）。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;公开文章仓库&lt;/strong&gt;：所有人可读，贡献者通过 PR 提交内容。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;私有文章仓库&lt;/strong&gt;：仅授权成员可访问，存放内部文档、草稿、会员内容等。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;通过 &lt;strong&gt;Git 子模块&lt;/strong&gt; 将两个内容仓库挂载到核心项目的 &lt;code&gt;src/content&lt;/code&gt; 下，让 Astro 像使用本地文件一样处理它们。&lt;/p&gt;
&lt;h2&gt;2. 仓库初始化&lt;/h2&gt;
&lt;h3&gt;2.1 创建核心仓库并添加子模块&lt;/h3&gt;
&lt;p&gt;bash&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# 在 core 项目中
git submodule add git@github.com:your-org/public-posts.git src/content/public
git submodule add git@github.com:your-org/private-posts.git src/content/private
git commit -m &quot;Add content submodules&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;2.2 开发者克隆核心仓库&lt;/h3&gt;
&lt;p&gt;bash&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;git clone --recurse-submodules git@github.com:your-org/core.git
# 若未自动拉取子模块，可手动执行：
git submodule update --init --recursive
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;如果开发者没有私有仓库权限，&lt;code&gt;private&lt;/code&gt; 子模块会拉取失败。此时需要借助环境变量跳过（见下节）。&lt;/p&gt;
&lt;/blockquote&gt;
</content:encoded></item><item><title>原神角色养成材料一图流</title><link>https://blog.minggh.cn/posts/public-content/game/%E5%8E%9F%E7%A5%9E%E8%A7%92%E8%89%B2%E5%85%BB%E6%88%90%E6%9D%90%E6%96%99%E4%B8%80%E5%9B%BE%E6%B5%81/%E5%8E%9F%E7%A5%9E%E8%A7%92%E8%89%B2%E5%85%BB%E6%88%90%E6%9D%90%E6%96%99%E4%B8%80%E5%9B%BE%E6%B5%81/</link><guid isPermaLink="true">https://blog.minggh.cn/posts/public-content/game/%E5%8E%9F%E7%A5%9E%E8%A7%92%E8%89%B2%E5%85%BB%E6%88%90%E6%9D%90%E6%96%99%E4%B8%80%E5%9B%BE%E6%B5%81/%E5%8E%9F%E7%A5%9E%E8%A7%92%E8%89%B2%E5%85%BB%E6%88%90%E6%9D%90%E6%96%99%E4%B8%80%E5%9B%BE%E6%B5%81/</guid><pubDate>Sun, 17 May 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;一图流来源于：米游社&lt;/p&gt;
&lt;h3&gt;尼克&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;%E5%B0%BC%E5%85%8B-%E5%85%BB%E6%88%90%E6%9D%90%E6%96%99.png&quot; alt=&quot;img&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;布伦尼&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;%E5%B8%83%E4%BC%A6%E5%B0%BC-%E5%85%BB%E6%88%90%E6%9D%90%E6%96%99.png&quot; alt=&quot;img&quot; /&gt;&lt;/p&gt;
</content:encoded></item><item><title>终末地角色养成一图流</title><link>https://blog.minggh.cn/posts/public-content/game/%E7%BB%88%E6%9C%AB%E5%9C%B0%E8%A7%92%E8%89%B2%E5%85%BB%E6%88%90%E4%B8%80%E5%9B%BE%E6%B5%81/%E7%BB%88%E6%9C%AB%E5%9C%B0%E8%A7%92%E8%89%B2%E5%85%BB%E6%88%90%E4%B8%80%E5%9B%BE%E6%B5%81/</link><guid isPermaLink="true">https://blog.minggh.cn/posts/public-content/game/%E7%BB%88%E6%9C%AB%E5%9C%B0%E8%A7%92%E8%89%B2%E5%85%BB%E6%88%90%E4%B8%80%E5%9B%BE%E6%B5%81/%E7%BB%88%E6%9C%AB%E5%9C%B0%E8%A7%92%E8%89%B2%E5%85%BB%E6%88%90%E4%B8%80%E5%9B%BE%E6%B5%81/</guid><pubDate>Sat, 09 May 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;一图流来源于：&lt;a href=&quot;https://space.bilibili.com/267766441/lists/7278004?type=season&quot;&gt;血狼破军-合集·终末地测评&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;洁尔佩塔&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;%E4%B8%80%E5%9B%BE%E6%B5%81-%E6%B4%81%E5%B0%94%E4%BD%A9%E5%A1%94.jpg&quot; alt=&quot;img&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;伊冯&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;%E4%B8%80%E5%9B%BE%E6%B5%81-%E4%BC%8A%E5%86%AF.jpg&quot; alt=&quot;img&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;汤汤&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;%E4%B8%80%E5%9B%BE%E6%B5%81-%E6%B1%A4%E6%B1%A4.jpg&quot; alt=&quot;img&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;洛茜&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;%E4%B8%80%E5%9B%BE%E6%B5%81-%E6%B4%9B%E8%8C%9C.jpg&quot; alt=&quot;img&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;庄方宜&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;%E4%B8%80%E5%9B%BE%E6%B5%81-%E5%BA%84%E6%96%B9%E5%AE%9C.jpg&quot; alt=&quot;img&quot; /&gt;&lt;/p&gt;
</content:encoded></item><item><title>Halo的部署安装</title><link>https://blog.minggh.cn/posts/public-content/tutorial/halo%E7%9A%84%E9%83%A8%E7%BD%B2%E5%AE%89%E8%A3%85/</link><guid isPermaLink="true">https://blog.minggh.cn/posts/public-content/tutorial/halo%E7%9A%84%E9%83%A8%E7%BD%B2%E5%AE%89%E8%A3%85/</guid><pubDate>Tue, 20 May 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h3&gt;使用Docker Compose部署Halo&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;mkdir ~/halo &amp;amp;&amp;amp; cd ~/halo
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;docker-compase安装halo&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;~/halo/docker-compose.yaml
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;version: &quot;3&quot;

services:
  halo:
    image: registry.fit2cloud.com/halo/halo:2.19
    restart: on-failure:3
    network_mode: &quot;host&quot;
    volumes:
      - ./halo2:/root/.halo2
    command:
      # 修改为自己已有的 MySQL 配置
      - --spring.r2dbc.url=r2dbc:pool:mysql://172.21.80.1:3307/halo
      - --spring.r2dbc.username=root
      - --spring.r2dbc.password=Hxl@121314
      - --spring.sql.init.platform=mysql
      # 外部访问地址，请根据实际需要修改
      - --halo.external-url=http://localhost:8090/
      # 端口号 默认8090
      - --server.port=8090
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;启动服务&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;docker-compose up -d
# 查看日志
docker-compose logs -f
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Docker CLI安装 halo&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;docker run -it -d --name halo -p 8090:8090 -v ~/.halo2:/root/.halo2 registry.fit2cloud.com/halo/halo:2.19
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;参考文档&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://docs.halo.run/getting-started/install/docker-compose/?current=external-db&quot;&gt;使用 Docker Compose 部署 | Halo 文档&lt;/a&gt;&lt;/p&gt;
</content:encoded></item><item><title>更换Git远程地址</title><link>https://blog.minggh.cn/posts/public-content/note/git%E4%BF%AE%E6%94%B9%E9%A1%B9%E7%9B%AE%E8%BF%9C%E7%A8%8B%E5%9C%B0%E5%9D%80/</link><guid isPermaLink="true">https://blog.minggh.cn/posts/public-content/note/git%E4%BF%AE%E6%94%B9%E9%A1%B9%E7%9B%AE%E8%BF%9C%E7%A8%8B%E5%9C%B0%E5%9D%80/</guid><pubDate>Thu, 21 Oct 2021 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;更换Git远程地址&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;[!TIP]&lt;/p&gt;
&lt;p&gt;在Git项目中更换远程仓库地址，常见于迁移项目、切换托管平台或更改访问协议（HTTPS/SSH）。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;方法一：使用 &lt;code&gt;git remote set-url&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;步骤：&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;查看当前远程地址&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;git remote -v
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;修改远程地址&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;git remote set-url origin https://new.repo.url/your-repo.git
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;验证修改&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;git remote -v
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;此方法适合仅更新URL而不改变远程名称的场景。&lt;/p&gt;
&lt;h2&gt;方法二：删除并重新添加远程仓库&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;步骤：&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;删除旧的远程仓库&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;git remote remove origin
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;添加新的远程仓库&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;git remote add origin https://new.repo.url/your-repo.git
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;确认修改&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;git remote -v
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;此方法适合需要彻底替换远程配置的情况。&lt;/p&gt;
&lt;h2&gt;方法三：直接编辑 &lt;code&gt;.git/config&lt;/code&gt; 文件&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;步骤：&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;打开*.git/config* 文件。&lt;/li&gt;
&lt;li&gt;找到 &lt;em&gt;[remote &quot;origin&quot;]&lt;/em&gt; 部分，修改 &lt;em&gt;url&lt;/em&gt; 为新地址。&lt;/li&gt;
&lt;li&gt;保存并关闭文件。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;此方法适合熟悉Git配置文件结构的高级用户。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;验证与推送建议：&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;修改完成后，首次推送需指定分支：&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;git push -u origin main
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;如果切换了HTTPS与SSH，确保凭证或密钥配置正确。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;strong&gt;最佳实践：&lt;/strong&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;保持 &lt;em&gt;origin&lt;/em&gt; 指向主要工作仓库，&lt;em&gt;upstream&lt;/em&gt; 指向上游仓库，便于协作。&lt;/li&gt;
&lt;li&gt;修改前先执行 &lt;em&gt;git fetch&lt;/em&gt; 同步最新代码，避免冲突。&lt;/li&gt;
&lt;/ul&gt;
</content:encoded></item><item><title>Java修改数组时报错</title><link>https://blog.minggh.cn/posts/public-content/note/java%E4%BF%AE%E6%94%B9%E6%95%B0%E7%BB%84%E6%97%B6%E6%8A%A5%E9%94%99/</link><guid isPermaLink="true">https://blog.minggh.cn/posts/public-content/note/java%E4%BF%AE%E6%94%B9%E6%95%B0%E7%BB%84%E6%97%B6%E6%8A%A5%E9%94%99/</guid><description>Java修改数组时报错UnsupportedOperationException</description><pubDate>Thu, 21 Oct 2021 00:00:00 GMT</pubDate><content:encoded>&lt;h3&gt;样例代码：&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;@Test
void t1(){
    String str = &quot;1,2,3&quot;;
    List&amp;lt;String&amp;gt; userIds = Arrays.asList(str.split(&quot;,&quot;));
    // List&amp;lt;String&amp;gt; userIds = List.of(str.split(&quot;,&quot;));
    userIds.add(&quot;4&quot;);
    userIds.remove(&quot;1&quot;);
    System.out.println(&quot;String.join(\&quot;,\&quot;, userIds) = &quot; + String.join(&quot;,&quot;, userIds));
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这个错误是因为java.util.Arrays.asList()方法返回的List对象实际上是AbstractList的一个实现，并且它背后关联的是一个数组。这种类型的List是不可变的，因此当你尝试添加或删除元素时，会抛出UnsupportedOperationException异常。
解决这个问题的方法是在创建List时确保它是可变的。你已经在代码中尝试通过Lists.newArrayList(Arrays.asList(str.split(&quot;,&quot;)));来转换成一个新的ArrayList实例，但是这里使用了Guava库中的Lists工具类。如果你的项目中已经引入了Guava库，那么这段代码是正确的；如果没有引入Guava库，则可以使用标准Java库中的方法来创建一个可变的List。&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;不可变列表&lt;/strong&gt;：&lt;code&gt;Arrays.asList&lt;/code&gt; 方法返回的是一个固定大小的列表，这意味着你不能向其中添加或删除元素。如果你尝试这样做，会抛出 &lt;code&gt;UnsupportedOperationException&lt;/code&gt;。&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;使用 &lt;code&gt;List.of&lt;/code&gt;&lt;/strong&gt;：你提到的 &lt;code&gt;List.of&lt;/code&gt; 方法也会返回一个不可变的列表，因此同样不能添加或删除元素。&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;正确的操作&lt;/strong&gt;：如果你想创建一个可变的列表并进行添加和删除操作，应该使用 &lt;code&gt;new ArrayList&lt;/code&gt;。&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;正确的代码：&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;@Test
void t1(){
    String str = &quot;1,2,3&quot;;
    List&amp;lt;String&amp;gt; userIds = new ArrayList&amp;lt;&amp;gt;(Arrays.asList(str.split(&quot;,&quot;)));
    // 或者使用 List.of 创建不可变列表后转换为可变列表
    // List&amp;lt;String&amp;gt; userIds = new ArrayList&amp;lt;&amp;gt;(List.of(str.split(&quot;,&quot;)));
    userIds.add(&quot;4&quot;);
    userIds.remove(&quot;1&quot;);
    System.out.println(&quot;String.join(\&quot;,\&quot;, userIds) = &quot; + String.join(&quot;,&quot;, userIds));
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;解释：&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;new ArrayList&amp;lt;&amp;gt;(Arrays.asList(str.split(&quot;,&quot;)))&lt;/code&gt;&lt;/strong&gt;：首先使用 &lt;code&gt;Arrays.asList&lt;/code&gt; 将字符串分割成列表，然后将其包装在 &lt;code&gt;ArrayList&lt;/code&gt; 中，这样就可以进行添加和删除操作。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;String.join(&quot;,&quot;, userIds)&lt;/code&gt;&lt;/strong&gt;：将列表中的元素用逗号连接成一个字符串。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;运行结果将是：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;String.join(&quot;,&quot;, userIds) = 2,3,4
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item></channel></rss>