{{define "homeland_style"}}{{end}} {{define "homeland_profile_style"}} {{end}} {{define "homeland"}} {{template "homeland_style" .}} {{/* 网络家园 · 生命主页(M1 骨架):门脸 / 客厅 / 书房 / 花园 / 门廊信箱 五区。 双分支:本地版(Local)渲染桌面壳内的家园入口卡;站点版渲染完整家园页。 样式沿用主题 CSS 变量体系(--lui-* 与 style.css 变量双兼容兜底), 禁 emoji、禁渐变胶囊按钮、圆角克制;私密视角对书房/花园/门廊做模糊+水印。 */}} {{if .Site.Local}} {{/* ---------- 本地版:桌面壳内的家园入口 ---------- */}}
{{if .Data.Home.Cover}}家园封面{{else}}网 络 家 园{{end}}
{{initial .Data.Owner}}

{{.Data.Owner}} 的家园

{{.Data.Home.Signature}}

{{if .Data.Home.City}}{{.Data.Home.City}}{{end}} {{if eq .Data.Home.Visibility "private"}}仅自己可见{{else if eq .Data.Home.Visibility "group"}}指定分组可见{{else if eq .Data.Home.Visibility "friends"}}登录好友可见{{else}}公开{{end}}

客厅 · 最近文章 {{len .Data.RecentPosts}}

{{if .Data.RecentPosts}} {{else}}

客厅还空着,去写第一篇吧。

{{end}}
花园访客 {{.Data.Visits.Total}}今日串门 {{.Data.Visits.Today}}门廊留言 {{len .Data.Messages}}
{{if .Data.Home.Weather}}

天气:{{.Data.WeatherTxt}}{{if .Data.Home.City}} · {{.Data.Home.City}}{{end}}

{{end}}
打理度 {{.Data.TidyLabel}}{{.Data.TidyLevel}}
打理 {{.Data.CareCount}} 次随日子衰败,常回家打理

完整家园页(书房 / 花园 / 门廊信箱)在站点版展示

{{else}} {{/* ---------- 站点版:完整家园页 ---------- */}}
{{/* M2 天气氛围层:开关关闭时不渲染;衰败 overlay 恒在天气之上(z-index 3 > 0) */}} {{if .Data.Home.Weather}}
{{end}} {{if gt .Data.TidyTier 1}}
{{end}}
天气:{{.Data.WeatherTxt}}{{if .Data.Home.City}} · {{.Data.Home.City}}{{end}}{{if not .Data.Home.Weather}}(氛围层关闭){{end}}
{{/* M3 门铃气泡:今日客人计数 + 门牌灯(新访客闪烁 / 每会话一次敲门动画) */}}
今日有 {{.Data.Visits.Today}} 位客人来过 {{if .Data.Self}}{{if gt .Data.UnreadMsgs 0}}待读纸条 {{.Data.UnreadMsgs}}{{end}}{{end}}
{{/* 门脸:封面横幅 + 个人信息条 */}} {{if .Data.Self}}
{{end}} {{/* M4 模块拼装:按 home_module_json 配置的顺序渲染,开关关闭时整块隐藏。 Key: facade门脸 / living客厅 / study书房 / garden花园 / mailbox门廊信箱 / board灵感画板 / badge徽章 / regulars常来的人 */}} {{range .Data.Home.Modules}} {{if .On}} {{if eq .Key "facade"}}
{{if $.Data.Home.Cover}}家园封面{{else}}网 络 家 园{{end}}
{{initial $.Data.Owner}}

{{$.Data.Owner}} 的家园

{{$.Data.Home.Signature}}

{{if $.Data.Home.City}}{{$.Data.Home.City}}{{end}} 主题 {{$.Data.Home.Theme}} {{if eq $.Data.Home.Visibility "private"}}仅自己可见{{else if eq $.Data.Home.Visibility "group"}}指定分组可见{{else if eq $.Data.Home.Visibility "friends"}}登录好友可见{{else}}公开{{end}}
{{else if eq .Key "living"}}

客厅 · 文章动态

{{if $.Data.RecentPosts}}
    {{range $p := $.Data.RecentPosts}}
  • {{$p.Title}}

    {{if $p.Summary}}

    {{$p.Summary}}

    {{end}}

    {{date $p.CreatedAt}}{{if $p.CategoryName}} · {{$p.CategoryName}}{{end}} · 阅读 {{$p.Views}}

  • {{end}}
{{else}}

客厅还空着,等第一篇故事上墙。

{{end}}
{{else if eq .Key "study"}}

书房 · 阅读收藏

{{if $.Data.RecentPosts}}
{{range $p := $.Data.RecentPosts}} {{$p.Title}} {{$p.Slug}} {{end}}
{{else}}

书房书架还空着,收藏几篇好文吧。

{{end}}
{{else if eq .Key "garden"}}

花园 · 来客统计

{{if $.Data.Full}}
{{$.Data.Visits.Total}}累计串门
{{$.Data.Visits.Today}}今日来客
{{$.Data.TidyLevel}}打理度
{{if $.Data.Visits.Recent}}
{{range $.Data.Visits.Recent}}{{.Nickname}}{{if .City}} · {{.City}}{{end}}{{end}}
{{end}} {{else}}
0累计串门
0今日来客
—打理度
私密内容 · 仅自己可见
{{end}}
{{else if eq .Key "mailbox"}}

门廊信箱 · 留言墙 {{len $.Data.Messages}}

{{if $.Data.Full}} {{if and $.Data.Home.Visibility (eq $.Data.Home.Visibility "private") (not $.Data.Self)}}

家园设为仅自己可见,暂不接收留言。

{{else}} {{if and (not $.Data.Self) $.Data.OwnerAway}}

主人暂时不在家,纸条会放进信箱。

{{end}}
{{if not $.Data.Self}}{{end}}
{{end}} {{if $.Data.Messages}}
{{range $.Data.Messages}}
{{.Nickname}}{{dateTime .Created}}{{if .Mine}}我{{end}}{{if .IsSecret}}悄悄话{{end}}{{if .Replied}}主人已回信{{end}}

{{.Content}}

{{if and $.Data.Self (not .Replied)}}
{{end}}
{{end}}
{{else}}

门廊信箱空空的,留下第一句问候吧。

{{end}} {{else}}

门廊信箱空空的,留下第一句问候吧。

私密内容 · 仅自己可见
{{end}}
{{else if eq .Key "board"}}

灵感画板

{{if $.Data.Boards}}
{{range $b := $.Data.Boards}}

{{$b.Title}}

{{len $b.Cards}} 张卡片 · {{date $b.Created}}
{{if $b.Cards}}
{{range $c := $b.Cards}}
{{if eq $c.Kind "link"}}{{$c.Text}}{{$c.URL}} {{else if eq $c.Kind "image"}}图片卡片{{$c.URL}} {{else}}{{$c.Text}}{{end}} {{if $.Data.Self}}{{end}}
{{end}}
{{else}}

画板还空着,主人贴一张灵感吧。

{{end}} {{if $.Data.Self}}
{{end}}
{{end}}
{{else}}

还没有画板,主人可以新建一块。

{{if $.Data.Self}}
{{end}} {{end}}
{{else if eq .Key "badge"}}

成长徽章

{{if $.Data.Badges}}
{{range $b := $.Data.Badges}}
{{$b.Name}}
{{if $b.Lit}}
{{if $b.Since}}{{$b.Since}} 点亮{{else}}已点亮{{end}}
{{else}}
{{$b.Tip}}
{{end}}
{{end}}
{{else}}

花园还没有徽章,慢慢积累吧。

{{end}}
{{else if eq .Key "regulars"}}

常来的人 {{$.Data.RegularCount}}

{{if gt $.Data.RegularCount 0}} {{if $.Data.Self}}
{{range $.Data.Regulars}}{{.Nickname}}{{if .City}} · {{.City}}{{end}} · 来{{.Count}}次{{end}}
{{else}}

有 {{$.Data.RegularCount}} 位客人常来串门。

{{end}} {{else}}

还没有常客,多去串门吧。

{{end}}
{{end}} {{end}} {{end}} {{/* 家园生命力(M2):打理度进度条 + 档位文案 + 主人打理入口 */}}

家园生命力 {{.Data.TidyLabel}}

打理度 {{.Data.TidyLabel}} {{.Data.TidyLevel}}
打理 {{.Data.CareCount}} 次 日子久了会落灰,常回家打理
{{if .Data.Self}}

{{end}} {{if .Data.CareLogs}}
{{range .Data.CareLogs}}{{.Note}} +{{.Delta}} · {{dateTime .Created}}{{end}}
{{end}}
{{/* 岁月回看(M5):按年份聚合发帖 / 留言 / 访客 / 点亮徽章,每年一行简洁列表; 主人视角全显(含“此年花园未打理”),路人仅见非私密年份 */}}

岁月回看 {{.Data.SeasonName}}季

{{if .Data.Archive}}
{{range $y := .Data.Archive}} {{if $y.Empty}}
{{$y.Year}}此年花园未打理
{{else}}
{{$y.Year}} {{if gt $y.Posts 0}}发帖 {{$y.Posts}}{{end}} {{if gt $y.Messages 0}}留言 {{$y.Messages}}{{end}} {{if gt $y.Visits 0}}访客 {{$y.Visits}}{{end}} {{if gt $y.Badges 0}}徽章 {{$y.Badges}}{{end}}
{{end}} {{end}}
{{else}}

花园还没有留下岁月痕迹。

{{end}}
{{/* /hm-stage */}}
{{end}} {{end}} {{define "homeland_body"}} {{/* ---------- 个人主页合流版 · 家(重构 v3 · TAB 分组) ---------- 门牌/门脸常驻,下方分区收进 TAB 页签:客厅 / 书房 / 花园 / 门廊信箱 / 岁月回看 一次只显示一个分区;默认客厅,客厅关闭时顺延第一个开启的分区 */}} {{$facadeOn := false}}{{$livingOn := false}}{{$studyOn := false}}{{$boardOn := false}}{{$gardenOn := false}}{{$regularsOn := false}}{{$badgeOn := false}}{{$mailboxOn := false}} {{range .Data.Home.Modules}}{{if .On}}{{if eq .Key "facade"}}{{$facadeOn = true}}{{end}}{{if eq .Key "living"}}{{$livingOn = true}}{{end}}{{if eq .Key "study"}}{{$studyOn = true}}{{end}}{{if eq .Key "board"}}{{$boardOn = true}}{{end}}{{if eq .Key "garden"}}{{$gardenOn = true}}{{end}}{{if eq .Key "regulars"}}{{$regularsOn = true}}{{end}}{{if eq .Key "badge"}}{{$badgeOn = true}}{{end}}{{if eq .Key "mailbox"}}{{$mailboxOn = true}}{{end}}{{end}}{{end}} {{$panelDefault := "living"}} {{if not $livingOn}}{{$panelDefault = "study"}}{{end}} {{if and (eq $panelDefault "study") (not $studyOn) (not $boardOn)}}{{$panelDefault = "garden"}}{{end}} {{if and (eq $panelDefault "garden") (not $gardenOn) (not $regularsOn) (not $badgeOn)}}{{$panelDefault = "mailbox"}}{{end}} {{if and (eq $panelDefault "mailbox") (not $mailboxOn)}}{{$panelDefault = "archive"}}{{end}}
{{/* 氛围层:天气粒子与衰败 overlay 作为固定背景,不占内容位 */}} {{if .Data.Home.Weather}}
{{end}} {{if gt .Data.TidyTier 1}}
{{end}}
{{/* ========== 门牌 · 门脸(封面横幅 + 信息条 + 统计 + 打理度细条 + 门铃) ========== */}} {{if $facadeOn}}
{{if .Data.Home.Cover}}家园封面{{else}}网 络 家 园{{end}} {{if .Data.Nickname}}{{.Data.Nickname}}{{else}}{{.Data.Owner}}{{end}} 的家欢迎来串门 {{if .Data.Home.Weather}}{{.Data.WeatherTxt}}{{if .Data.Home.City}} · {{.Data.Home.City}}{{end}}{{end}}
{{if .Data.Nickname}}{{initial .Data.Nickname}}{{else}}{{initial .Data.Owner}}{{end}}

{{if .Data.Nickname}}{{.Data.Nickname}}{{else}}{{.Data.Owner}} 的家{{end}}

{{if .Data.Nickname}}

@{{.Data.Username}}{{if eq .Data.Role "admin"}} · 站长{{end}}{{if .Data.CreatedAt}} · 加入于 {{date .Data.CreatedAt}}{{end}}

{{end}} {{if .Data.Home.Signature}}

{{.Data.Home.Signature}}

{{end}}
{{if .Data.Home.City}}住在 {{.Data.Home.City}}{{end}} {{range .Data.Badges}}{{if .Lit}}{{.Name}}{{end}}{{end}} {{if eq .Data.Home.Visibility "private"}}仅自己可见{{else if eq .Data.Home.Visibility "group"}}指定分组可见{{else if eq .Data.Home.Visibility "friends"}}登录好友可见{{else}}公开{{end}}
{{if .Data.Nickname}}
{{if .Data.Self}}我的收藏 {{else}}{{template "follow_button" dict "VD" $ "Type" "user" "Key" .Data.Username "Title" .Data.Nickname "URL" (printf "/u/%s" .Data.Username) "Self" .Data.Username}}{{end}}
{{end}}
{{if .Data.Nickname}}{{if .Data.Stats}}
{{.Data.Stats.Contents}}公开内容 {{.Data.Stats.Following}}关注 {{.Data.Stats.Followers}}粉丝 {{.Data.Stats.Likes}}获赞
{{end}}{{end}}
打理度
{{.Data.TidyLevel}} {{.Data.TidyLabel}} 打理 {{.Data.CareCount}} 次
今日有 {{.Data.Visits.Today}} 位客人来过 {{if .Data.Self}}{{if gt .Data.UnreadMsgs 0}}待读纸条 {{.Data.UnreadMsgs}}{{end}}{{end}} {{if .Data.Self}} {{end}}
{{end}} {{/* ========== TAB 页签组:下方分区一次只显示一个 ========== */}}
现在在 {{if eq $panelDefault "living"}}客厅{{else if eq $panelDefault "study"}}书房{{else if eq $panelDefault "garden"}}花园{{else if eq $panelDefault "mailbox"}}门廊信箱{{else}}岁月回看{{end}}
{{/* ========== 客厅(生活流,默认页签) ========== */}} {{if $livingOn}}

客厅最近的生活

今日来客 {{.Data.Visits.Today}} {{if .Data.Visits.Recent}}{{range $i, $v := .Data.Visits.Recent}}{{if lt $i 3}}{{$v.Nickname}}{{end}}{{end}} {{else}}今天还没人来,去花园看看足迹{{end}}
{{if .Data.Nickname}} {{if eq .Data.Tab "followers"}}
{{if .Data.FansList}} {{else}}
还没有人关注这位用户。发布优质内容,粉丝自然会来。
{{end}}
{{else if eq .Data.Tab "following"}}
{{if .Data.FollowList}} {{else}}
还没有关注任何人或栏目。看到喜欢的作者,点一下「关注」,他们更新时你就不会错过。
{{end}}
{{else}} {{if .Data.Items}}
{{range .Data.Items}}
{{.Label}} {{if .Time}}{{date .Time}}{{end}} {{if .Meta}}{{.Meta}}{{end}}

{{.Title}}

{{if .Excerpt}}

{{truncate .Excerpt 110}}

{{end}} {{if .Likes}}{{ico "heart"}} {{.Likes}}{{end}}
{{end}}
{{else}}

这位朋友还没有公开发布内容。等一等,或者先关注他/她。

{{end}} {{end}} {{else}} {{if .Data.RecentPosts}}
    {{range $p := .Data.RecentPosts}}
  • {{$p.Title}}

    {{if $p.Summary}}

    {{$p.Summary}}

    {{end}}

    {{date $p.CreatedAt}}{{if $p.CategoryName}} · {{$p.CategoryName}}{{end}} · 阅读 {{$p.Views}}

  • {{end}}
{{else}}

客厅还空着,等第一篇故事上墙。

{{end}} {{end}}
{{end}} {{/* ========== 书房(阅读收藏 + 灵感画板) ========== */}} {{if or $studyOn $boardOn}}

书房收藏与阅读

{{if $studyOn}} {{if .Data.RecentPosts}}
{{range $p := .Data.RecentPosts}}
{{$p.Title}} {{$p.Slug}}
{{end}}
{{else}}

书房书架还空着,收藏几篇好文吧。

{{end}} {{end}} {{if $boardOn}} {{if .Data.Boards}}
{{range $b := .Data.Boards}}

{{$b.Title}}

{{len $b.Cards}} 张卡片 · {{date $b.Created}}
{{if $b.Cards}}
{{range $c := $b.Cards}}
{{if eq $c.Kind "link"}}{{$c.Text}}{{$c.URL}} {{else if eq $c.Kind "image"}}图片卡片{{$c.URL}} {{else}}{{$c.Text}}{{end}} {{if $.Data.Self}}{{end}}
{{end}}
{{else}}

画板还空着,主人贴一张灵感吧。

{{end}} {{if $.Data.Self}}
{{end}}
{{end}}
{{else}}

还没有画板,主人可以新建一块。

{{if $.Data.Self}}
{{end}} {{end}} {{end}} {{if .Data.SeasonClass}}

窗外是{{.Data.SeasonName}}的光,窗台上摆着季节的颜色。

{{end}}
{{end}} {{/* ========== 花园(访客 + 常来的人 + 成长徽章 + 打理角落) ========== */}} {{if or $gardenOn $regularsOn $badgeOn}}

花园来客与足迹

{{if $gardenOn}} {{if .Data.Full}}
{{.Data.Visits.Total}}累计串门 {{.Data.Visits.Today}}今日来客
{{if .Data.Visits.Recent}}
{{range .Data.Visits.Recent}}{{.Nickname}}{{if .City}} · {{.City}}{{end}}{{end}}
{{end}} {{else}}
私密内容 · 仅自己可见
{{end}} {{end}} {{if $regularsOn}}

常来的人{{.Data.RegularCount}}

{{if gt .Data.RegularCount 0}} {{if .Data.Self}}
{{range .Data.Regulars}}{{.Nickname}}{{if .City}} · {{.City}}{{end}} · 来{{.Count}}次{{end}}
{{else}}

有 {{.Data.RegularCount}} 位客人常来串门。

{{end}} {{else}}

还没有常客,多去串门吧。

{{end}}
{{end}} {{if $badgeOn}}

成长徽章

{{if .Data.Badges}}
{{range $b := .Data.Badges}} {{$b.Name}}{{if $b.Lit}}{{if $b.Since}} · {{$b.Since}} 点亮{{end}}{{else}} · {{$b.Tip}}{{end}} {{end}}
{{else}}

花园还没有徽章,慢慢积累吧。

{{end}}
{{end}} {{if and .Data.Self $gardenOn}}

{{if .Data.CareLogs}}
{{range .Data.CareLogs}}{{.Note}} +{{.Delta}} · {{dateTime .Created}}{{end}}
{{end}}
{{end}}
{{end}} {{/* ========== 门廊信箱(留言墙) ========== */}} {{if $mailboxOn}}

门廊信箱留言墙

{{if .Data.Full}} {{if and (eq .Data.Home.Visibility "private") (not .Data.Self)}}

家园设为仅自己可见,暂不接收留言。

{{else}} {{if and (not .Data.Self) .Data.OwnerAway}}

主人暂时不在家,纸条会放进信箱。

{{end}}
{{if not .Data.Self}}{{end}}
{{end}} {{if .Data.Messages}}
{{range .Data.Messages}}
{{.Nickname}}{{dateTime .Created}}{{if .Mine}}我{{end}}{{if .IsSecret}}悄悄话{{end}}{{if .Replied}}主人已回信{{end}}

{{.Content}}

{{if and $.Data.Self (not .Replied)}}
{{end}}
{{end}}
{{else}}

门廊信箱空空的,留下第一句问候吧。

{{end}} {{else}}

门廊信箱空空的,留下第一句问候吧。

私密内容 · 仅自己可见
{{end}}
{{end}} {{/* ========== 岁月回看(按年简史) ========== */}}

岁月回看按年简史 · {{.Data.SeasonName}}季

{{if .Data.Archive}}
{{range $y := .Data.Archive}} {{if $y.Empty}}
{{$y.Year}}此年花园未打理
{{else}}
{{$y.Year}} {{if gt $y.Posts 0}}那年发帖 {{$y.Posts}}{{end}} {{if gt $y.Messages 0}}留言 {{$y.Messages}}{{end}} {{if gt $y.Visits 0}}访客 {{$y.Visits}}{{end}} {{if gt $y.Badges 0}}徽章 {{$y.Badges}}{{end}}
{{end}} {{end}}
{{else}}

花园还没有留下岁月痕迹。

{{end}}
{{/* /hm2-stage */}}
{{end}}