{{- /* knowledge-galaxy — 3D 知识星系 / 关于「我」的交互式入口 数据驱动:中心节点是站主,环绕节点是身份/主题,可拖拽旋转、点击跳转。 - Three.js 本地托管(assets/js/vendor),经 Hugo fingerprint - 通过 importmap 解析裸导入 'three' / 'three/addons/...' - 渐进增强:无 WebGL / reduced-motion / 极小屏 → 优雅降级为静态文字 参数(可选):height(画布高度,默认 480) */ -}} {{- $three := resources.Get "js/vendor/three.module.min.js" | resources.Fingerprint "sha384" -}} {{- $orbit := resources.Get "js/vendor/addons/controls/OrbitControls.js" -}} {{- $height := .Get "height" | default "480" -}} {{- $isZH := eq site.Language.Lang "zh" -}} {{- /* 节点数据:lang 决定文案与链接前缀 */ -}} {{- $prefix := cond $isZH "/zh" "/en" -}}
{{- /* 降级 / no-JS / no-WebGL 时展示这份静态版本 */ -}}
{{- /* 用 dict + jsonify 一次性生成,避免手写 JSON 时重复转义 */ -}} {{- $payload := dict "center" (dict "label" (cond $isZH "熊鑫伟" "Xinwei Xiong") "sub" "cubxxw" "url" (printf "%s/about/" $prefix) "color" "#ffffff") "nodes" (slice (dict "label" (cond $isZH "AI 创业者" "AI Founder") "url" (printf "%s/ai-technology/" $prefix) "color" "#667eea") (dict "label" (cond $isZH "开源贡献" "Open Source") "url" "https://github.com/cubxxw" "color" "#764ba2" "external" true) (dict "label" (cond $isZH "数字游民" "Digital Nomad") "url" (printf "%s/travel/" $prefix) "color" "#17a2b8") (dict "label" "Kubernetes" "url" (printf "%s/ai-technology/posts/kubernetes-an-article-to-get-started-quickly/" $prefix) "color" "#326ce5") (dict "label" "Go" "url" (printf "%s/ai-technology/posts/go-release-tools/" $prefix) "color" "#00add8") (dict "label" (cond $isZH "心流状态" "Flow State") "url" (printf "%s/growth/posts/flow-state/" $prefix) "color" "#28a745") (dict "label" (cond $isZH "年度复盘" "Annual Review") "url" (printf "%s/growth/posts/2025-annual-review/" $prefix) "color" "#f0883e") (dict "label" (cond $isZH "9 国徒步" "9 Countries") "url" (printf "%s/growth/posts/in-2023-i-was-wandering-at-the-edge-of-the-world/" $prefix) "color" "#e84393") ) -}}