<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://typecho.team/usr/plugins/Rss/rss-gradient.xsl"?>
<rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>TypechoTeam</title>
        <link>https://typecho.team/</link>
        <atom:link href="https://typecho.team/feed" rel="self" type="application/rss+xml" />
        <description>非官方主题站,分享Typecho的主题模板,插件,使用技巧,常见问题,代码等各种问题</description>
        <language>zh-CN</language>
        <lastBuildDate>Sat, 18 Jul 26 15:56:49 +0800</lastBuildDate>
        <lastBuildDateFormatted>2026年07月18日 15:56</lastBuildDateFormatted>
        <generator>Typecho RSS Plugin</generator>
                <item>
            <title>5 GB免费php空间/可绑定域名/无限流量/infinityfree</title>
            <link>https://typecho.team/archives/5-gb-free-php-spacebindable-domain-nameunlimited-datafinityfree.html</link>
            <guid isPermaLink="true">https://typecho.team/archives/5-gb-free-php-spacebindable-domain-nameunlimited-datafinityfree.html</guid>
            <pubDate>Fri, 17 Jul 26 10:15:00 +0800</pubDate>
            <pubDateFormatted>2026年07月17日10:15</pubDateFormatted>
            <dc:creator>TypechoTeam</dc:creator>
            <description><![CDATA[<h2>注册地址</h2><p><a href="https://dash.infinityfree.com/login">https://dash.infinityfree.com/login</a></p><h2>特点</h2><p>可以使用github或者google快速登录</p><p>可以创建无限量的域名/站点</p><p>可以创建无限量的mysql数据库</p><h2>演示地址</h2><p>演示地址 <a href="https://da.xo.je/">https://da.xo.je/</a></p>]]></description>
            <content:encoded><![CDATA[<h2>注册地址</h2><p><a href="https://dash.infinityfree.com/login">https://dash.infinityfree.com/login</a></p><h2>特点</h2><p>可以使用github或者google快速登录</p><p>可以创建无限量的域名/站点</p><p>可以创建无限量的mysql数据库</p><h2>演示地址</h2><p>演示地址 <a href="https://da.xo.je/">https://da.xo.je/</a></p>]]></content:encoded>
        </item>
                <item>
            <title>三栏Typecho主题 Clarity </title>
            <link>https://typecho.team/archives/three-column-typecho-theme-clarity.html</link>
            <guid isPermaLink="true">https://typecho.team/archives/three-column-typecho-theme-clarity.html</guid>
            <pubDate>Fri, 17 Jul 26 10:08:00 +0800</pubDate>
            <pubDateFormatted>2026年07月17日10:08</pubDateFormatted>
            <dc:creator>TypechoTeam</dc:creator>
            <description><![CDATA[<h2>简介</h2><p><img src="https://www.imsun.org/usr/themes/clarity/screenshot.png" alt="请输入图片描述" title="请输入图片描述"><br>从 <code>halo</code> 开源主题 Clarity 移植.. </p><p>保留大多数设置</p><h2>使用</h2><p>建议配合插件<code>Enhancement</code>一起使用过 效果更佳</p><h2>预览</h2><p>本站</p><h2>下载地址</h2><p><a href="https://github.com/jkjoy/theme-clarity">https://github.com/jkjoy/theme-clarity</a></p><h2>配置文档</h2><p><a href="https://www.imsun.org/Clarity-theme-docs/">https://www.imsun.org/Clarity-theme-docs/</a></p>]]></description>
            <content:encoded><![CDATA[<h2>简介</h2><p><img src="https://www.imsun.org/usr/themes/clarity/screenshot.png" alt="请输入图片描述" title="请输入图片描述"><br>从 <code>halo</code> 开源主题 Clarity 移植.. </p><p>保留大多数设置</p><h2>使用</h2><p>建议配合插件<code>Enhancement</code>一起使用过 效果更佳</p><h2>预览</h2><p>本站</p><h2>下载地址</h2><p><a href="https://github.com/jkjoy/theme-clarity">https://github.com/jkjoy/theme-clarity</a></p><h2>配置文档</h2><p><a href="https://www.imsun.org/Clarity-theme-docs/">https://www.imsun.org/Clarity-theme-docs/</a></p>]]></content:encoded>
        </item>
                <item>
            <title>Jaguar   -  又一款Typecho主题</title>
            <link>https://typecho.team/archives/jaguar-another-typecho-theme.html</link>
            <guid isPermaLink="true">https://typecho.team/archives/jaguar-another-typecho-theme.html</guid>
            <pubDate>Fri, 17 Jul 26 10:06:00 +0800</pubDate>
            <pubDateFormatted>2026年07月17日10:06</pubDateFormatted>
            <dc:creator>TypechoTeam</dc:creator>
            <description><![CDATA[<h2>前言</h2><p>依旧是从<code>bigfa</code>大佬的同名wordpress主题移植而来</p><p>保留大部分原汁原味的设置</p><h2>预览</h2><p>暂无</p><h2>演示站点</h2><p><a href="https://blog.sgcd.net">https://blog.sgcd.net</a></p><h2>下载地址</h2><p>[github=jkjoy/Typecho-Theme-Jaguar]</p><p>[info]喜欢就随手点个star 谢谢[/info]</p>]]></description>
            <content:encoded><![CDATA[<h2>前言</h2><p>依旧是从<code>bigfa</code>大佬的同名wordpress主题移植而来</p><p>保留大部分原汁原味的设置</p><h2>预览</h2><p>暂无</p><h2>演示站点</h2><p><a href="https://blog.sgcd.net">https://blog.sgcd.net</a></p><h2>下载地址</h2><p>[github=jkjoy/Typecho-Theme-Jaguar]</p><p>[info]喜欢就随手点个star 谢谢[/info]</p>]]></content:encoded>
        </item>
                <item>
            <title>Typecho单栏主题Timellow</title>
            <link>https://typecho.team/archives/typecho-single-column-theme-timelow.html</link>
            <guid isPermaLink="true">https://typecho.team/archives/typecho-single-column-theme-timelow.html</guid>
            <pubDate>Fri, 29 May 26 09:07:07 +0800</pubDate>
            <pubDateFormatted>2026年05月29日09:07</pubDateFormatted>
            <dc:creator>TypechoTeam</dc:creator>
            <description><![CDATA[<h2>简介</h2><p>老孙 手搓出来的主题 纯原创<br>主打的就是一个简洁无太多功能专注于写作本身</p><h2>预览</h2><p><img src="https://img.imsun.org/2026/04/4178034347.png" alt="image.png" title="image.png"></p><h2>开源地址</h2><p><a href="https://github.com/jkjoy/typecho-theme-timellow">https://github.com/jkjoy/typecho-theme-timellow</a><br>希望多多点点star,谢谢~</p><h2>演示地址</h2><p><a href="https://www.imsun.org">https://www.imsun.org</a></p>]]></description>
            <content:encoded><![CDATA[<h2>简介</h2><p>老孙 手搓出来的主题 纯原创<br>主打的就是一个简洁无太多功能专注于写作本身</p><h2>预览</h2><p><img src="https://img.imsun.org/2026/04/4178034347.png" alt="image.png" title="image.png"></p><h2>开源地址</h2><p><a href="https://github.com/jkjoy/typecho-theme-timellow">https://github.com/jkjoy/typecho-theme-timellow</a><br>希望多多点点star,谢谢~</p><h2>演示地址</h2><p><a href="https://www.imsun.org">https://www.imsun.org</a></p>]]></content:encoded>
        </item>
                <item>
            <title>Typecho 缝合怪插件 Enhancement </title>
            <link>https://typecho.team/archives/typecho-stitching-monster-plugin-enhancement.html</link>
            <guid isPermaLink="true">https://typecho.team/archives/typecho-stitching-monster-plugin-enhancement.html</guid>
            <pubDate>Tue, 03 Mar 26 09:05:34 +0800</pubDate>
            <pubDateFormatted>2026年03月03日09:05</pubDateFormatted>
            <dc:creator>TypechoTeam</dc:creator>
            <description><![CDATA[<h2>简介</h2><p>本插件进行了常用插件缝合,并针对主题进行了优化</p><h2>功能</h2><p>融合怪插件 —— 友链增强 + 瞬间 + 标签助手 + 站点地图 + 评论增强 + 外链跳转 + 视频链接解析 + QQ通知 + 邮件提醒 + 主题插件在线上传/删除等多功能于一体的 Typecho 插件。</p><ul><li>使用 typecho_links 数据表存储友链信息<br>输出方式：模板函数调用 + 文章内标签解析<br>三种输出模式：SHOW_TEXT / SHOW_IMG / SHOW_MIX，可在插件配置中自定义规则<br>管理面板：分类、拖拽排序、审核通过/驳回<br>游客提交：前台提交后默认待审核，仅通过审核的记录会输出</li><li>瞬间功能：新增 typecho_moments 表并提供 JSON API</li><li>评论同步：游客/登录用户评论时自动同步历史评论中的网址/昵称/邮箱</li><li>标签助手：后台写文章时显示标签快捷选择列表</li><li>站点地图：提供 /sitemap.xml</li><li>QQ评论通知：评论通过时通过 QQ 机器人推送</li><li>评论邮件提醒：支持 SMTP 推送，支持模板管理</li><li>可选Gravatar头像镜像加速</li><li>可选视频链接解析：自动将 YouTube / Bilibili / 优酷链接替换为播放器</li><li>可选音乐链接解析：自动将网易云音乐 / QQ音乐 / 酷狗音乐链接替换为 APlayer 播放器<br>禁用插件时可选择删除友情链接表/说说表/QQ通知队列表</li><li>可选外链新窗口打开：自动为 a 标签补充 target 与安全 rel</li><li>外链跳转提醒：文章/评论内外链及评论者网站地址统一走 /go/<base64> 中转提醒页</li><li>可选 Turnstile 人机验证：统一保护评论与友情链接提交<br>插件设置支持一键备份与一键恢复（数据库快照）</li><li>支持在线上传安装 ZIP 插件/主题，支持删除未启用插件和未启用主题</li><li>支持AI摘要</li><li>评论表情面板</li></ul><h2>安装</h2><p>上传到 usr/plugins/Enhancement<br>后台启用插件</p><h2>项目地址</h2><p><a href="https://github.com/jkjoy/Enhancement">https://github.com/jkjoy/Enhancement</a></p>]]></description>
            <content:encoded><![CDATA[<h2>简介</h2><p>本插件进行了常用插件缝合,并针对主题进行了优化</p><h2>功能</h2><p>融合怪插件 —— 友链增强 + 瞬间 + 标签助手 + 站点地图 + 评论增强 + 外链跳转 + 视频链接解析 + QQ通知 + 邮件提醒 + 主题插件在线上传/删除等多功能于一体的 Typecho 插件。</p><ul><li>使用 typecho_links 数据表存储友链信息<br>输出方式：模板函数调用 + 文章内标签解析<br>三种输出模式：SHOW_TEXT / SHOW_IMG / SHOW_MIX，可在插件配置中自定义规则<br>管理面板：分类、拖拽排序、审核通过/驳回<br>游客提交：前台提交后默认待审核，仅通过审核的记录会输出</li><li>瞬间功能：新增 typecho_moments 表并提供 JSON API</li><li>评论同步：游客/登录用户评论时自动同步历史评论中的网址/昵称/邮箱</li><li>标签助手：后台写文章时显示标签快捷选择列表</li><li>站点地图：提供 /sitemap.xml</li><li>QQ评论通知：评论通过时通过 QQ 机器人推送</li><li>评论邮件提醒：支持 SMTP 推送，支持模板管理</li><li>可选Gravatar头像镜像加速</li><li>可选视频链接解析：自动将 YouTube / Bilibili / 优酷链接替换为播放器</li><li>可选音乐链接解析：自动将网易云音乐 / QQ音乐 / 酷狗音乐链接替换为 APlayer 播放器<br>禁用插件时可选择删除友情链接表/说说表/QQ通知队列表</li><li>可选外链新窗口打开：自动为 a 标签补充 target 与安全 rel</li><li>外链跳转提醒：文章/评论内外链及评论者网站地址统一走 /go/<base64> 中转提醒页</li><li>可选 Turnstile 人机验证：统一保护评论与友情链接提交<br>插件设置支持一键备份与一键恢复（数据库快照）</li><li>支持在线上传安装 ZIP 插件/主题，支持删除未启用插件和未启用主题</li><li>支持AI摘要</li><li>评论表情面板</li></ul><h2>安装</h2><p>上传到 usr/plugins/Enhancement<br>后台启用插件</p><h2>项目地址</h2><p><a href="https://github.com/jkjoy/Enhancement">https://github.com/jkjoy/Enhancement</a></p>]]></content:encoded>
        </item>
                <item>
            <title>在编辑文章页面加上标签列表</title>
            <link>https://typecho.team/archives/add-a-tag-list-on-the-article-editing-page.html</link>
            <guid isPermaLink="true">https://typecho.team/archives/add-a-tag-list-on-the-article-editing-page.html</guid>
            <pubDate>Wed, 10 Dec 25 17:21:19 +0800</pubDate>
            <pubDateFormatted>2025年12月10日17:21</pubDateFormatted>
            <dc:creator>TypechoTeam</dc:creator>
            <description><![CDATA[<p>在编辑文章页面加上标签列表,点击填入标签栏.<br>方便快速添加文章标签</p><p>代码来自于泽泽社长的插件<code>tagshelper</code></p><pre><code class="lang-php">Typecho_Plugin::factory(&#039;admin/write-post.php&#039;)-&gt;bottom = array(&#039;tagshelper&#039;, &#039;tagslist&#039;);
class tagshelper{
    public static function tagslist(){   
        ?&gt;
        &lt;style&gt;.tagshelper a{cursor: pointer; padding: 0px 6px; margin: 2px 0;display: inline-block;border-radius: 2px;text-decoration: none;}
.tagshelper a:hover{background: #ccc;color: #fff;}&lt;/style&gt;
        &lt;script&gt; $(document).ready(function(){
        $(&#039;#tags&#039;).after(&#039;&lt;div style=&quot;margin-top: 35px;&quot; class=&quot;tagshelper&quot;&gt;&lt;ul style=&quot;list-style: none;border: 1px solid #D9D9D6;padding: 6px 12px; max-height: 240px;overflow: auto;background-color: #FFF;border-radius: 2px;&quot;&gt;&lt;?php
        $i=0;
        Typecho_Widget::widget(&#039;Widget_Metas_Tag_Cloud&#039;, &#039;sort=count&amp;desc=1&amp;limit=200&#039;)-&gt;to($tags);
            while ($tags-&gt;next()) {
                echo &quot;&lt;a id=&quot;.$i.&quot; onclick=\&quot;$(\&#039;#tags\&#039;).tokenInput(\&#039;add\&#039;, {id: \&#039;&quot;.$tags-&gt;name.&quot;\&#039;, tags: \&#039;&quot;.$tags-&gt;name.&quot;\&#039;});\&quot;&gt;&quot;.$tags-&gt;name.&quot;&lt;/a&gt;&quot;;
                    $i++;}?&gt;&lt;/ul&gt;&lt;/div&gt;&#039;);});&lt;/script&gt;
        &lt;?php
    }
}</code></pre>]]></description>
            <content:encoded><![CDATA[<p>在编辑文章页面加上标签列表,点击填入标签栏.<br>方便快速添加文章标签</p><p>代码来自于泽泽社长的插件<code>tagshelper</code></p><pre><code class="lang-php">Typecho_Plugin::factory(&#039;admin/write-post.php&#039;)-&gt;bottom = array(&#039;tagshelper&#039;, &#039;tagslist&#039;);
class tagshelper{
    public static function tagslist(){   
        ?&gt;
        &lt;style&gt;.tagshelper a{cursor: pointer; padding: 0px 6px; margin: 2px 0;display: inline-block;border-radius: 2px;text-decoration: none;}
.tagshelper a:hover{background: #ccc;color: #fff;}&lt;/style&gt;
        &lt;script&gt; $(document).ready(function(){
        $(&#039;#tags&#039;).after(&#039;&lt;div style=&quot;margin-top: 35px;&quot; class=&quot;tagshelper&quot;&gt;&lt;ul style=&quot;list-style: none;border: 1px solid #D9D9D6;padding: 6px 12px; max-height: 240px;overflow: auto;background-color: #FFF;border-radius: 2px;&quot;&gt;&lt;?php
        $i=0;
        Typecho_Widget::widget(&#039;Widget_Metas_Tag_Cloud&#039;, &#039;sort=count&amp;desc=1&amp;limit=200&#039;)-&gt;to($tags);
            while ($tags-&gt;next()) {
                echo &quot;&lt;a id=&quot;.$i.&quot; onclick=\&quot;$(\&#039;#tags\&#039;).tokenInput(\&#039;add\&#039;, {id: \&#039;&quot;.$tags-&gt;name.&quot;\&#039;, tags: \&#039;&quot;.$tags-&gt;name.&quot;\&#039;});\&quot;&gt;&quot;.$tags-&gt;name.&quot;&lt;/a&gt;&quot;;
                    $i++;}?&gt;&lt;/ul&gt;&lt;/div&gt;&#039;);});&lt;/script&gt;
        &lt;?php
    }
}</code></pre>]]></content:encoded>
        </item>
                <item>
            <title>Typecho 下载地址</title>
            <link>https://typecho.team/archives/typecho-download-link.html</link>
            <guid isPermaLink="true">https://typecho.team/archives/typecho-download-link.html</guid>
            <pubDate>Sun, 30 Nov 25 13:43:54 +0800</pubDate>
            <pubDateFormatted>2025年11月30日13:43</pubDateFormatted>
            <dc:creator>TypechoTeam</dc:creator>
            <description><![CDATA[<h2>项目地址</h2><p><a href="https://github.com/typecho/typecho">https://github.com/typecho/typecho</a></p><h2>下载地址</h2><p>[download file='typecho.zip' size='586kb']<a href="https://github.com/typecho/typecho/releases/latest/download/typecho.zip">https://github.com/typecho/typecho/releases/latest/download/typecho.zip</a>[/download]</p>]]></description>
            <content:encoded><![CDATA[<h2>项目地址</h2><p><a href="https://github.com/typecho/typecho">https://github.com/typecho/typecho</a></p><h2>下载地址</h2><p>[download file='typecho.zip' size='586kb']<a href="https://github.com/typecho/typecho/releases/latest/download/typecho.zip">https://github.com/typecho/typecho/releases/latest/download/typecho.zip</a>[/download]</p>]]></content:encoded>
        </item>
                <item>
            <title>Puock - 高颜值的Typecho主题</title>
            <link>https://typecho.team/archives/puock-high-beauty-typecho-theme.html</link>
            <guid isPermaLink="true">https://typecho.team/archives/puock-high-beauty-typecho-theme.html</guid>
            <pubDate>Mon, 20 Oct 25 14:35:45 +0800</pubDate>
            <pubDateFormatted>2025年10月20日14:35</pubDateFormatted>
            <dc:creator>TypechoTeam</dc:creator>
            <description><![CDATA[<h2>说明</h2><p>本主题移植自开源项目<br><a href="https://github.com/Licoy/wordpress-theme-puock">https://github.com/Licoy/wordpress-theme-puock</a><br>原项目为<code>WordPress</code>主题.</p><h2>预览</h2><p>本站</p><h2>使用指南</h2><p>适用于<code>Typecho</code> 1.2.0 以上版本</p><p>[danger]注意事项[/danger] </p><p>部分功能需要使用插件<code>Puock</code>来实现<br>插件地址 <a href="https://github.com/jkjoy/typecho-plugin-puock">Puock</a></p><h2>项目地址</h2><p><a href="https://github.com/jkjoy/Typecho-Theme-Puock">https://github.com/jkjoy/Typecho-Theme-Puock</a></p>]]></description>
            <content:encoded><![CDATA[<h2>说明</h2><p>本主题移植自开源项目<br><a href="https://github.com/Licoy/wordpress-theme-puock">https://github.com/Licoy/wordpress-theme-puock</a><br>原项目为<code>WordPress</code>主题.</p><h2>预览</h2><p>本站</p><h2>使用指南</h2><p>适用于<code>Typecho</code> 1.2.0 以上版本</p><p>[danger]注意事项[/danger] </p><p>部分功能需要使用插件<code>Puock</code>来实现<br>插件地址 <a href="https://github.com/jkjoy/typecho-plugin-puock">Puock</a></p><h2>项目地址</h2><p><a href="https://github.com/jkjoy/Typecho-Theme-Puock">https://github.com/jkjoy/Typecho-Theme-Puock</a></p>]]></content:encoded>
        </item>
                <item>
            <title>Typecho RSS 全文输出美化插件</title>
            <link>https://typecho.team/archives/typecho-rss-fulltext-output-beautification-plugin.html</link>
            <guid isPermaLink="true">https://typecho.team/archives/typecho-rss-fulltext-output-beautification-plugin.html</guid>
            <pubDate>Mon, 20 Oct 25 14:32:00 +0800</pubDate>
            <pubDateFormatted>2025年10月20日14:32</pubDateFormatted>
            <dc:creator>TypechoTeam</dc:creator>
            <description><![CDATA[<p>一个功能强大的 Typecho RSS 插件，支持全文输出和多种美化显示风格。</p><h2>功能特点</h2><ul><li><strong>全文输出</strong>: 支持输出文章全文或摘要</li><li><strong>多种主题</strong>: 提供 4 种精美样式主题供选择</li><li><strong>美化显示</strong>: 在浏览器中直接打开 RSS 链接时显示美观的界面</li><li><strong>灵活配置</strong>: 可自定义文章数量、输出内容、版权信息等</li><li><strong>响应式设计</strong>: 完美适配桌面和移动设备</li><li><strong>接管原生路由</strong>: 完全接管 Typecho 的 <code>/feed</code> 路由</li></ul><h2>安装方法</h2><ol><li><p>下载插件到 Typecho 插件目录：</p><pre><code>/usr/plugins/Rss/</code></pre></li><li><p>在 Typecho 后台启用插件：</p><ul><li>进入 <strong>控制台</strong> → <strong>插件</strong> → <strong>已安装插件</strong></li><li>找到 <strong>Rss</strong> 插件，点击 <strong>启用</strong></li></ul></li><li><p>配置插件（可选）：</p><ul><li>点击插件的 <strong>设置</strong> 按钮</li><li>根据需要调整配置选项</li></ul></li></ol><h2>配置选项</h2><h3>RSS 文章数量</h3><ul><li>设置 RSS 输出的文章数量</li><li>默认为 20 篇</li><li>设置为 0 则输出全部文章</li></ul><h3>RSS 内容输出</h3><ul><li><strong>输出全文</strong>: 在 RSS 中显示文章完整内容</li><li><strong>输出摘要</strong>: 仅显示文章摘要（前 200 字符）</li></ul><h3>RSS 样式美化</h3><ul><li><strong>启用</strong>: 在浏览器中访问时显示美化界面</li><li><strong>禁用</strong>: 输出纯 XML 格式</li></ul><h3>样式主题</h3><p>插件提供 4 种不同风格的主题供选择：</p><ol><li><p><strong>渐变风格 (gradient)</strong> - 默认主题</p><ul><li>紫色渐变背景</li><li>现代感强，视觉冲击力强</li><li>卡片式布局，悬停动画</li><li>适合个人博客、创意类网站</li></ul></li><li><p><strong>简洁风格 (minimal)</strong></p><ul><li>黑白配色，简约设计</li><li>清爽干净，专注内容</li><li>类似报纸排版</li><li>适合技术博客、文字类内容</li></ul></li><li><p><strong>现代风格 (modern)</strong></p><ul><li>蓝色系商务风格</li><li>专业大气，层次分明</li><li>卡片阴影，渐变头部</li><li>适合企业博客、专业网站</li></ul></li><li><p><strong>暗黑风格 (dark)</strong></p><ul><li>深色主题，护眼舒适</li><li>GitHub 风格配色</li><li>自定义滚动条美化</li><li>适合夜间阅读、开发者</li></ul></li></ol><h3>版权信息</h3><ul><li>在每篇文章末尾添加自定义版权信息</li><li>支持 HTML 标签</li><li><p>示例：</p><pre><code class="lang-html">&lt;p&gt;本文由 &lt;a href=&quot;https://example.com&quot;&gt;我的博客&lt;/a&gt; 原创发布&lt;/p&gt;
&lt;p&gt;转载请注明出处&lt;/p&gt;</code></pre></li></ul><h2>使用方法</h2><p>启用插件后，可以通过以下 URL 访问 RSS：</p><h3>主要访问地址</h3><pre><code>https://你的域名/feed</code></pre><p>插件会自动接管 Typecho 原生的 <code>/feed</code> 路由，使用美化后的 RSS 输出。</p><h3>在 RSS 阅读器中订阅</h3><p>将上述任一地址复制到您的 RSS 阅读器（如 Feedly、Inoreader 等）中即可订阅。</p><h3>在浏览器中访问</h3><p>直接在浏览器中打开上述地址，将看到美化后的 RSS 页面。根据你在插件设置中选择的主题，会显示不同风格：</p><ul><li><strong>渐变风格</strong>: 紫色渐变背景 + 白色卡片</li><li><strong>简洁风格</strong>: 纯白背景 + 黑白排版</li><li><strong>现代风格</strong>: 蓝色渐变头部 + 灰白背景</li><li><strong>暗黑风格</strong>: 深色背景 + 蓝色点缀</li></ul><h2>主题样式预览</h2><h3>渐变风格 (Gradient)</h3><ul><li>视觉特点: 紫色渐变背景，白色圆角卡片</li><li>配色方案: <code>#667eea</code> → <code>#764ba2</code></li><li>适用场景: 个人博客、创意网站</li><li>设计元素: 悬停动画、阴影效果、圆角设计</li></ul><h3>简洁风格 (Minimal)</h3><ul><li>视觉特点: 黑白配色，线条分割</li><li>配色方案: <code>#000</code> + <code>#fff</code> + <code>#666</code></li><li>适用场景: 技术博客、专业内容</li><li>设计元素: 极简排版、下划线链接、报纸式布局</li></ul><h3>现代风格 (Modern)</h3><ul><li>视觉特点: 蓝色系商务风格</li><li>配色方案: <code>#0066cc</code> → <code>#0052a3</code></li><li>适用场景: 企业网站、专业机构</li><li>设计元素: 卡片悬停效果、徽章标签、渐变头部</li></ul><h3>暗黑风格 (Dark)</h3><ul><li>视觉特点: GitHub 式深色主题</li><li>配色方案: <code>#0d1117</code> + <code>#58a6ff</code></li><li>适用场景: 开发者博客、夜间阅读</li><li>设计元素: 自定义滚动条、蓝色链接、暗色卡片</li></ul><h2>常见问题</h2><h3>Q: 启用插件后无法访问 RSS？</h3><p>A: 请检查您的 Typecho 是否开启了路由重写功能。</p><h3>Q: RSS 中图片无法显示？</h3><p>A: 请确保文章中的图片使用的是绝对路径。</p><h3>Q: 如何关闭样式美化？</h3><p>A: 在插件设置中将"RSS 样式美化"设置为"禁用"即可。</p><h3>Q: 可以自定义样式吗？</h3><p>A: 可以，直接修改 <code>rss.xsl</code> 文件中的 CSS 部分。</p><h2>版本历史</h2><h3>v1.0.0</h3><ul><li>初始版本发布</li><li>支持全文 RSS 输出</li><li>支持 XSL 样式美化</li><li>提供灵活的配置选项</li></ul><h2>许可证</h2><p>本插件遵循 MIT 许可证开源。</p><h2>反馈与支持</h2><p>如有问题或建议，欢迎通过以下方式反馈：</p><ul><li>提交 Issue</li><li>发送邮件</li><li>在博客留言</li></ul><h2>项目地址</h2><h2><a href="https://github.com/jkjoy/Typecho-Plugin-Rss">https://github.com/jkjoy/Typecho-Plugin-Rss</a></h2><p><strong>享受优雅的 RSS 订阅体验！</strong></p>]]></description>
            <content:encoded><![CDATA[<p>一个功能强大的 Typecho RSS 插件，支持全文输出和多种美化显示风格。</p><h2>功能特点</h2><ul><li><strong>全文输出</strong>: 支持输出文章全文或摘要</li><li><strong>多种主题</strong>: 提供 4 种精美样式主题供选择</li><li><strong>美化显示</strong>: 在浏览器中直接打开 RSS 链接时显示美观的界面</li><li><strong>灵活配置</strong>: 可自定义文章数量、输出内容、版权信息等</li><li><strong>响应式设计</strong>: 完美适配桌面和移动设备</li><li><strong>接管原生路由</strong>: 完全接管 Typecho 的 <code>/feed</code> 路由</li></ul><h2>安装方法</h2><ol><li><p>下载插件到 Typecho 插件目录：</p><pre><code>/usr/plugins/Rss/</code></pre></li><li><p>在 Typecho 后台启用插件：</p><ul><li>进入 <strong>控制台</strong> → <strong>插件</strong> → <strong>已安装插件</strong></li><li>找到 <strong>Rss</strong> 插件，点击 <strong>启用</strong></li></ul></li><li><p>配置插件（可选）：</p><ul><li>点击插件的 <strong>设置</strong> 按钮</li><li>根据需要调整配置选项</li></ul></li></ol><h2>配置选项</h2><h3>RSS 文章数量</h3><ul><li>设置 RSS 输出的文章数量</li><li>默认为 20 篇</li><li>设置为 0 则输出全部文章</li></ul><h3>RSS 内容输出</h3><ul><li><strong>输出全文</strong>: 在 RSS 中显示文章完整内容</li><li><strong>输出摘要</strong>: 仅显示文章摘要（前 200 字符）</li></ul><h3>RSS 样式美化</h3><ul><li><strong>启用</strong>: 在浏览器中访问时显示美化界面</li><li><strong>禁用</strong>: 输出纯 XML 格式</li></ul><h3>样式主题</h3><p>插件提供 4 种不同风格的主题供选择：</p><ol><li><p><strong>渐变风格 (gradient)</strong> - 默认主题</p><ul><li>紫色渐变背景</li><li>现代感强，视觉冲击力强</li><li>卡片式布局，悬停动画</li><li>适合个人博客、创意类网站</li></ul></li><li><p><strong>简洁风格 (minimal)</strong></p><ul><li>黑白配色，简约设计</li><li>清爽干净，专注内容</li><li>类似报纸排版</li><li>适合技术博客、文字类内容</li></ul></li><li><p><strong>现代风格 (modern)</strong></p><ul><li>蓝色系商务风格</li><li>专业大气，层次分明</li><li>卡片阴影，渐变头部</li><li>适合企业博客、专业网站</li></ul></li><li><p><strong>暗黑风格 (dark)</strong></p><ul><li>深色主题，护眼舒适</li><li>GitHub 风格配色</li><li>自定义滚动条美化</li><li>适合夜间阅读、开发者</li></ul></li></ol><h3>版权信息</h3><ul><li>在每篇文章末尾添加自定义版权信息</li><li>支持 HTML 标签</li><li><p>示例：</p><pre><code class="lang-html">&lt;p&gt;本文由 &lt;a href=&quot;https://example.com&quot;&gt;我的博客&lt;/a&gt; 原创发布&lt;/p&gt;
&lt;p&gt;转载请注明出处&lt;/p&gt;</code></pre></li></ul><h2>使用方法</h2><p>启用插件后，可以通过以下 URL 访问 RSS：</p><h3>主要访问地址</h3><pre><code>https://你的域名/feed</code></pre><p>插件会自动接管 Typecho 原生的 <code>/feed</code> 路由，使用美化后的 RSS 输出。</p><h3>在 RSS 阅读器中订阅</h3><p>将上述任一地址复制到您的 RSS 阅读器（如 Feedly、Inoreader 等）中即可订阅。</p><h3>在浏览器中访问</h3><p>直接在浏览器中打开上述地址，将看到美化后的 RSS 页面。根据你在插件设置中选择的主题，会显示不同风格：</p><ul><li><strong>渐变风格</strong>: 紫色渐变背景 + 白色卡片</li><li><strong>简洁风格</strong>: 纯白背景 + 黑白排版</li><li><strong>现代风格</strong>: 蓝色渐变头部 + 灰白背景</li><li><strong>暗黑风格</strong>: 深色背景 + 蓝色点缀</li></ul><h2>主题样式预览</h2><h3>渐变风格 (Gradient)</h3><ul><li>视觉特点: 紫色渐变背景，白色圆角卡片</li><li>配色方案: <code>#667eea</code> → <code>#764ba2</code></li><li>适用场景: 个人博客、创意网站</li><li>设计元素: 悬停动画、阴影效果、圆角设计</li></ul><h3>简洁风格 (Minimal)</h3><ul><li>视觉特点: 黑白配色，线条分割</li><li>配色方案: <code>#000</code> + <code>#fff</code> + <code>#666</code></li><li>适用场景: 技术博客、专业内容</li><li>设计元素: 极简排版、下划线链接、报纸式布局</li></ul><h3>现代风格 (Modern)</h3><ul><li>视觉特点: 蓝色系商务风格</li><li>配色方案: <code>#0066cc</code> → <code>#0052a3</code></li><li>适用场景: 企业网站、专业机构</li><li>设计元素: 卡片悬停效果、徽章标签、渐变头部</li></ul><h3>暗黑风格 (Dark)</h3><ul><li>视觉特点: GitHub 式深色主题</li><li>配色方案: <code>#0d1117</code> + <code>#58a6ff</code></li><li>适用场景: 开发者博客、夜间阅读</li><li>设计元素: 自定义滚动条、蓝色链接、暗色卡片</li></ul><h2>常见问题</h2><h3>Q: 启用插件后无法访问 RSS？</h3><p>A: 请检查您的 Typecho 是否开启了路由重写功能。</p><h3>Q: RSS 中图片无法显示？</h3><p>A: 请确保文章中的图片使用的是绝对路径。</p><h3>Q: 如何关闭样式美化？</h3><p>A: 在插件设置中将"RSS 样式美化"设置为"禁用"即可。</p><h3>Q: 可以自定义样式吗？</h3><p>A: 可以，直接修改 <code>rss.xsl</code> 文件中的 CSS 部分。</p><h2>版本历史</h2><h3>v1.0.0</h3><ul><li>初始版本发布</li><li>支持全文 RSS 输出</li><li>支持 XSL 样式美化</li><li>提供灵活的配置选项</li></ul><h2>许可证</h2><p>本插件遵循 MIT 许可证开源。</p><h2>反馈与支持</h2><p>如有问题或建议，欢迎通过以下方式反馈：</p><ul><li>提交 Issue</li><li>发送邮件</li><li>在博客留言</li></ul><h2>项目地址</h2><h2><a href="https://github.com/jkjoy/Typecho-Plugin-Rss">https://github.com/jkjoy/Typecho-Plugin-Rss</a></h2><p><strong>享受优雅的 RSS 订阅体验！</strong></p>]]></content:encoded>
        </item>
                <item>
            <title>Typecho 伪静态重写规则</title>
            <link>https://typecho.team/archives/typecho-pseudo-static-rewrite-rule.html</link>
            <guid isPermaLink="true">https://typecho.team/archives/typecho-pseudo-static-rewrite-rule.html</guid>
            <pubDate>Wed, 03 Sep 25 14:23:01 +0800</pubDate>
            <pubDateFormatted>2025年09月03日14:23</pubDateFormatted>
            <dc:creator>TypechoTeam</dc:creator>
            <description><![CDATA[<h2>Apache</h2><pre><code>&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
&lt;/IfModule&gt;</code></pre><h2>Nginx</h2><pre><code>    if (!-e $request_filename) {
        rewrite ^(.*)$ /index.php$1 last;
    }</code></pre>]]></description>
            <content:encoded><![CDATA[<h2>Apache</h2><pre><code>&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
&lt;/IfModule&gt;</code></pre><h2>Nginx</h2><pre><code>    if (!-e $request_filename) {
        rewrite ^(.*)$ /index.php$1 last;
    }</code></pre>]]></content:encoded>
        </item>
                <item>
            <title>Typecho启用gzip优化加载速度</title>
            <link>https://typecho.team/archives/typecho-enables-gzip-optimization-for-loading-speed.html</link>
            <guid isPermaLink="true">https://typecho.team/archives/typecho-enables-gzip-optimization-for-loading-speed.html</guid>
            <pubDate>Thu, 21 Aug 25 18:21:00 +0800</pubDate>
            <pubDateFormatted>2025年08月21日18:21</pubDateFormatted>
            <dc:creator>TypechoTeam</dc:creator>
            <description><![CDATA[<p>开启GZIP可以用来加快网站的打开速度 </p><p>要如何开启GZIP压缩呢？</p><p>找到网站根目录下的<code>index.php</code>文件，直接在<code>&lt;?php</code>下面加入以下代码</p><pre><code class="lang-php">ob_start(&#039;ob_gzhandler&#039;);</code></pre><p>即可..</p>]]></description>
            <content:encoded><![CDATA[<p>开启GZIP可以用来加快网站的打开速度 </p><p>要如何开启GZIP压缩呢？</p><p>找到网站根目录下的<code>index.php</code>文件，直接在<code>&lt;?php</code>下面加入以下代码</p><pre><code class="lang-php">ob_start(&#039;ob_gzhandler&#039;);</code></pre><p>即可..</p>]]></content:encoded>
        </item>
                <item>
            <title>使用ClawCloud免费部署Typecho服务</title>
            <link>https://typecho.team/archives/deploy-typecho-service-for-free-using-clawcloud.html</link>
            <guid isPermaLink="true">https://typecho.team/archives/deploy-typecho-service-for-free-using-clawcloud.html</guid>
            <pubDate>Sat, 02 Aug 25 14:45:00 +0800</pubDate>
            <pubDateFormatted>2025年08月02日14:45</pubDateFormatted>
            <dc:creator>TypechoTeam</dc:creator>
            <description><![CDATA[<h2>简介</h2><p>免费用户支持</p><ul><li>赠送5美元每月</li><li>最高10G持久化硬盘</li><li>若干流量</li><li>多个区域可选择</li><li>最多4个容器</li></ul><h2>注册地址</h2><p><a href="https://console.run.claw.cloud/signin?link=99YV1E2JD76E">https://console.run.claw.cloud/signin?link=99YV1E2JD76E</a></p><p>可通过google账号或者github账号直接登录</p><h2>部署</h2><p><img src="https://img.memos.ee/typecho/2025/08/1252295069.png" alt="2025-08-01T10:14:28.png" title="2025-08-01T10:14:28.png"><br>点此开始</p><p><img src="https://img.memos.ee/typecho/2025/08/2556795925.png" alt="2025-08-01T10:15:02.png" title="2025-08-01T10:15:02.png"><br>创建应用</p><p><img src="https://img.memos.ee/typecho/2025/08/1086663058.png" alt="2025-08-01T10:15:58.png" title="2025-08-01T10:15:58.png"></p><p>填写信息<br><code>Application Name</code>自己填写 如<code>blog</code> <br><code>Image Name</code> 就写Docker镜像的地址</p><pre><code>jkjoy/php83</code></pre><p><code>Usage</code>则根据你的需要选择,不要超过额度</p><p><code>Port</code> 填写 <code>80</code> </p><p><img src="https://img.memos.ee/typecho/2025/08/1366572739.png" alt="2025-08-01T10:22:19.png" title="2025-08-01T10:22:19.png"><br>此处需要设置好端口以及绑定域名</p><p>添加硬盘挂载路径</p><p><code>/app</code></p><p>点击<code>Deploy</code>部署</p><p><img src="https://img.memos.ee/typecho/2025/08/767309727.png" alt="2025-08-01T10:25:31.png" title="2025-08-01T10:25:31.png"></p><h2>演示</h2><p>本站地址</p>]]></description>
            <content:encoded><![CDATA[<h2>简介</h2><p>免费用户支持</p><ul><li>赠送5美元每月</li><li>最高10G持久化硬盘</li><li>若干流量</li><li>多个区域可选择</li><li>最多4个容器</li></ul><h2>注册地址</h2><p><a href="https://console.run.claw.cloud/signin?link=99YV1E2JD76E">https://console.run.claw.cloud/signin?link=99YV1E2JD76E</a></p><p>可通过google账号或者github账号直接登录</p><h2>部署</h2><p><img src="https://img.memos.ee/typecho/2025/08/1252295069.png" alt="2025-08-01T10:14:28.png" title="2025-08-01T10:14:28.png"><br>点此开始</p><p><img src="https://img.memos.ee/typecho/2025/08/2556795925.png" alt="2025-08-01T10:15:02.png" title="2025-08-01T10:15:02.png"><br>创建应用</p><p><img src="https://img.memos.ee/typecho/2025/08/1086663058.png" alt="2025-08-01T10:15:58.png" title="2025-08-01T10:15:58.png"></p><p>填写信息<br><code>Application Name</code>自己填写 如<code>blog</code> <br><code>Image Name</code> 就写Docker镜像的地址</p><pre><code>jkjoy/php83</code></pre><p><code>Usage</code>则根据你的需要选择,不要超过额度</p><p><code>Port</code> 填写 <code>80</code> </p><p><img src="https://img.memos.ee/typecho/2025/08/1366572739.png" alt="2025-08-01T10:22:19.png" title="2025-08-01T10:22:19.png"><br>此处需要设置好端口以及绑定域名</p><p>添加硬盘挂载路径</p><p><code>/app</code></p><p>点击<code>Deploy</code>部署</p><p><img src="https://img.memos.ee/typecho/2025/08/767309727.png" alt="2025-08-01T10:25:31.png" title="2025-08-01T10:25:31.png"></p><h2>演示</h2><p>本站地址</p>]]></content:encoded>
        </item>
                <item>
            <title>创建一个跳转随机文章的独立页面</title>
            <link>https://typecho.team/archives/create-an-independent-page-that-redirects-to-random-articles.html</link>
            <guid isPermaLink="true">https://typecho.team/archives/create-an-independent-page-that-redirects-to-random-articles.html</guid>
            <pubDate>Sat, 02 Aug 25 14:33:00 +0800</pubDate>
            <pubDateFormatted>2025年08月02日14:33</pubDateFormatted>
            <dc:creator>TypechoTeam</dc:creator>
            <description><![CDATA[<h2>介绍</h2><p>创建一个随机阅读的独立页面</p><h2>演示</h2><p><a href="https://typecho.team/random.html">https://typecho.team/random.html</a></p><h2>实现</h2><pre><code>&lt;?php
/**
 * 随机阅读
 *
 * @package custom
 */
if (!defined(&#039;__TYPECHO_ROOT_DIR__&#039;)) exit;

$db = Typecho_Db::get();

// 统计符合条件的文章总数
$countSql = $db-&gt;select(&#039;COUNT(*) AS count&#039;)
    -&gt;from(&#039;table.contents&#039;)
    -&gt;where(&#039;status = ?&#039;, &#039;publish&#039;)
    -&gt;where(&#039;type = ?&#039;, &#039;post&#039;)
    -&gt;where(&#039;created &lt;= ?&#039;, time());
$countResult = $db-&gt;fetchRow($countSql);
$total = $countResult[&#039;count&#039;];

if ($total &gt; 0) {
    // 随机选择一个偏移量
    $offset = mt_rand(0, $total - 1);

    // 根据偏移量获取一篇文章
    $sql = $db-&gt;select()
        -&gt;from(&#039;table.contents&#039;)
        -&gt;where(&#039;status = ?&#039;, &#039;publish&#039;)
        -&gt;where(&#039;type = ?&#039;, &#039;post&#039;)
        -&gt;where(&#039;created &lt;= ?&#039;, time())
        -&gt;limit(1)
        -&gt;offset($offset);

    $result = $db-&gt;fetchRow($sql);

    if (!empty($result)) {
        $target = Typecho_Widget::widget(&#039;Widget_Abstract_Contents&#039;)-&gt;filter($result);
        $this-&gt;response-&gt;redirect($target[&#039;permalink&#039;], 307);
    }
}

// 如果没有找到文章，重定向到首页
$this-&gt;response-&gt;redirect($this-&gt;options-&gt;siteUrl, 307);
?&gt;</code></pre><p>然后在后台的独立页面处选择模板.</p>]]></description>
            <content:encoded><![CDATA[<h2>介绍</h2><p>创建一个随机阅读的独立页面</p><h2>演示</h2><p><a href="https://typecho.team/random.html">https://typecho.team/random.html</a></p><h2>实现</h2><pre><code>&lt;?php
/**
 * 随机阅读
 *
 * @package custom
 */
if (!defined(&#039;__TYPECHO_ROOT_DIR__&#039;)) exit;

$db = Typecho_Db::get();

// 统计符合条件的文章总数
$countSql = $db-&gt;select(&#039;COUNT(*) AS count&#039;)
    -&gt;from(&#039;table.contents&#039;)
    -&gt;where(&#039;status = ?&#039;, &#039;publish&#039;)
    -&gt;where(&#039;type = ?&#039;, &#039;post&#039;)
    -&gt;where(&#039;created &lt;= ?&#039;, time());
$countResult = $db-&gt;fetchRow($countSql);
$total = $countResult[&#039;count&#039;];

if ($total &gt; 0) {
    // 随机选择一个偏移量
    $offset = mt_rand(0, $total - 1);

    // 根据偏移量获取一篇文章
    $sql = $db-&gt;select()
        -&gt;from(&#039;table.contents&#039;)
        -&gt;where(&#039;status = ?&#039;, &#039;publish&#039;)
        -&gt;where(&#039;type = ?&#039;, &#039;post&#039;)
        -&gt;where(&#039;created &lt;= ?&#039;, time())
        -&gt;limit(1)
        -&gt;offset($offset);

    $result = $db-&gt;fetchRow($sql);

    if (!empty($result)) {
        $target = Typecho_Widget::widget(&#039;Widget_Abstract_Contents&#039;)-&gt;filter($result);
        $this-&gt;response-&gt;redirect($target[&#039;permalink&#039;], 307);
    }
}

// 如果没有找到文章，重定向到首页
$this-&gt;response-&gt;redirect($this-&gt;options-&gt;siteUrl, 307);
?&gt;</code></pre><p>然后在后台的独立页面处选择模板.</p>]]></content:encoded>
        </item>
                <item>
            <title>Typecho获取页面加载时间</title>
            <link>https://typecho.team/archives/runtime.html</link>
            <guid isPermaLink="true">https://typecho.team/archives/runtime.html</guid>
            <pubDate>Wed, 18 Jun 25 14:05:17 +0800</pubDate>
            <pubDateFormatted>2025年06月18日14:05</pubDateFormatted>
            <dc:creator>TypechoTeam</dc:creator>
            <description><![CDATA[<p>在主题<code>functions.php</code>中插入</p><pre><code class="lang-php">/**
* 页面加载时间
*/
function timer_start() {
    global $timestart;
    $mtime = explode( &#039; &#039;, microtime() );
    $timestart = $mtime[1] + $mtime[0];
    return true;
}
    timer_start();
function timer_stop( $display = 0, $precision = 3 ) {
    global $timestart, $timeend;
    $mtime = explode( &#039; &#039;, microtime() );
    $timeend = $mtime[1] + $mtime[0];
    $timetotal = number_format( $timeend - $timestart, $precision );
    $r = $timetotal &lt; 1 ? $timetotal * 1000 . &quot; ms&quot; : $timetotal . &quot; s&quot;;
    if ( $display ) {
    echo $r;
    }
    return $r;
}</code></pre><p>在主题合适位置引入</p><pre><code class="lang-php">&lt;?php _e(&#039;页面加载耗时&#039;); ?&gt;&lt;?php echo timer_stop();?&gt;</code></pre>]]></description>
            <content:encoded><![CDATA[<p>在主题<code>functions.php</code>中插入</p><pre><code class="lang-php">/**
* 页面加载时间
*/
function timer_start() {
    global $timestart;
    $mtime = explode( &#039; &#039;, microtime() );
    $timestart = $mtime[1] + $mtime[0];
    return true;
}
    timer_start();
function timer_stop( $display = 0, $precision = 3 ) {
    global $timestart, $timeend;
    $mtime = explode( &#039; &#039;, microtime() );
    $timeend = $mtime[1] + $mtime[0];
    $timetotal = number_format( $timeend - $timestart, $precision );
    $r = $timetotal &lt; 1 ? $timetotal * 1000 . &quot; ms&quot; : $timetotal . &quot; s&quot;;
    if ( $display ) {
    echo $r;
    }
    return $r;
}</code></pre><p>在主题合适位置引入</p><pre><code class="lang-php">&lt;?php _e(&#039;页面加载耗时&#039;); ?&gt;&lt;?php echo timer_stop();?&gt;</code></pre>]]></content:encoded>
        </item>
                <item>
            <title>Typecho网站地图sitemap插件</title>
            <link>https://typecho.team/archives/sitemap.html</link>
            <guid isPermaLink="true">https://typecho.team/archives/sitemap.html</guid>
            <pubDate>Tue, 10 Jun 25 11:39:08 +0800</pubDate>
            <pubDateFormatted>2025年06月10日11:39</pubDateFormatted>
            <dc:creator>TypechoTeam</dc:creator>
            <description><![CDATA[<h2>简介</h2><p>Sitemap v1.0.5 - 社区维护版</p><h2>说明</h2><p>Sitemap 可方便站长通知搜索引擎网站上有哪些可供抓取的网页。最简单通行的就是Google制定的XML格式标准，其中可列出网址及其元数据（上次更新时间、更改频率和优先级权重等），便于搜索引擎更高效智能地抓取网站内容。<br>使用方法：</p><ol><li>下载本插件，放在 usr/plugins/ 目录中，确保文件夹名为 Sitemap；</li><li>激活插件；</li><li>访问http://[example].com/sitemap.xml即可看到页面效果。</li></ol><h2>下载</h2><p><a href="https://github.com/typecho-fans/plugins/tree/master/Sitemap">https://github.com/typecho-fans/plugins/tree/master/Sitemap</a></p>]]></description>
            <content:encoded><![CDATA[<h2>简介</h2><p>Sitemap v1.0.5 - 社区维护版</p><h2>说明</h2><p>Sitemap 可方便站长通知搜索引擎网站上有哪些可供抓取的网页。最简单通行的就是Google制定的XML格式标准，其中可列出网址及其元数据（上次更新时间、更改频率和优先级权重等），便于搜索引擎更高效智能地抓取网站内容。<br>使用方法：</p><ol><li>下载本插件，放在 usr/plugins/ 目录中，确保文件夹名为 Sitemap；</li><li>激活插件；</li><li>访问http://[example].com/sitemap.xml即可看到页面效果。</li></ol><h2>下载</h2><p><a href="https://github.com/typecho-fans/plugins/tree/master/Sitemap">https://github.com/typecho-fans/plugins/tree/master/Sitemap</a></p>]]></content:encoded>
        </item>
                <item>
            <title>Typecho显示在线状态</title>
            <link>https://typecho.team/archives/online.html</link>
            <guid isPermaLink="true">https://typecho.team/archives/online.html</guid>
            <pubDate>Mon, 09 Jun 25 19:54:44 +0800</pubDate>
            <pubDateFormatted>2025年06月09日19:54</pubDateFormatted>
            <dc:creator>TypechoTeam</dc:creator>
            <description><![CDATA[<pre><code class="lang-php">/***
 * 在线状态
 */
function get_last_login($user){
    $user   = &#039;1&#039;; 
    $now    = time();
    $db     = Typecho_Db::get();
    $prefix = $db-&gt;getPrefix();
    $row = $db-&gt;fetchRow($db-&gt;select(&#039;activated&#039;)-&gt;from(&#039;table.users&#039;)-&gt;where(&#039;uid = ?&#039;, $user));
    if ($row) {
        echo Typecho_I18n::dateWord($row[&#039;activated&#039;], $now);
    } else {
        echo &#039;博主一直在这里&#039;;
    }
}</code></pre><p>在前台调用</p><pre><code class="lang-php">💻️ &lt;?php $this-&gt;author();//用户名 ?&gt; &lt;?php get_last_login(1); ?&gt; 在线</code></pre>]]></description>
            <content:encoded><![CDATA[<pre><code class="lang-php">/***
 * 在线状态
 */
function get_last_login($user){
    $user   = &#039;1&#039;; 
    $now    = time();
    $db     = Typecho_Db::get();
    $prefix = $db-&gt;getPrefix();
    $row = $db-&gt;fetchRow($db-&gt;select(&#039;activated&#039;)-&gt;from(&#039;table.users&#039;)-&gt;where(&#039;uid = ?&#039;, $user));
    if ($row) {
        echo Typecho_I18n::dateWord($row[&#039;activated&#039;], $now);
    } else {
        echo &#039;博主一直在这里&#039;;
    }
}</code></pre><p>在前台调用</p><pre><code class="lang-php">💻️ &lt;?php $this-&gt;author();//用户名 ?&gt; &lt;?php get_last_login(1); ?&gt; 在线</code></pre>]]></content:encoded>
        </item>
                <item>
            <title>Typecho 获取在线人数</title>
            <link>https://typecho.team/archives/onlinePeople.html</link>
            <guid isPermaLink="true">https://typecho.team/archives/onlinePeople.html</guid>
            <pubDate>Mon, 09 Jun 25 15:24:37 +0800</pubDate>
            <pubDateFormatted>2025年06月09日15:24</pubDateFormatted>
            <dc:creator>TypechoTeam</dc:creator>
            <description><![CDATA[<p>在主题的<code>functions.php</code>中加入</p><pre><code class="lang-php">function onlinePeople() {
    // 使用 Helper 类获取主题路径
    $theme_dir = Helper::options()-&gt;themeFile(Helper::options()-&gt;theme);
    $filename = $theme_dir . &#039;/online.txt&#039;; // 存储文件路径
    $cookie_name = &#039;Typecho_Online_UID&#039;;    // Cookie名称
    $timeout = 30;                          // 超时时间（秒）

    try {
        // 确保目录存在
        if (!is_dir(dirname($filename))) {
            if (!mkdir(dirname($filename), 0755, true)) {
                throw new Exception(&quot;无法创建目录: &quot; . dirname($filename));
            }
        }

        // 读取当前在线用户数据
        $online = file_exists($filename) ? file($filename) : array();
        $now = time();
        $active_users = array();

        // 过滤超时用户
        foreach ($online as $line) {
            $parts = explode(&#039;|&#039;, trim($line));
            if (count($parts) == 2 &amp;&amp; ($now - $parts[1]) &lt;= $timeout) {
                $active_users[$parts[0]] = $parts[1];
            }
        }

        // 生成或获取用户唯一标识（Cookie）
        if (isset($_COOKIE[$cookie_name])) {
            $uid = $_COOKIE[$cookie_name];
        } else {
            $vid = 0;
            do {
                $vid++;
                $uid = &#039;U&#039; . $vid;
            } while (isset($active_users[$uid]));
            setcookie($cookie_name, $uid, $now + 86400, &#039;/&#039;); // 24小时有效期
        }

        // 更新当前用户活跃时间
        $active_users[$uid] = $now;
        $online_count = count($active_users);

        // 写入文件（原子操作）
        $fp = fopen($filename, &#039;w&#039;);
        if (!$fp || !flock($fp, LOCK_EX)) {
            throw new Exception(&quot;无法锁定文件&quot;);
        }

        foreach ($active_users as $user =&gt; $time) {
            fwrite($fp, &quot;$user|$time\n&quot;);
        }

        flock($fp, LOCK_UN);
        fclose($fp);

        return $online_count;

    } catch (Exception $e) {
        error_log(&quot;在线人数统计错误: &quot; . $e-&gt;getMessage());
        return false;
    }
}</code></pre><p>在主题模板（如 footer.php）中直接调用：</p><pre><code class="lang-php">&lt;?php if ($count = onlinePeople()): ?&gt;
    &lt;span&gt;&lt;?php echo $count; ?&gt;人在线&lt;/span&gt;
&lt;?php endif; ?&gt;</code></pre>]]></description>
            <content:encoded><![CDATA[<p>在主题的<code>functions.php</code>中加入</p><pre><code class="lang-php">function onlinePeople() {
    // 使用 Helper 类获取主题路径
    $theme_dir = Helper::options()-&gt;themeFile(Helper::options()-&gt;theme);
    $filename = $theme_dir . &#039;/online.txt&#039;; // 存储文件路径
    $cookie_name = &#039;Typecho_Online_UID&#039;;    // Cookie名称
    $timeout = 30;                          // 超时时间（秒）

    try {
        // 确保目录存在
        if (!is_dir(dirname($filename))) {
            if (!mkdir(dirname($filename), 0755, true)) {
                throw new Exception(&quot;无法创建目录: &quot; . dirname($filename));
            }
        }

        // 读取当前在线用户数据
        $online = file_exists($filename) ? file($filename) : array();
        $now = time();
        $active_users = array();

        // 过滤超时用户
        foreach ($online as $line) {
            $parts = explode(&#039;|&#039;, trim($line));
            if (count($parts) == 2 &amp;&amp; ($now - $parts[1]) &lt;= $timeout) {
                $active_users[$parts[0]] = $parts[1];
            }
        }

        // 生成或获取用户唯一标识（Cookie）
        if (isset($_COOKIE[$cookie_name])) {
            $uid = $_COOKIE[$cookie_name];
        } else {
            $vid = 0;
            do {
                $vid++;
                $uid = &#039;U&#039; . $vid;
            } while (isset($active_users[$uid]));
            setcookie($cookie_name, $uid, $now + 86400, &#039;/&#039;); // 24小时有效期
        }

        // 更新当前用户活跃时间
        $active_users[$uid] = $now;
        $online_count = count($active_users);

        // 写入文件（原子操作）
        $fp = fopen($filename, &#039;w&#039;);
        if (!$fp || !flock($fp, LOCK_EX)) {
            throw new Exception(&quot;无法锁定文件&quot;);
        }

        foreach ($active_users as $user =&gt; $time) {
            fwrite($fp, &quot;$user|$time\n&quot;);
        }

        flock($fp, LOCK_UN);
        fclose($fp);

        return $online_count;

    } catch (Exception $e) {
        error_log(&quot;在线人数统计错误: &quot; . $e-&gt;getMessage());
        return false;
    }
}</code></pre><p>在主题模板（如 footer.php）中直接调用：</p><pre><code class="lang-php">&lt;?php if ($count = onlinePeople()): ?&gt;
    &lt;span&gt;&lt;?php echo $count; ?&gt;人在线&lt;/span&gt;
&lt;?php endif; ?&gt;</code></pre>]]></content:encoded>
        </item>
                <item>
            <title>Typecho 获取站点统计信息（带缓存）</title>
            <link>https://typecho.team/archives/site.html</link>
            <guid isPermaLink="true">https://typecho.team/archives/site.html</guid>
            <pubDate>Wed, 04 Jun 25 19:54:00 +0800</pubDate>
            <pubDateFormatted>2025年06月04日19:54</pubDateFormatted>
            <dc:creator>TypechoTeam</dc:creator>
            <description><![CDATA[<p>在主题中最后插入</p><pre><code class="lang-php">// 获取站点统计信息（带缓存）
function getSiteStatsWithCache() {
    // 使用文件缓存（兼容性最好）
    $cacheFile = __TYPECHO_ROOT_DIR__ . &#039;/usr/cache/site_stats.cache&#039;;
    $cacheTime = 3600; // 1小时缓存

    if (file_exists($cacheFile)) {
        $cacheData = json_decode(file_get_contents($cacheFile), true);
        if (time() - $cacheData[&#039;cache_time&#039;] &lt; $cacheTime) {
            return $cacheData;
        }
    }
    
    $db = Typecho_Db::get();
    
    // 1. 正确的总分类数
    $stats[&#039;totalCategories&#039;] = $db-&gt;fetchObject($db-&gt;select(&#039;COUNT(*) AS cnt&#039;)
        -&gt;from(&#039;table.metas&#039;)
        -&gt;where(&#039;type = ?&#039;, &#039;category&#039;))-&gt;cnt;
    
    // 2. 正确的总标签数
    $stats[&#039;totalTags&#039;] = $db-&gt;fetchObject($db-&gt;select(&#039;COUNT(*) AS cnt&#039;)
        -&gt;from(&#039;table.metas&#039;)
        -&gt;where(&#039;type = ?&#039;, &#039;tag&#039;))-&gt;cnt;
    
    // 3. 总文章数
    $stats[&#039;totalPosts&#039;] = $db-&gt;fetchObject($db-&gt;select(&#039;COUNT(*) AS cnt&#039;)
        -&gt;from(&#039;table.contents&#039;)
        -&gt;where(&#039;type = ?&#039;, &#039;post&#039;)
        -&gt;where(&#039;status = ?&#039;, &#039;publish&#039;))-&gt;cnt;
    
    // 4. 总文章字数
    $stats[&#039;totalWords&#039;] = $db-&gt;fetchObject($db-&gt;select(&#039;SUM(LENGTH(text)) AS total&#039;)
        -&gt;from(&#039;table.contents&#039;)
        -&gt;where(&#039;type = ?&#039;, &#039;post&#039;)
        -&gt;where(&#039;status = ?&#039;, &#039;publish&#039;))-&gt;total;
    
    // 5. 建站时间
    $oldestPost = $db-&gt;fetchObject($db-&gt;select(&#039;MIN(created) AS created&#039;)
        -&gt;from(&#039;table.contents&#039;)
        -&gt;where(&#039;type = ?&#039;, &#039;post&#039;)
        -&gt;where(&#039;status = ?&#039;, &#039;publish&#039;));
    $stats[&#039;siteCreationDate&#039;] = date(&#039;Y-m-d&#039;, $oldestPost-&gt;created);
    $stats[&#039;siteDays&#039;] = ceil((time() - $oldestPost-&gt;created) / 86400);
    
    // 6. 友情链接数量
    $stats[&#039;totalLinks&#039;] = 0;
    if (class_exists(&#039;Links_Plugin&#039;)) {
        $stats[&#039;totalLinks&#039;] = $db-&gt;fetchObject($db-&gt;select(&#039;COUNT(*) AS cnt&#039;)
            -&gt;from(&#039;table.links&#039;))-&gt;cnt;
    }
    
    // 7. 总留言数量
    $stats[&#039;totalComments&#039;] = $db-&gt;fetchObject($db-&gt;select(&#039;COUNT(*) AS cnt&#039;)
        -&gt;from(&#039;table.comments&#039;)
        -&gt;where(&#039;status != ?&#039;, &#039;spam&#039;))-&gt;cnt;
    
    // 保存缓存
    $stats[&#039;cache_time&#039;] = time();
    if (!is_dir(dirname($cacheFile))) {
        mkdir(dirname($cacheFile), 0755, true);
    }
    file_put_contents($cacheFile, json_encode($stats));
    
    return $stats;
}</code></pre><p>在前端调用</p><pre><code>&lt;?php $stats = getSiteStatsWithCache(); ?&gt;

&lt;span&gt;文章总数&lt;/span&gt;&lt;small&gt;&lt;?php echo $stats[&#039;totalPosts&#039;]; ?&gt;&lt;/small&gt;

&lt;span&gt;撰写字数&lt;/span&gt;&lt;small&gt;&lt;?php echo number_format($stats[&#039;totalWords&#039;]); ?&gt;字&lt;/small&gt;

&lt;span&gt;友情链接数量&lt;/span&gt;&lt;small&gt;&lt;?php echo $stats[&#039;totalLinks&#039;]; ?&gt;&lt;/small&gt;

&lt;span&gt;留言总数&lt;/span&gt;&lt;small&gt;&lt;?php echo $stats[&#039;totalComments&#039;]; ?&gt;&lt;/small&gt;

&lt;span&gt;标签数量&lt;/span&gt;&lt;small&gt;&lt;?php echo $stats[&#039;totalTags&#039;]; ?&gt;&lt;/small&gt;

&lt;span&gt;分类数量&lt;/span&gt;&lt;small&gt;&lt;?php echo $stats[&#039;totalCategories&#039;]; ?&gt;&lt;/small&gt;

&lt;span&gt;运营时间至今有&lt;/span&gt;&lt;small&gt;&lt;?php echo $stats[&#039;siteDays&#039;]; ?&gt;天&lt;/small&gt;
 </code></pre>]]></description>
            <content:encoded><![CDATA[<p>在主题中最后插入</p><pre><code class="lang-php">// 获取站点统计信息（带缓存）
function getSiteStatsWithCache() {
    // 使用文件缓存（兼容性最好）
    $cacheFile = __TYPECHO_ROOT_DIR__ . &#039;/usr/cache/site_stats.cache&#039;;
    $cacheTime = 3600; // 1小时缓存

    if (file_exists($cacheFile)) {
        $cacheData = json_decode(file_get_contents($cacheFile), true);
        if (time() - $cacheData[&#039;cache_time&#039;] &lt; $cacheTime) {
            return $cacheData;
        }
    }
    
    $db = Typecho_Db::get();
    
    // 1. 正确的总分类数
    $stats[&#039;totalCategories&#039;] = $db-&gt;fetchObject($db-&gt;select(&#039;COUNT(*) AS cnt&#039;)
        -&gt;from(&#039;table.metas&#039;)
        -&gt;where(&#039;type = ?&#039;, &#039;category&#039;))-&gt;cnt;
    
    // 2. 正确的总标签数
    $stats[&#039;totalTags&#039;] = $db-&gt;fetchObject($db-&gt;select(&#039;COUNT(*) AS cnt&#039;)
        -&gt;from(&#039;table.metas&#039;)
        -&gt;where(&#039;type = ?&#039;, &#039;tag&#039;))-&gt;cnt;
    
    // 3. 总文章数
    $stats[&#039;totalPosts&#039;] = $db-&gt;fetchObject($db-&gt;select(&#039;COUNT(*) AS cnt&#039;)
        -&gt;from(&#039;table.contents&#039;)
        -&gt;where(&#039;type = ?&#039;, &#039;post&#039;)
        -&gt;where(&#039;status = ?&#039;, &#039;publish&#039;))-&gt;cnt;
    
    // 4. 总文章字数
    $stats[&#039;totalWords&#039;] = $db-&gt;fetchObject($db-&gt;select(&#039;SUM(LENGTH(text)) AS total&#039;)
        -&gt;from(&#039;table.contents&#039;)
        -&gt;where(&#039;type = ?&#039;, &#039;post&#039;)
        -&gt;where(&#039;status = ?&#039;, &#039;publish&#039;))-&gt;total;
    
    // 5. 建站时间
    $oldestPost = $db-&gt;fetchObject($db-&gt;select(&#039;MIN(created) AS created&#039;)
        -&gt;from(&#039;table.contents&#039;)
        -&gt;where(&#039;type = ?&#039;, &#039;post&#039;)
        -&gt;where(&#039;status = ?&#039;, &#039;publish&#039;));
    $stats[&#039;siteCreationDate&#039;] = date(&#039;Y-m-d&#039;, $oldestPost-&gt;created);
    $stats[&#039;siteDays&#039;] = ceil((time() - $oldestPost-&gt;created) / 86400);
    
    // 6. 友情链接数量
    $stats[&#039;totalLinks&#039;] = 0;
    if (class_exists(&#039;Links_Plugin&#039;)) {
        $stats[&#039;totalLinks&#039;] = $db-&gt;fetchObject($db-&gt;select(&#039;COUNT(*) AS cnt&#039;)
            -&gt;from(&#039;table.links&#039;))-&gt;cnt;
    }
    
    // 7. 总留言数量
    $stats[&#039;totalComments&#039;] = $db-&gt;fetchObject($db-&gt;select(&#039;COUNT(*) AS cnt&#039;)
        -&gt;from(&#039;table.comments&#039;)
        -&gt;where(&#039;status != ?&#039;, &#039;spam&#039;))-&gt;cnt;
    
    // 保存缓存
    $stats[&#039;cache_time&#039;] = time();
    if (!is_dir(dirname($cacheFile))) {
        mkdir(dirname($cacheFile), 0755, true);
    }
    file_put_contents($cacheFile, json_encode($stats));
    
    return $stats;
}</code></pre><p>在前端调用</p><pre><code>&lt;?php $stats = getSiteStatsWithCache(); ?&gt;

&lt;span&gt;文章总数&lt;/span&gt;&lt;small&gt;&lt;?php echo $stats[&#039;totalPosts&#039;]; ?&gt;&lt;/small&gt;

&lt;span&gt;撰写字数&lt;/span&gt;&lt;small&gt;&lt;?php echo number_format($stats[&#039;totalWords&#039;]); ?&gt;字&lt;/small&gt;

&lt;span&gt;友情链接数量&lt;/span&gt;&lt;small&gt;&lt;?php echo $stats[&#039;totalLinks&#039;]; ?&gt;&lt;/small&gt;

&lt;span&gt;留言总数&lt;/span&gt;&lt;small&gt;&lt;?php echo $stats[&#039;totalComments&#039;]; ?&gt;&lt;/small&gt;

&lt;span&gt;标签数量&lt;/span&gt;&lt;small&gt;&lt;?php echo $stats[&#039;totalTags&#039;]; ?&gt;&lt;/small&gt;

&lt;span&gt;分类数量&lt;/span&gt;&lt;small&gt;&lt;?php echo $stats[&#039;totalCategories&#039;]; ?&gt;&lt;/small&gt;

&lt;span&gt;运营时间至今有&lt;/span&gt;&lt;small&gt;&lt;?php echo $stats[&#039;siteDays&#039;]; ?&gt;天&lt;/small&gt;
 </code></pre>]]></content:encoded>
        </item>
                <item>
            <title>Typecho如何实现图片懒加载</title>
            <link>https://typecho.team/archives/lazy.html</link>
            <guid isPermaLink="true">https://typecho.team/archives/lazy.html</guid>
            <pubDate>Wed, 28 May 25 19:07:06 +0800</pubDate>
            <pubDateFormatted>2025年05月28日19:07</pubDateFormatted>
            <dc:creator>TypechoTeam</dc:creator>
            <description><![CDATA[<h2>方法1 使用原生js</h2><pre><code class="lang-js">&lt;script&gt;
document.addEventListener(&#039;DOMContentLoaded&#039;, function() {
    // 获取所有图片（如果主题默认输出 src，可以动态替换为 data-src）
    const images = document.querySelectorAll(&#039;img[src]:not([data-src])&#039;);
    
    // 防止重复处理
    images.forEach(img =&gt; {
        if (!img.getAttribute(&#039;data-src&#039;)) {
            img.setAttribute(&#039;data-src&#039;, img.src); // 把 src 存到 data-src
            img.removeAttribute(&#039;src&#039;); // 移除 src，避免立即加载
        }
    });

    // 懒加载逻辑
    const lazyLoad = (targets) =&gt; {
        if (&#039;IntersectionObserver&#039; in window) {
            const observer = new IntersectionObserver((entries) =&gt; {
                entries.forEach(entry =&gt; {
                    if (entry.isIntersecting) {
                        const img = entry.target;
                        img.src = img.dataset.src;
                        observer.unobserve(img); // 加载后停止观察
                    }
                });
            });
            targets.forEach(img =&gt; observer.observe(img));
        } else {
            // 兼容旧浏览器（滚动监听）
            const checkImages = () =&gt; {
                targets.forEach(img =&gt; {
                    const rect = img.getBoundingClientRect();
                    if (rect.top &lt; window.innerHeight + 100) { // 提前 100px 加载
                        img.src = img.dataset.src;
                    }
                });
            };
            window.addEventListener(&#039;scroll&#039;, checkImages);
            checkImages(); // 初始检查
        }
    };

    // 对所有 data-src 图片应用懒加载
    lazyLoad(document.querySelectorAll(&#039;img[data-src]&#039;));
});
&lt;/script&gt;</code></pre><h2>方法2 使用php</h2><p>仅支持现代浏览器</p><pre><code class="lang-php">$content = preg_replace(&#039;/&lt;img(.*?)src=&quot;(.*?)&quot;(.*?)&gt;/i&#039;, &#039;&lt;img$1src=&quot;$2&quot; loading=&quot;lazy&quot;$3&gt;&#039;, $this-&gt;content);
echo $content;</code></pre><h2>方法3 使用第三方库</h2><pre><code class="lang-html">&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/lazysizes/5.3.2/lazysizes.min.js&quot; async&gt;&lt;/script&gt;
&lt;img data-src=&quot;image.jpg&quot; class=&quot;lazyload&quot; alt=&quot;示例图片&quot;&gt;</code></pre><pre><code class="lang-css">.lazyload {
    background: #f0f0f0;
}</code></pre><p>方法3可与方法2同时使用以提高兼容性</p>]]></description>
            <content:encoded><![CDATA[<h2>方法1 使用原生js</h2><pre><code class="lang-js">&lt;script&gt;
document.addEventListener(&#039;DOMContentLoaded&#039;, function() {
    // 获取所有图片（如果主题默认输出 src，可以动态替换为 data-src）
    const images = document.querySelectorAll(&#039;img[src]:not([data-src])&#039;);
    
    // 防止重复处理
    images.forEach(img =&gt; {
        if (!img.getAttribute(&#039;data-src&#039;)) {
            img.setAttribute(&#039;data-src&#039;, img.src); // 把 src 存到 data-src
            img.removeAttribute(&#039;src&#039;); // 移除 src，避免立即加载
        }
    });

    // 懒加载逻辑
    const lazyLoad = (targets) =&gt; {
        if (&#039;IntersectionObserver&#039; in window) {
            const observer = new IntersectionObserver((entries) =&gt; {
                entries.forEach(entry =&gt; {
                    if (entry.isIntersecting) {
                        const img = entry.target;
                        img.src = img.dataset.src;
                        observer.unobserve(img); // 加载后停止观察
                    }
                });
            });
            targets.forEach(img =&gt; observer.observe(img));
        } else {
            // 兼容旧浏览器（滚动监听）
            const checkImages = () =&gt; {
                targets.forEach(img =&gt; {
                    const rect = img.getBoundingClientRect();
                    if (rect.top &lt; window.innerHeight + 100) { // 提前 100px 加载
                        img.src = img.dataset.src;
                    }
                });
            };
            window.addEventListener(&#039;scroll&#039;, checkImages);
            checkImages(); // 初始检查
        }
    };

    // 对所有 data-src 图片应用懒加载
    lazyLoad(document.querySelectorAll(&#039;img[data-src]&#039;));
});
&lt;/script&gt;</code></pre><h2>方法2 使用php</h2><p>仅支持现代浏览器</p><pre><code class="lang-php">$content = preg_replace(&#039;/&lt;img(.*?)src=&quot;(.*?)&quot;(.*?)&gt;/i&#039;, &#039;&lt;img$1src=&quot;$2&quot; loading=&quot;lazy&quot;$3&gt;&#039;, $this-&gt;content);
echo $content;</code></pre><h2>方法3 使用第三方库</h2><pre><code class="lang-html">&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/lazysizes/5.3.2/lazysizes.min.js&quot; async&gt;&lt;/script&gt;
&lt;img data-src=&quot;image.jpg&quot; class=&quot;lazyload&quot; alt=&quot;示例图片&quot;&gt;</code></pre><pre><code class="lang-css">.lazyload {
    background: #f0f0f0;
}</code></pre><p>方法3可与方法2同时使用以提高兼容性</p>]]></content:encoded>
        </item>
                <item>
            <title>prism.js代码高亮</title>
            <link>https://typecho.team/archives/prismjs.html</link>
            <guid isPermaLink="true">https://typecho.team/archives/prismjs.html</guid>
            <pubDate>Sat, 24 May 25 19:25:33 +0800</pubDate>
            <pubDateFormatted>2025年05月24日19:25</pubDateFormatted>
            <dc:creator>TypechoTeam</dc:creator>
            <description><![CDATA[<p>在<code>post.php</code>中插入</p><pre><code class="lang-html">  &lt;script src=&quot;https://cdn.imsun.org/highlight/prism.js&quot;&gt;&lt;/script&gt;
  &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.imsun.org/highlight/prism.css&quot;  /&gt;
  &lt;script&gt;
  document.addEventListener(&#039;DOMContentLoaded&#039;, function () {
    var defaultLanguage = &#039;javascript&#039;; 
    document.querySelectorAll(&#039;pre code&#039;).forEach(function (block) {
      if (!block.classList.length) {
        block.classList.add(&#039;language-&#039; + defaultLanguage);
      }
    });
    Prism.highlightAll();
  });
  &lt;/script&gt;</code></pre><p>即可实现</p>]]></description>
            <content:encoded><![CDATA[<p>在<code>post.php</code>中插入</p><pre><code class="lang-html">  &lt;script src=&quot;https://cdn.imsun.org/highlight/prism.js&quot;&gt;&lt;/script&gt;
  &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.imsun.org/highlight/prism.css&quot;  /&gt;
  &lt;script&gt;
  document.addEventListener(&#039;DOMContentLoaded&#039;, function () {
    var defaultLanguage = &#039;javascript&#039;; 
    document.querySelectorAll(&#039;pre code&#039;).forEach(function (block) {
      if (!block.classList.length) {
        block.classList.add(&#039;language-&#039; + defaultLanguage);
      }
    });
    Prism.highlightAll();
  });
  &lt;/script&gt;</code></pre><p>即可实现</p>]]></content:encoded>
        </item>
            </channel>
</rss>
        