Giter VIP home page Giter VIP logo

html5-template's Introduction

HTML5-Template

A simple HTML5 template with the power of Webpack 4

GitHub stars David David GitHub license

This template is built to provide a head start for building the frontend of multipage websites. No-frills, just plain good old HTML5, CSS3, JS and jQuery with a dash of autoreloading. Some parts are taken from popular open source projects.

Installing

  • Clone this repository.
  • Browse into the project directory
  • Do yarn install
  • Then you are good to go!! ๐ŸŽ‰

NOTE: For every new build existing dist directory will be deleted.

Working with the template

Adding new pages

To add new page (ex: page2.html) in your project, create html, css, js files inside src directory and under respective directories.
Then,

  • add an entry point inside app.js file like following:
    // page2 refers to the name of the html file
    page2: [
      "./src/js/<your-js-file>.js",
      "./src/css/<your-stylesheet>.css"
    ]
  • ๐ŸŽ‰ And you are all done!! ๐ŸŽ‰

Using Modernizr

Modernizr is turned off by default but if you need to use it, you first need to generate the custom build.
To do so:

  • Modify the modernizr-config.json file to add whatever tests/ options you need. For full set of tests/ options refer here.
  • Run yarn build:modernizr to generate the custom build into your src/js/ directory.
  • Add it to your app.js file. Remember, to put it on top of everything (see below example), or else you might have some errors.
     index: [
         "./src/js/modernizr.js",
         "./src/js/index.js",
         "./src/css/index.css"
     ]
  • Now, you can use modernizr in both css and js files. For example if you want to use modernizr in a js file, you can do as below:
    if (Modernizr.someFeature) {
        console.log("Available");
    } else {
        console.log("Not Available");
    }

Using a backend during development

To use a backend REST api, edit proxy-config.json. For advanced usages, visit here.

Remember to run you backend server first.

Running your project

Development: yarn start
It will start the dev server at localhost:8080.

Production: yarn build
It will build the whole project into dist directory.

Build modernizr.js: yarn build:modernizr
It will build the custom modernizr.js into src/js/ directory.

Contributing

You can contribute to this project in the following ways:

  • Bug reporting by creating an issue in this repo.
  • Fixing bugs by opening a PR.
  • Proposing some new additions/ improvements.
  • Star this project if you found it helpful. ๐Ÿ™ ๐Ÿคž

html5-template's People

Contributors

dependabot[bot] avatar whimsicaldreamer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

av-jok ivopc szjoe79

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.