{"id":17229998,"url":"https://github.com/jiangtj/hexo-netlify-cms","last_synced_at":"2025-04-14T02:31:37.186Z","repository":{"id":45994985,"uuid":"164308465","full_name":"jiangtj/hexo-netlify-cms","owner":"jiangtj","description":":coffee: A cup of coffee time to enable Netlify CMS","archived":false,"fork":false,"pushed_at":"2021-11-22T05:22:56.000Z","size":290,"stargazers_count":33,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-27T16:49:25.042Z","etag":null,"topics":["hexo","hexo-plugin","netlify-cms"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jiangtj.png","metadata":{"files":{"readme":"README-ZH.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":"jiangtj","open_collective":null,"ko_fi":"jiangtj","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2019-01-06T13:13:21.000Z","updated_at":"2024-11-05T19:00:15.000Z","dependencies_parsed_at":"2022-07-20T05:47:32.730Z","dependency_job_id":null,"html_url":"https://github.com/jiangtj/hexo-netlify-cms","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiangtj%2Fhexo-netlify-cms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiangtj%2Fhexo-netlify-cms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiangtj%2Fhexo-netlify-cms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiangtj%2Fhexo-netlify-cms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jiangtj","download_url":"https://codeload.github.com/jiangtj/hexo-netlify-cms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248810883,"owners_count":21165195,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["hexo","hexo-plugin","netlify-cms"],"created_at":"2024-10-15T04:52:09.701Z","updated_at":"2025-04-14T02:31:36.321Z","avatar_url":"https://github.com/jiangtj.png","language":"JavaScript","funding_links":["https://patreon.com/jiangtj","https://ko-fi.com/jiangtj"],"categories":[],"sub_categories":[],"readme":"# Hexo Netlify CMS\n[![](https://img.shields.io/npm/v/hexo-netlify-cms.svg?style=popout-square)](https://www.npmjs.com/package/hexo-netlify-cms)\n![npm](https://img.shields.io/npm/dt/hexo-netlify-cms.svg?style=popout-square)\n![npm](https://img.shields.io/npm/l/hexo-netlify-cms.svg?style=popout-square)   \n\n这是一个Netlify CMS的Hexo插件，你可以使用它，简单的开启Netlify CMS服务.   \n\n[Live Demo](https://github.com/JiangTJ/hexo-netlify-cms-example) | [English Docs](README.md)\n\n## 快速开始\n\n### Step1: 添加依赖\n```bash\nyarn add hexo-netlify-cms\n```\n\n`hexo s --debug`添加`--debug`选项，打开`http://localhost:400/admin/`可进行预览\n\n### Step2: 在Netlify中开启服务\n\n- 需要将你的**源码**push至GitHub仓库，并使用该源码项目启用netlify服务\n\n- 需要开启netlify git-gateway服务\n  ![](imgs/git-gateway.png)\n\n**注意： 将身份认证设为仅邀请模式**\n\n等待部署完成, 访问`${your-site}/admin/`查看与使用\n\n## 其他配置\n\n设置自定义配置文件，覆盖[默认的](admin/config.yml)，自定义配置文件的定义变量与hexo配置文件的`netlify_cms`变量中定义的等效\n```yml\nnetlify_cms:\n  config_file: netlify-cms.yaml\n```\n\n设置post与page自动生成器\n```yml\nauto_generator:\n  post: \n    # 如果你有多个Post文件夹，在这里定义多个，见https://github.com/jiangtj/blog/blob/master/netlify-cms.yaml\n    all_posts:\n      # 设置为false，关闭默认的Post\n      #enabled: true\n      label: \"Post\"\n      folder: \"source/_posts\"\n      create: true\n      editor:\n        preview: true\n  # Page生成配置\n  page: \n    enabled: true\n    config:\n      label: \"Page\"\n      # 默认禁止删除Page文件\n      delete: false\n      editor:\n        preview: true\n```\n\n设置全局的fields\n```yml\nglobal_fields:\n  # 通过hexo配置覆盖时间格式\n  over_format: true\n  # 默认的fields\n  default:\n    - {label: \"Title\", name: \"title\", widget: \"string\"}\n    - {label: \"Publish Date\", name: \"date\", widget: \"datetime\", dateFormat: \"YYYY-MM-DD\", timeFormat: \"HH:mm:ss\", format: \"YYYY-MM-DD HH:mm:ss\", required: false}\n    - {label: \"Tags\", name: \"tags\", widget: \"list\", required: false}\n    - {label: \"Categories\", name: \"categories\", widget: \"list\", required: false}\n    - {label: \"Body\", name: \"body\", widget: \"markdown\", required: false}\n    - {label: \"Permalink\", name: \"permalink\", widget: \"string\", required: false}\n    - {label: \"Comments\", name: \"comments\", widget: \"boolean\", default: true, required: false}\n  # 默认的post fields，如果设置，posts的fields将从这里取\n  #post:\n  # 默认的page fields，同理\n  #page:\n```\n\n添加脚本, 用于自定义组件和预览样式   \n例如：    \n添加[youtube.js](https://github.com/JiangTJ/hexo-netlify-cms-example/blob/master/source/js/cms/youtube.js)至你的博客下  \n或者添加[img.js](https://github.com/JiangTJ/hexo-netlify-cms-example/blob/master/source/js/cms/img.js)至你的博客下   \n```yml\nnetlify_cms:\n  scripts:\n    - js/cms/youtube.js\n    #- js/cms/img.js\n    #或者使用 jsdelivr cdn\n    #- https://cdn.jsdelivr.net/gh/JiangTJ/hexo-netlify-cms-example@0.0.1/source/js/cms/youtube.js\n    #- https://cdn.jsdelivr.net/gh/JiangTJ/hexo-netlify-cms-example@0.0.1/source/js/cms/img.js\n```\n\n另外，其他的`netlify_cms`配置变量可以在[Netlify CMS](https://www.netlifycms.org/docs/configuration-options/)中找到  \n\n## 提示\n1. 建议开启`Netlify Large Media`，可以使媒体载入更快。[Large Media Docs](https://www.netlify.com/docs/large-media/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiangtj%2Fhexo-netlify-cms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjiangtj%2Fhexo-netlify-cms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiangtj%2Fhexo-netlify-cms/lists"}