{"id":50602066,"url":"https://github.com/cunyu1943/nav","last_synced_at":"2026-06-05T19:01:58.825Z","repository":{"id":359119538,"uuid":"416351674","full_name":"cunyu1943/nav","owner":"cunyu1943","description":"村雨遥的藏宝阁","archived":false,"fork":false,"pushed_at":"2026-05-20T16:08:33.000Z","size":2385,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-20T17:17:59.470Z","etag":null,"topics":["software","source","website"],"latest_commit_sha":null,"homepage":"https://cunyu1943.github.io/nav","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cunyu1943.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-10-12T13:36:53.000Z","updated_at":"2026-05-20T16:09:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/cunyu1943/nav","commit_stats":null,"previous_names":["cunyu1943/nav"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/cunyu1943/nav","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cunyu1943%2Fnav","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cunyu1943%2Fnav/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cunyu1943%2Fnav/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cunyu1943%2Fnav/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cunyu1943","download_url":"https://codeload.github.com/cunyu1943/nav/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cunyu1943%2Fnav/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33955544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-05T02:00:06.157Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["software","source","website"],"created_at":"2026-06-05T19:01:57.914Z","updated_at":"2026-06-05T19:01:58.819Z","avatar_url":"https://github.com/cunyu1943.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ❤️ 村雨遥优选站 (Momo Nav)\n\n一个简洁、美观的静态导航网站，通过 JSON 文件管理链接，轻松添加和分类你的常用网站。\n\nDemo：https://momo-nav.msx.cc.cd/\n\n自用：https://123.ihcll.cn/\n\n## ✨ 特性\n\n- 📝 **可视化配置** - 按Ctrl+F9进入编辑模式，支持内联修改链接、分类及顶部菜单\n- 📁 **分类管理** - 支持多分类组织链接，支持拖拽排序\n- 🔗 **顶部导航** - 支持二级下拉菜单，提供直观的内联编辑与排序体验\n- 🔍 **实时搜索** - 支持多搜索引擎和本地过滤\n- 🎨 **响应式设计** - 适配桌面和移动设备\n- ⚡ **纯静态** - 无需后端，直接部署\n- 🖼️ **多种图标支持** - 支持 Iconify、Iconfont、自定义图片\n- 📱 **主屏图标支持** - 支持 iOS/Android 添加到主屏幕图标配置\n- 🛠️ **自定义扩展钩子** - 支持通过配置动态加载外部 CSS/JS 插件\n\n## 🚀 快速开始\n\n1. **编辑链接**：打开 `momo-nav.json` 文件，按格式添加你的网站\n\n2. **本地预览**：需要用本地服务器运行（直接双击打开会因浏览器安全限制无法加载数据）\n\n   **方式一：使用 VS Code Live Server 插件（推荐）**\n   - 安装 Live Server 插件\n   - 右键点击 `index.html` → \"Open with Live Server\"\n\n   **方式二：使用 Python**\n   ```bash\n   # Python 3\n   python -m http.server 8080\n   \n   # 然后访问 http://localhost:8080\n   ```\n\n   **方式三：使用 Node.js**\n   ```bash\n   npx serve\n   ```\n\n3. **部署**：将整个文件夹上传到任意静态托管服务（GitHub Pages、Vercel、Netlify 等）\n\n## 📝 支持可视化编辑\n\n在导航页面按Ctrl+F9即可显示进入编辑模式的按钮（位置在左上角logo右边），点击即可开始可视化编辑。\n\n### 顶部导航菜单编辑\n进入编辑模式后，页头菜单支持“所见即所得”的编辑：\n- **新增菜单**：点击菜单栏末尾的虚线框按钮即可添加新菜单项。\n- **内联编辑**：鼠标悬停在已有菜单上，下方会弹出“编辑”与“删除”按钮。\n- **拖拽排序**：直接按住菜单项文字即可在页头左右移动调整位置。\n- **子菜单管理**：在编辑弹框中提供列表式编辑器，支持子菜单的新增、删除及内部排序。\n\n编辑好了之后导出`momo-nav.json`配置，替换掉原来的即可。不替换的话只是临时保存哦！\n\n编辑模式底部还支持一键导出 `site.webmanifest`（用于移动端“添加到主屏幕”图标与主题色）。\n\n### 💡 编辑器辅助：纠正功能\n\n在 Ctrl+F9 编辑模式下，所有路径类输入框（如图标、Logo、封面等）右侧都有一个 **“纠正”** 按钮。它可以一键处理以下常见错误：\n\n-   **清理 Font Awesome 标签**: \n    如果你直接从官网复制了 `\u003ci class=\"fa-solid fa-star\"\u003e\u003c/i\u003e`，点击纠正会提取出 `fa-solid fa-star`。\n-   **修复 Windows 路径**: \n    自动将反斜杠 `\\` 转换为 Web 通用的正斜杠 `/`。\n-   **智能截断绝对路径**: \n    如果你复制了本地电脑的全路径（如 `D:\\Nav\\other-favicon\\icon.svg`），系统会识别项目内的特征文件夹（如 `other-favicon/`, `mn-src/`, `assets/` 等）并自动截断多余的本地路径，将其变为相对于根目录的路径（如 `/other-favicon/icon.svg`）。\n-   **补全路径前缀**: \n    自动为相对路径补齐开头的 `/`，确保路径在任何情况下都能被正确识别为 URL。\n\n## 🧩 自定义扩展钩子 (Custom Features)\n\n核心引擎支持在 `momo-nav.json` 中通过 `customFeatures` 字段动态注入样式和脚本，实现在不修改核心代码的情况下扩展功能。\n\n### 配置方案\n在 `momo-nav.json` 中按需添加：\n```json\n{\n  \"customFeatures\": {\n    \"styles\": [\"tools/tools-panel.css\"],\n    \"scripts\": [\"tools/tools-panel.js\"]\n  }\n}\n```\n\n### 适用场景\n- **私有功能扩展**：在不污染核心逻辑的前提下，添加如“工具箱”、评论系统或站点统计。\n- **样式个性化**：通过外部 CSS 文件覆盖默认样式，实现深度 UI 定制。\n- **第三方脚本注入**：集成在线客服、广告等第三方服务。\n\n### 接入规范与技术细节\n1. **加载机制**：CSS 通过 `link` 标签同步注入，JS 通过 `script` 标签异步（`async`）注入。\n2. **加载时机**：引擎会在 `momo-nav.json` 加载完成后立即触发注入，确保功能准备就绪。\n3. **事件同步**：扩展脚本应监听 `momo-nav-ready` 事件以获取完整的配置数据：\n   ```javascript\n   window.addEventListener('momo-nav-ready', (e) =\u003e {\n       const data = e.detail; // 这里是原始导航配置对象\n       // 初始化您的功能逻辑...\n   });\n   ```\n4. **防止冗余**：引擎会自动检查资源路径，避免重复加载。\n\n## 📝 完整配置说明\n\n详细的配置参数说明（包括基础配置、Logo、封面、主题、搜索引擎、Iconfont 等）请参考：\n\n👉 [**完整配置指南 (Docs)**](docs/configuration.md)\n\n## 📝 配置示例\n\n见仓库根目录下 `cunyu1943.json` 文件。\n\n## vercel部署\n\n一般正常部署即可，但想必你也是注意到了这个仓库的目录下有`vercel.json`文件，和`scripts/`文件夹，这个似乎不是正常静态网站部署所必须的。\n\n那么，你如果想要玩点花活儿，可以参考：[Vercel构建时从 Vercel Blob 中拉取资源的实践](https://ihcll.cn/posts/use-vercel-blob-storage-for-build-time-assets/)，这里说明了这个是干啥的。\n\n但只想安安静静的用一下导航，正常部署，大可不必理会，你甚至可以删掉这些文件。\n\n## 📄 许可证\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcunyu1943%2Fnav","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcunyu1943%2Fnav","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcunyu1943%2Fnav/lists"}