当前位置: 首页 > 软件库 > Web应用开发 > >

create-static-site

授权协议 MIT License
开发语言 JavaScript
所属分类 Web应用开发
软件类型 开源软件
地区 不详
投 递 者 严元白
操作系统 未知
开源组织
适用人群 未知
 软件概览

Create Static Site

Create static websites with no build configuration.

Overview

npx create-static-site my-site --template hugo
cd my-site
npm start

(npx comes with npm 5.2+ and higher)

Then open http://localhost:3000/ to see your app.

Creating a Static Site

You’ll need to have Node >= 6 on your local development machine. You can use nvm (macOS/Linux) or nvm-windows to easily switch Node versions between different projects.

To create a new app, run:

npx create-static-site my-site --template [template]

Replace [template] with either hugo or jekyll.

It will create a directory called my-site inside the current folder.
Inside that directory, it will generate the initial project structure and install the transitive dependencies:

my-site
├── LICENSE
├── node_modules
├── package.json
├── README.md
├── static-scripts.config.js
├── .browserslistrc
├── .eslintrc.yml
├── .gitignore
├── .postcssrc.js
├── .stylelintrc.yml
├── site/ # Depends on the static site generator
└── src/
    ├── css/
    │   ├── styles.css
    │   └── imports
    │       └── resets.css
    ├── img/
    │   └── svg/
    │       ├── bitbucket.svg
    │       ├── github.svg
    │       └── gitlab.svg
    └── js/
        ├── scripts.js
        └── imports/
            └── index.js

No configuration or complicated folder structures, just the files you need to build your site.
Once the installation is done, you can open your project folder:

cd my-site

Inside the newly created project, you can run some built-in commands:

npm start or yarn start

Jekyll users will need to run bundle install first

Runs the app in development mode.
Open http://localhost:3000 to view it in the browser.

The page will automatically reload if you make changes to the code.

npm build or yarn build

Builds the site for production to the dist folder.

Philosophy

  • One Dependency: There is just one build dependency. It uses Webpack, Babel, ESLint, PostCSS, and other amazing projects, but provides a cohesive curated experience on top of them.

  • No Configuration Required: You don't need to configure anything. Reasonably good configuration of both development and production builds is handled for you so you can focus on writing code.

  • No Lock-In: You can “eject” to a custom setup at any time. Run a single command, and all the configuration and build dependencies will be moved directly into your project, so you can pick up right where you left off.

What's Included?

Your environment will have everything you need to build a modern static website:

  • A Static Site Generator (Jekyll or Hugo)
  • Language extras beyond ES6, like object spread operator.
  • Autoprefixed CSS
  • Hassle-free updates for the above tools with a single dependency.

The tradeoff is that these tools are preconfigured to work in a specific way. If your project needs more customization, you can "eject" and customize it, but then you will need to maintain this configuration.

Static Sites

Static sites are websites built using static, unchanging files. Because the content is static, delivering it to users requires no server processing time. This feature makes static sites incredibly fast and performant.

Static site generators are the modern way of building static sites. They convert simple, text-based content files in static files ready for the web.

They’re fantastic for developers because they are extremely fast, are built to work with version-control, and require little-to-no setup compared to existing monolithic CMS solutions like Wordpress.

Currently, create-static-site supports two static site generators:

  • Jekyll is the static site generator written in Ruby and created by GitHub founder, Tom Preston Werner.
  • Hugo is the static site generator written in GoLang and created by Steve Francia.

Contributing

We'd love to have your helping hand on create-static-site! See CONTRIBUTING.md for more information on what we're looking for and how to get started.

Contributors

Thanks goes to these wonderful people (emoji key):


chrisdmacrae

�� �� �� �� �� �� �� �� ��

ncphillips

�� �� �� �� �� �� �� �� �� ⚠️ ��

Bryan Klein

�� �� ��

Scott Gallant

�� �� ��

DJ

�� �� ��

Sebastian Engels

�� �� �� ��

Adam

��

This project follows the all-contributors specification. Contributions of any kind welcome!

Acknowledgements

This project is greatly inspired by the wonderful create-react-app project.

  • gatsby create-react-app does not help you generate a server-side-rendered app easily. Anything that comes with it (SEO, speed…) is only provided by tools like Next.js and Gatsby. create-react-app无法帮助您

  • 先上一段运行异常: 2017-02-15 16:17:21.871 http-bio-1601-exec-1  INFO [com.jd.shortcut.web.controller.ShortcutPhaseAction:390] - [shortcut] query shortcut  phase group : {"aid":"test","appid":"im.waiter","clie

  • 推荐指数:???? 语言:js 模版:react 参考链接:https://github.com/react-static/react-static/tree/master/ 一、安装react-static npm i -g react-static 二、生成项目 react-static create cd my-static-site 三、编写 需要在js文件里面用react写页面。 四、运

  • 码云地址:https://gitee.com/liuhaizhang/drf-project-initialization 项目目录结构: study_drf            -home         -static         -study_drf         -util         -manage.py 一、安装的包 pip install django #drf基于dja

 相关资料
  • 描述: 记录一个静态成员。 概述 @static标签标明一个在父类中的标识符不需实例即可使用。 使用@static标签将重写标识符的默认作用域,但有一个例外:在全局作用域下的标识符将保持他的全局性。 例子 下面的例子可以写成 "@function MyNamespace.myFunction" 并省略@memberof和@static标签,他们的效果是一样的: 例如,在一个虚拟注释中使用@stat

  • Static Site Boilerplate   Discuss it on Product Hunt �� Homepage: http://staticsiteboilerplate.com/ Documentation: https://docs.staticsiteboilerplate.com/ Installation git clone https://github.com/eri

  • 描述 (Description) 它在集合中创建模型的新实例。 语法 (Syntax) collection.create(attributes,options) 参数 (Parameters) attributes - 它们表示已定义模型的属性。 options - 它使用id,name等参数来创建集合实例。 例子 (Example) <!DOCTYPE html> <html> <he

  • create 通过一个构建函数完整的创建一个 Observable create 操作符将创建一个 Observable,你需要提供一个构建函数,在构建函数里面描述事件(next,error,completed)的产生过程。 通常情况下一个有限的序列,只会调用一次观察者的 onCompleted 或者 onError 方法。并且在调用它们后,不会再去调用观察者的其他方法。 演示 创建一个 [0,

  • create 函数签名: create(subscribe: function) 使用给定的订阅函数来创建 observable 。 示例 示例 1: 发出多个值的 observable ( StackBlitz | jsBin | jsFiddle ) // RxJS v6+ import { Observable } from 'rxjs'; /* 创建在订阅函数中发出 'Hello' 和

  • lavas static 使用 Lavas 内置的静态服务器启动前端渲染的 Lavas 项目。 比较常规的用法是在前端渲染的项目进行构建后使用此命令进行启动。具体来说,如果开发者的项目使用的是前端渲染 (ssr: false),并且经过 lavas build 之后,在生成的 /dist 目录中,可以使用 lavas static 启动项目。在这种模式下,所有的代码均经过了 babel 转码和 w