Coder Social home page Coder Social logo

alogan5201 / new-portfolio Goto Github PK

View Code? Open in Web Editor NEW

This project forked from brentoncozby/ejs-sass-static-boilerplate

0.0 0.0 0.0 50.52 MB

Boilerplate for a Static website using EJS and SASS

License: MIT License

JavaScript 36.76% HTML 24.31% SCSS 38.94%

new-portfolio's Introduction

Brenton's Frontend Boilerplate

Use EJS, SASS, and the latest JavaScript syntax to build fully-static production code with fast, live updates during development and the latest optimizations upon production. Global variables are used throughout the project to make it easily reconfigurable and DRY. Focus on building your frontend, not on building your tools.

Websites built with this boilerplate:

Globals

globals.js: The variables in this file, such as SITE_TITLE and PP (public path), are used throughout the project. Change them in globals.js and they will be updated throughout your entire codebase where used. They are provided as global variables in your JS and EJS files.

Basic Usage

  • Use the PP (public path) value from globals.js in the views dir with <%= PP %>. This will allow you to deploy your site from whichever directory you set PP to
  • The src/static folder:
    • Everything in this folder will be copied (with folder/file structure maintained) into the dist folder unchanged
    • If there is an images/pineapple.jpg file in src/static, you would reference this in any of your *.ejs files (src/views) like this:
          <img src="<%= PP %>/images/pineapple.jpg">
  • The main JS file is src/js/index.js. This will become app.js
  • A separate vendor.js bundle will be created from node_modules added to the "vendor" array in webpack.config.js
  • Some SASS helper classes are available in src/css/_helpers.scss
  • Add the class 'appear' to any html element to give it a fade-in/fade-out effect when it scrolls into/out-of view
  • Set Google Analytics ID in globals.js
  • Favicons: go to https://realfavicongenerator.net/ and put the generated favicons into src/favicons

DEVELOPMENT

npm run dev (to prepare files, start server, and watch files)

Development Features:

  • CSS updates without browser reload; browser auto-reloads upon JS and HTML updates
  • Source maps for SASS and JS files for easier debugging

PRODUCTION

npm run build

Production Features:

  • Minification for CSS (with Autoprefixer), JS (with Babel), and HTML files
  • Filename hashing for css and js files (for cache busting)
  • Easy Code-splitting. Hookup code that won't change often (like libraries and packages) in src/js/commmon/index.js
  • Tree-shaking and uglyfication from Webpack
  • Project info banner prepended to the top of JS and CSS files

Other Features:

  • Use the latest JavaScript syntax thanks to babel-preset-stage-0
  • A polyfills file from Polyfill.io file that only loads if the client doesn't have certain features
  • CSS helpers, including classes for "show/hide on scroll" behavior, "split-box" classes for grid behavior, and more in _helpers.scss
  • print.scss for common css fixes when printing a web page
  • Prettier instead of EsLint - npm run prettier; /prettier.config.js
  • Lazy loading! check out /src/js/lazy-module.js for an example

Included Libraries:

  • Sanitize.css - common CSS resets. The evolution of Normalize.css
  • Font Awesome - I mainly use it for icons
  • bling.js - the 1% of jQuery you use 99% of the time
  • dompurify - should use this on any user-inputted data
  • lodash.throttle - already used in the CSS helper classes that show/hide an element on-scroll
  • HTML5Boilerplate - includes presets in html & css for web best practices, and includes a .htaccess file

new-portfolio's People

Contributors

brentoncozby avatar

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.