Coder Social home page Coder Social logo

hexo-admin's Introduction

hexo 博客管理系统

持续更新中……

本项目实现了在线发布 hexo 博客文档,很大程度方便了文档发布!

正常使用

下载

git clone https://github.com/ssly/hexo-admin.git hexo-admin

安装

cd hexo-admin
npm install --production

启动

npm run start # 内部使用 pm2 作为守护进程启动

访问

http://localhost:3000

  1. 注意:本项目默认监听3000端口,可在配置文件( config/app.yml )修改
  2. 必须和 hexo项目 在同一个服务器

反向代理访问

如果你不是直接访问该服务器 3000 端口,而是配置了 nginx 反向代理访问它,可以参考如下步骤:

  1. 假设 nginx 配置如下

    location /admin/ {
      proxy_pass http://localhost:3000/;
    }
    
  2. 您需要在项目内改两个文件

    // config/index.js T62
    assetsPublicPath: '/', // --> assetsPublicPath: '/admin',
    
    // src/assets/ajax.js T10
    const HOST = '/api' // --> const HOST = '/admin/api'
  3. 重新编译 dist 静态资源

    1. 编译之前你需要执行 npm install 下载所有的包
    2. 执行编译命令 npm run build
  4. 然后可以通过 protocol//ip:port/admin 访问您的网页

    • 例如你的服务器域名为 https://a.com , 您可以输入 https://a.com/admin 访问该页面

指令

npm run start # pm2 启动程序
npm run restart # pm2 重启程序(必须项目已经启动前提下使用)
npm run stop # pm2 停止程序

项目调试(您可能无需调试)

  • 安装时,您需要下载所有依赖包
    • npm install
  • 启动时,您需要同时启动前端与后台
    • npm run serve
    • npm run start

项目介绍

目录结构

├── config
│   └── app.yml     // 配置文件
├── dist            // 静态资源
│   ├── index.html
│   └── static
├── src             // 静态资源源码
├── server          // hexo-admin 服务端代码
│   ├── index.js
│   └── yaml.js
└── src

关于项目

  1. 静态资源文件默认已经打包在dist目录下,如无需调整,无需关注
  2. 配置文件已实现动态配置,可在website配置,亦可直接修改config/app.yml

联系

邮箱:[email protected]

hexo-admin's People

Contributors

ssly avatar stickycandy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.