{"id":25023145,"url":"https://github.com/hlerenow/hel","last_synced_at":"2025-06-24T13:09:02.271Z","repository":{"id":123299999,"uuid":"80011954","full_name":"hlerenow/HEL","owner":"hlerenow","description":"轻量级的、可定制的单用户blog","archived":false,"fork":false,"pushed_at":"2023-02-17T06:22:27.000Z","size":8638,"stargazers_count":29,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"HEL","last_synced_at":"2025-04-13T08:08:42.554Z","etag":null,"topics":["blog","express","hel","js","nodejs","vue2","webpack"],"latest_commit_sha":null,"homepage":"http://hel.h-five.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hlerenow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2017-01-25T12:22:02.000Z","updated_at":"2023-02-17T06:25:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"8ae0dba2-18d1-4052-a803-87729c753174","html_url":"https://github.com/hlerenow/HEL","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hlerenow/HEL","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlerenow%2FHEL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlerenow%2FHEL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlerenow%2FHEL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlerenow%2FHEL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hlerenow","download_url":"https://codeload.github.com/hlerenow/HEL/tar.gz/refs/heads/HEL","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlerenow%2FHEL/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261682921,"owners_count":23193677,"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":["blog","express","hel","js","nodejs","vue2","webpack"],"created_at":"2025-02-05T14:36:27.377Z","updated_at":"2025-06-24T13:09:02.244Z","avatar_url":"https://github.com/hlerenow.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HEL单用户博客系统介绍\n\nHEL是一个轻量级的、可定制的单用户blog系统。\n\n### 支持的功能：\n\n1. 文章的发布、修改、删除\n2. 目录的创建、修改、删除\n3. 支持给文章添加标签\n4. 可以给不同的目录绑定不同的模版\n5. 媒体库\n6. 支持主题\n7. 支持一级菜单的自定义\n8. markdow编辑器\n9. 前后端分离,使用者可以自己定制开发后台管理界面(后台API接口文档后续会编写)\n\n### 计划开发的功能（未实现...）\n\n1. 标签管理\n2. 页面的创建，修改，删除(和wordpress的页面类似)\n3. 给模版注入一些固定的数据\n4. 媒体专辑功能\n5. 前端作品库(上传前端作品zip压缩包，压缩包的内容按照一定的格式压缩，后台自动解压生成作品连接，并且可以在模版的制作中使用)\n6. 媒体专辑功能\n7. 备份功能\n8. 数据库修复功能（因为使用myisam引擎难免会出现数据库碎片）\n9. 站点转移功能（将媒体的url地址的域替换为新的域名）\n\n\nHEL目前只拥有一些基本的blog功能。\n\n# HEL安装\n\n\n* 安装nodejs（**\u003e=6.0**，网上有教程）\n\n* 安装mysql(网上有教程)\n\n* git clone https://github.com/hlerenow/HEL.git 或者下载 压缩包解压\n\n* 修改数据库配置信息,在HEL/config/config.json 里面修改\n\n```\n{\n\t\"db\": {\n\t\t\"host\": \"localhost\",\t//数据库ip\n\t\t\"dbName\": \"hel2\",\t\t//数据库名\n\t\t\"user\": \"root\",\t\t\t//数据库帐号\n\t\t\"dbPassword\": \"595806119\",\t//数据库密码\n\t\t\"dbPort\": \"3306\"\t//数据库端口\n\t},\n\t\"crypto\": {\n\t\t\"hash\": \"123456\"\n\t},\n\t\"isInstall\": false\t//改为false，如果值为true ，系统不会创建mysql表\n}\n```\n\n* 在 HEL/public/下面创建两个文件夹，upload和uploadTemp,如果存在就不用创建\n\n* 在 HEL下面创建log文件夹，如果存在就不用创建\n\n* 在 HEL(项目根目录)目录下运行npm install \n\n\n到此程序的安装配置基本完成,程序的运行 请看 下一篇文档 运行 **HEL**\n\n### 常见问题\n* 如果出现文件上传失败，或者主题上传失败请检查运行HEL程序的用户是否拥有对程序文件目录的读写权限，这个问题多出现在linux下，ubuntn 使用 sudo node app ，输入密码后运行，即可解决问题\n\n# 运行HEL\n\n## 命令(所有的命令都是在项目的根目录下执行)\n\n#### 安装程序所需依赖包\n\n```\nnpm install\n```\n\n#### 直接使用node运行程序(不推荐)\n\n###### 设置 程序端口 并且运行程序\n---\n* windows 下\n```\nset PORT=80\n\nnode app\n```\n\n* linux\n```\n PORT=80 node app\n```\n\n*关闭程序 \n\n\tCtrl+c\n\n\n#### 使用forever 守护程序(推荐)\n---\n因为nodejs单线程的特性，一旦出错就会导致整个程序奔溃（即使我们对错误做了很多的防范措施）,所以我们需要一个程序来守护我们的程序，当他崩溃时能让，程序快速的重启，这个我们选用的是forever（如果你喜欢pm2，也可自行配置,主要就是修改名package.json 的script值,以及包的安装）\n\n安装全局 forever\n\n```\nnpm install forever -g\n\n```\n\n* windows\n\n```\nnpm run start\n```\n\n* linux\n\n```\nnpm run start\n```\n\n* 关闭程序\n\n```\nnpm run stop\n```\n\n### 帐号\n\n\u003e初始账号 admin  密码 123456\n\n\n* 程序运行成功后\n\t打开浏览器 http://localhost 即可查看效果，\n\t后台管理地址http://localhost/admin\n\t(默认端口为80,如果你设置了端口为其他端口 port,则打开 http://localhost:port 即可)\n\n### 注意\n程序运行成功后第一件事是登录后台，选择设置，修改 站点地址,也就是你的网站域名，因为媒体库的上传依赖于这个值\n但是不要轻易修改这个值，因为媒体的上传会将媒体的绝对url地址写入数据库，修改后会导致媒体文件找不到的错误\n\n\n#HEL主题\n\nHEL也支持和wordpress类似的模版功能，但是又和有wordpress又不一的地方，众所周知，nodejs是异步的无阻塞的，所以这就注定了不能在模版里去像wordpress一样去操作数据库，获取数据。目前采取的方案是提前把数据查到后，注入到模版里面，这样在模版里面就只用操作数据就行了（虽然这样做可以实现数据的获取，但是会导致一个问题，但是有解决方案，只不过还没代码实现）\n\n### 主题目录结构\n```\n\n│  archive.html //归档页模版\n│  catalog.html //默认目录模版\n│  catalog1.html\n│  config.json //主题配置文件\n│  footer.html\n│  header.html\n│  helper.js    //主题的一些辅助函数\n│  index.html //默认主页模版\n│  nav.html\n│  post.html\n│  \n└─public   //静态资源文件 ，静态资源文件只能在放在 **public** 下面\n    │  favicon.ico\n    │  \n    ├─css\n    │      index.css\n    │      \n    ├─img\n    │      head_img.jpeg\n    │      \n    └─js\n```\n\n主题的目录结构大致如上\n\n### 模版引擎\n\nHEL主题模版使用的是ejs 模版引擎渲染，ejs的使用简单，学习基本无成本\n\n模版语法参考地址 [EJS](https://github.com/mde/ejs)\n\n### 模版的上传\n\t将上述文件打包压缩为zip格式的压缩包，就可以在后台管理界面的主题出上传（旧的主题不会被删除，同名的主题会被覆盖）\n\n### 每个模版的公共变量\n\n1. Helper\n\t一个对象，下面有一些内置的函数，用来格式化数据（具体的函数功能可以查看serveice/templateFunction.js）\n2. helper\n\t主题目录下helper.js 里的用户自己编写的方法\n3. menue\n\t用户自定义的菜单值，一个对象\n4. baseInfo\n\t后台设置里面设置的值\n5. recentPosts\n\t最新的10篇文章\n\n完整的数据结构可以在 使用默认模版  的情况下 ，打开浏览器调试 ，选择console，查看，\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhlerenow%2Fhel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhlerenow%2Fhel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhlerenow%2Fhel/lists"}