Giter Club home page Giter Club logo

bootstrap-4-boilerplate's Introduction

Bootstrap 4 Boilerplate

Front end boilerplate project for Bootstrap 4.

Note

This boilerplate project intends for tiny static sites with few pages. If you want to build a content website, see Lightweight CMS instead.

Technology Stacks

Main tools used during development:

  • Gulp: build automation for the project
  • Nunjucks (with Markdown support): HTML template language
  • Sass: write CSS in Sass
  • Autoprefixer: add prefix for your CSS sheet
  • stylelint: check the quality of your CSS sheet
  • Babel: JavaScript transpiler
  • Flow: add type checking for JavaScript
  • ESLint: check the quality of your JavaScript code
  • eslint-plugin-compat: check browser compatibility

Libraries used in the output:

Usage

Start a New Project

Clone this repo:

$ git clone https://github.com/cwchentw/bootstrap-4-boilerplate.git myapp

Change your working directory to the root of the cloned repo:

$ cd myapp

Install required packages:

$ npm install

After editing myapp, update the remote URL to save the local repo to a new remote one:

$ git remote set-url origin https://example.com/user/myapp.git
$ git push -u origin master

Build a Project

Invoke this command to build a project:

$ npm run dev

The output will be in public directory. During development phase, all assets will keep pretty format.

Live Code a Project

Invoke this command:

$ npm run watch

Visit the output at http://localhost:3000/ . While ediing the project. the output will be updated automatically.

Publish a Project

Invoke this command to build a project for production environment:

$ npm run prod

The output will be in public directory. During production phase, all assets will be minified to save bandwidth.

Upload the content in public directory to a remote web server to publish this project.

Use Markdown in the Project

Nunjucks doesn't support Markdown by default. Its support in Nunjucks is implemented in a plugin.

To write a Markdown document, wrap such code in a specific region:

{% markdown %}
Hello World
===========
# Do stuff
{% endmarkdown %}

You may include a Markdown file as a template:

{% markdown "post.md" %}

Alternatively, include some Markdown code as a partial:

{% markdown %}
{% include 'post1.md' %}
{% include 'post2.md' %}
{% endmarkdown %}

Note for Web Developers

You should NOT use the builtin error pages provided by your web server. Such pages usually reveal too much system information. Instead, you should set redirecting rules and custom error pages for erroreous HTTP status codes.

In this boilerplate project, we provide a custom HTTP 404 error page. Nevertheless, the page works only on our development environment. You still need to set your own redirecting rules and custom error pages on your production environment.

See Also

This boilerplate project is largely inspired by tonik/html-frontend-boilerplate.

Why re-inventing the wheel? That project didn't migrate to Gulp 4 yet as this repo was built. In addition, the project used Rollup as its bundler, which doesn't support multiple JavaScript files when combined with Gulp. Hence, I updated to Gulp 4, dropping Rollup to support multiple scripts in this repo.

Copyright

Copyright (c) 2019-2021, Michelle Chen. Licensed under MIT license

bootstrap-4-boilerplate's People

Contributors

cwchentw avatar dependabot[bot] avatar opensourcedoc avatar

Stargazers

 avatar

Watchers

 avatar  avatar

bootstrap-4-boilerplate's Issues

ability to copy files from node_modules?

Hello,
is this template have ability copy files from node_modules to dist

example, i want to use many jquery plugins and i want to copy only their dist js, css file.....is it possible to do it?

thanks

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.