1. 安装
npm install --global gatsby-cli
2. 使用
// 创建项目
gatsby new dalong
cd dalong
// 启动
gatsby develop -- 使用的是热加载端口 8000
// 编辑源码
src/pages.
// 生产构建
gatsby build -- 优化的代码以及预加载的路由
// 启动一个本地的html 服务器测试构建的站点
gatsby serve
3. 效果
 
开发启动
 
界面
 
graphql 
 
生产构建项目目录
 
生产界面优化(总的来说使用了好多的优化)
 
 
4. 总结
优化效果,以及方便使用上还是比较好的,而且在数据访问上也是比较到位的

备注: 对于需要远程访问的可以在  gatsby develop -H ip   以及  gatsby serve -H ip
5. 参考文档
https://www.gatsbyjs.org/docs/
 
 
 
 

gatsbyjs 使用的更多相关文章

  1. gatsbyjs 了解

    1.  模型 2. 总结&&资料 从模型上可以看出和jamstack 提出的架构模型比较相似,可以看成是一个具体的实现,功能还是比较强大的 https://www.gatsbyjs.o ...

  2. Hugo + Github Pages 搭建个人博客

    尝试过 Hexo .GatsbyJs. Vuepress 搭建博客后,对这些工具最大的不满,就是运行速度以及打包速度. 后来看到 Hugo ,号称最快的静态站点生成器后. 尝试搭建博客,发现不管是运行 ...

  3. Gatsby & React & NPX & NVM

    Gatsby & React Gatsby is a blazing fast modern site generator for React. https://www.gatsbyjs.or ...

  4. how to build an app with github

    how to build an app with github Building apps https://developer.github.com/apps/ demos https://githu ...

  5. 2019 front-end web trending

    2019 front-end web trending https://github.com/kamranahmedse/developer-roadmap https://raw.githubuse ...

  6. next.js 简单使用

    1. 介绍 一个react.js 服务器端渲染开源项目(不只是服务器端渲染,直接也可以生成纯静态站点) 类似的解决方案有好多,比如react.js 自身的服务器渲染方案(但是使用起来就是比较怪异) g ...

  7. Documentation & Markdown

    Documentation & Markdown markdown to document & document website generator https://github.co ...

  8. React Gatsby 最新教程

    React Gatsby 最新教程 https://www.gatsbyjs.com/docs/quick-start/ https://www.gatsbyjs.com/docs/tutorial/ ...

  9. Awesome Gatsby blog websites

    Awesome Gatsby blog websites very simple very clean i18n dark mode (css var) demos https://overreact ...

随机推荐

  1. 在 CentOS 7.0 上安装配置 Ceph 存储

    来自: https://linux.cn/article-6624-1.html Ceph 是一个将数据存储在单一分布式计算机集群上的开源软件平台.当你计划构建一个云时,你首先需要决定如何实现你的存储 ...

  2. quartz(2) -- 入门案例

    第一步:添加jar,maven配置 <!-- quartz --> <dependency> <groupId>org.quartz-scheduler</g ...

  3. CocoaPods学习系列5——错误集锦

    这篇文章记录使用CocoaPods过程中遇到的一些错误. 1.error:include of non-modular header inside framework module 在自定义类库中,引 ...

  4. .NET中如何测试Private和Protected方法

    TDD是1)写测试2)写通过这些测试的代码,3)然后重构的实践.在,NET社区中, 这个概念逐渐变得非常流行,这归功于它所增加的质量保证.此时,它很容易测试public方法,但是一个普遍的问题出现了, ...

  5. Standard 1.1.x VM与Standard VM的区别

    在Eclipse或MyEclipse中要设置Installed JREs时,有三个选择: - Execution Environment Description - Standard 1.1.x VM ...

  6. thinkphp <eq> <if>标签 condition中可以写PHP的判断逻辑

    <ul> <volist name="monthArray" id="monthItem"> <if condition=&quo ...

  7. vue组件化开发-vuex状态管理库

    Vuex 是一个专为 Vue.js 应用程序开发的状态管理模式.它采用集中式存储管理应用的所有组件的状态,并以相应的规则保证状态以一种可预测的方式发生变化.Vuex 也集成到 Vue 的官方调试工具 ...

  8. Windows Server 2016 桌面环境的自动配置脚本(2017-10-24更新)

    github:https://github.com/m2nlight/WindowsServerToWindowsDesktop 下载:https://github.com/m2nlight/Wind ...

  9. JSON.parse()和JSON.stringify()以及stringify()字符串格式化

    1. parse用于从一个字符串中解析出json对象,如var str = '{"name":"huangxiaojian","age":& ...

  10. 关键C函数备录

    一.搜索指定路径下的文件 (1) intptr_t _findfirst(const char *, struct _finddata_t *);//可以使用通配符*或? (2) int _findn ...