# linkel_site **Repository Path**: linkel/linkel_site ## Basic Information - **Project Name**: linkel_site - **Description**: website of linkel - **Primary Language**: NodeJS - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2018-11-04 - **Last Updated**: 2022-05-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Website of Linkel ## 参考阅读 - [Strapi - Node.js Headless CMS for building customizable API](https://strapi.io/) ——内容管理采用Strapi,Strapi支持自定义内容类型,Strapi推荐mongoDB作为存储. - [Gatsby](https://www.gatsbyjs.org/) ——内容发布采用Gatsby,Gatsby能够将各种类型的数据来源与React模版结合,生成静态页面 - [Gatsby Material Starter](https://github.com/Vagr9K/gatsby-material-starter)——此模版让页面支持跨终端,将其后台的内容管理替换为Strapi ## 安装 - install [NodeJS](https://nodejs.org/zh-cn/) - install [MongoDB](https://docs.mongodb.com/manual/administration/install-community/) - install [Yarn](https://yarnpkg.com/lang/en/docs/install/) ## 运行 - `mkdir mongoDBStore` - `mongod -dbpath mongoDBStore` - `mongorestore -d api3 -dir ./data/api3` 导入本目录下 `./data`目录下初始数据 (对应导出命令 `mongodump -d api3 -o ./data`) - 导入mongoDB初始数据 ## 下载项目到本地 - `git clone https://gitee.com/linkel/linkel_site.git` ## 运行Strapi,进行内容编辑 - `cd api` - `yarn install` - `npm run setup --plugins` - `yarn setup` 安装Strapi服务及插件 - `yarn start` 启动Strapi服务,服务启动之后,可以在上传图片,或者录入/编辑`Article`内容。 上传的文件存放在可以被Gatsby直接读取和处理的目录,其他内容保存在MongoDB中,通过graphql方式为Gatsby模版所获取。 ## 运行Gatsby,进行内容预览和发布 - `cd blog` - `yarn install` 安装依赖包 - `yarn develop` 内容预览,gatsby默认只允许从localhost访问,如果需要在LAN中访问,使用命令`gatsby develop -H 0.0.0.0` - `yarn build` 生成静态内容