Code Monkey home page Code Monkey logo

html-skinning-boilerplate's Introduction

Installation:

Here are some easy installation steps:

  • Make sure nodejs installed (for templating, sass and SVG Spritesheet).
  • After installing nodejs, cd to the project folder through Command prompt.
  • npm install
  • npm install -g gulp
  • gulp (this will watch for changes related to sass, templates, svg spritesheet) (add prefix sudo in mac/linux, if necessary)

That's it!! everything is ready now. Always make sure to run gulp from your project folder through command prompt, before working on the code. The generated / compiled files will be available in dist/ folder.

Note: Work only on .scss and .pug / .nunj files. Don't try to change .css and .html files in dist/ folder. Keep other files like images, fonts and js files directly in dist/ folder.

Compiling HTML and CSS files

To compile HTML and CSS files from PUG / Nunjucks and SCSS files, respectively, you can run the following command in Command prompt:

  • gulp run => To compile the files once
  • gulp watch => To compile the files everytime there is a change in PUG / Nunjucks and SCSS files. (Continuous watcher)

html-skinning-boilerplate's People

Contributors

dependabot[bot] avatar kamlekar avatar srinivashappy avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

html-skinning-boilerplate's Issues

In group toggle

In HTML.js file, the toggle should happen in a group just like when we mention name attribute for some radio buttons, they toggle within the group.

Need to add new variable for relative paths

Hi, I think it will be useful to add new variable "path" to existing "css_path", "js_path", "img_path".
So we can easily set relativeness of our folders. Explanation: I have such project strucure:

project/
|  sass/
|  site/
|  templates-pre/
|  |  shop/
|  |  |  shop.html
|  index.html

In compiled site/shop/shop.html I have the same css/img/js paths as in site/index.html because css_path is unchangeable and set one time).

But if I have new path variable I set skeleton css/js/img paths that way:


<link href="{{path}}{{css_path}}main.css" />
<script src="{{path}}{{css_path}}scripts.js" />

And in templates-pre/shop/shop.html I set path variable to relative path:

{% set path="../" %}

So in site/shop/shop.html I have my relative paths:


<link href="../assets/css/main.css" />
<script src="../assets/js/scripts.js" />

That works fine for me.
Sorry I have no time to go deeper for github but I can only sketch my suggestions that way.

Rename project folders

Ok, now we have this folders structure in templates-pre:
| templates-pre
|---sections
|---variables
|---index.html

So imagine we need to create folders in our site, for adding a shop for example so structure will be:
| templates-pre
|---sections
|---shop
| |---shop-index.html
|---variables
|---index.html

So it's better to rename templating folders with underscore prefix to distinct where is site and where are templating:
| templates-pre
|---_sections
|---_variables
|---shop
| |---shop-index.html
|---index.html

Ok? If ok, next problem will appear...

Add travis-CI

Need to add travis for automated testing of the main branch for new pull requests. I don't know how to do this. Help is really appreciated.

[Need help] Creating html.js file

<div class="html-click" data-html-class="btn" data-html-target=".className"></div>

As shown in the above example element, I am trying to write a small JS library.

Explanation:

  • Whenever a element with "html-click" class is clicked, the value of attribute data-html-class is added a class name to the element whose class name or ID is mentioned as value in the attribute data-html-target.
  • The click should work for dynamic elements also.
  • The click should work as toggle functionality.
  • Possible values for data-html-target are
    • .class name - adds the data-html-class value to all classes with the class name provided.
    • #ID - adds the data-html-class to the id.
  • if data-html-target is not added, then data-html-class value gets added to the clicked element itself.

Make "site-prod" folder

Currently, the "site" folder is for development. but there should also be "site-prod" folder which holds minimized js, css, html and svg code.

Remove svg inline stylings

For some svg icons, the designers add svg inline stylings. These styles are not necessary for svg sprite.

Read the folder names through gulp

Currently, user need to mention the folder name inside gulpfile.js. Instead of this, if gulp only reads the file name and uses in creating svg sprite, would be better.

Add two types of injecting SVG content

Usage of gulp-nunjucks-render is optional. In that case, injecting svg content using nunjucks is making the boilerplate nunjucks dependent.

So, also include javascript way of injecting the svg content.

Gulp task run issue on gulp 4 version when I use postcss

events.js:177
throw er; // Unhandled 'error' event
^

Error: ENOENT: no such file or directory, open 'c:\xampp\htdocs\site-name\dist\assets\images\pagenotfound.svg'
Emitted 'error' event at:
at ReadStream. (c:\xampp\htdocs\site-name\node_modules\jsdom\lib\jsdom\living\xhr-utils.js:181:16)
at ReadStream.emit (events.js:200:13)
at ReadStream.EventEmitter.emit (domain.js:471:20)
at c:\xampp\htdocs\site-name\node_modules\graceful-fs\graceful-fs.js:207:14
at c:\xampp\htdocs\site-name\node_modules\graceful-fs\graceful-fs.js:258:16
at FSReqCallback.oncomplete (fs.js:153:23) {
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path: 'c:\xampp\htdocs\site-name\dist\assets\images\pagenotfound.svg'
}

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.