返回顶部
h

hugo-blog-agentHugo博客代理

エージェント読者に最適化されたHugoブログの構築

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
2,337
下载量
免费
免费
2
收藏
概述
安装方式
版本历史

hugo-blog-agent

Hugo博客·代理优化

AI代理高效可读的Hugo博客构建方法。通过最小化HTML、无JavaScript、适当的元标签设置,创建代理友好型网站的指南。

初始设置

创建Hugo站点

bash

创建新Hugo站点


hugo new site agent-blog
cd agent-blog

初始化git

git init git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke themes/ananke

基本配置

cat > hugo.toml << EOF baseURL = https://yourdomain.com languageCode = ja title = 代理兼容博客 theme = ananke

[params]
# 代理优化参数
showreadingtime = false
showsharinglinks = false
show_comments = false
minimal_layout = true

[markup]
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true
hardWraps = false
[markup.highlight]
style = github
lineNos = false

RSS设置

[outputFormats] [outputFormats.RSS] mediatype = application/rss+xml baseName = feed

[outputs]
home = [HTML, RSS, JSON]
page = [HTML]
section = [HTML, RSS]
EOF

创建代理专用主题

bash

创建最小主题


mkdir -p themes/agent-minimal/layouts/{_default,partials}

基础模板

cat > themes/agent-minimal/layouts/_default/baseof.html << EOF {{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }} | {{ .Site.Title }}{{ end }}












{{ block main . }}{{ end }}




© {{ now.Format 2006 }} {{ .Site.Title }} | RSS





EOF

文章列表模板

cat > themes/agent-minimal/layouts/_default/list.html << EOF {{ define main }}

{{ .Title }}

{{ range .Pages }}


{{ .Title }}


{{ .Date.Format 2006-01-02 }}

{{ .Summary }}



{{ range .Params.tags }}
#{{ . }}
{{ end }}




{{ end }}
{{ end }}
EOF

单篇文章模板

cat > themes/agent-minimal/layouts/_default/single.html << EOF {{ define main }}

{{ .Title }}

发布日期: {{ .Date.Format 2006-01-02 15:04 }} {{ if .Params.tags }} | 标签: {{ range .Params.tags }}#{{ . }}{{ end }} {{ end }}


{{ .Content }}


{{ if .Site.Params.show_related }}



相关文章


{{ range first 3 (where .Site.RegularPages Section .Section) }}

{{ .Title }} ({{ .Date.Format 2006-01-02 }})


{{ end }}
{{ end }}

{{ end }}
EOF

内容创建

文章创建自动化

bash
#!/bin/bash

create-post.sh - 代理优化文章创建

createagentpost() {
local title=$1
local filename=$(echo $title | iconv -t ascii//TRANSLIT | sed s/[^a-zA-Z0-9]/-/g | tr [:upper:] [:lower:])
local date=$(date -I)

hugo new posts/${date}-${filename}.md

# 前置元数据优化
cat > content/posts/${date}-${filename}.md << EOF



title: ${title}
date: $(date -Iseconds)
draft: false
tags: [AI, 代理]
description: ${title}的解说文章
author-type: agent
content-structure: linear


${title}

本文将对${title}进行说明。

概述

详细

总结

EOF

echo 文章创建完成: content/posts/${date}-${filename}.md
}

使用示例

createagentpost 面向代理的信息架构

RSS订阅优化

yaml

layouts/_default/rss.xml


{{- $pctx := . -}}
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
{{- $pages := slice -}}
{{- if or $.IsHome $.IsSection -}}
{{- $pages = $pctx.RegularPages -}}
{{- else -}}
{{- $pages = $pctx.Pages -}}
{{- end -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}}
{{- $pages = $pages | first $limit -}}
{{- end -}}
{{- printf | safeHTML }}


{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}
{{ .Permalink }}
面向代理的最新信息
Hugo
{{ .Site.LanguageCode }}
{{ .Site.Author.email }}{{ with .Site.Author.name }} ({{ . }}){{ end }}
{{ .Site.Author.email }}{{ with .Site.Author.name }} ({{ . }}){{ end }}
{{ .Site.Copyright }}
{{ .Date.Format Mon, 02 Jan 2006 15:04:05 -0700 | safeHTML }}
{{ with .OutputFormats.Get R

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 hugo-blog-agent-1776368962 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 hugo-blog-agent-1776368962 技能

通过命令行安装

skillhub install hugo-blog-agent-1776368962

下载

⬇ 下载 hugo-blog-agent v1.0.0(免费)

文件大小: 4.69 KB | 发布时间: 2026-4-17 14:24

v1.0.0 最新 2026-4-17 14:24
initial release

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部