Git Product home page Git Product logo

citygate's Introduction

citygate animation

Build-Workflow

Überblick

Der komplette Sourcecode liegt in /src und wird während des Build-Prozesses nach /build kompiliert. Darin liegen die index.html sowie die sub.html (mit alternativen Elementen). Der build-Ordner bildet also das auslieferbare HTML/CSS/JS-Paket.

Wichtig: Das Paket muss direkt im Stammverzeichnis / liegen, da sonst die Pfade zu CSS, JS und den Bildern nicht stimmen.

Es werden im Development eine Reihe von Präprozessoren ausgeführt. Das erlaubt uns, folgende Abstraktionen einzusetzen:

Pug => HTML
SASS => CSS
ES6 => JavaScript
SVG => Optimized SVG-Sprite

System-Voraussetzungen

  • npm
  • node.js
  • git

Installing

Zunächst das Repository lokal clonen:

$ git clone https://github.com/ugrupp/citygate.git

Dann im Projektverzeichnis die benötigten Pakete installieren:

$ cd citygate
$ npm install

Development & Deployment

Der Workflow basiert auf gulp. Es gibt zwei Haupt-Tasks, die jeweils vom Projektverzeichnis aus ausgeführt werden können:

Default

$ gulp

Ausgeführte Tasks:

  • HTML (Pug)
  • JS (Linting, Browserify, Babel, Minification, Sourcemaps)
  • CSS (Linting, SASS, Autoprefixer, Minification)
  • Assets (SVG Optimization & Sprite, kopieren sonstiger Bilder)
  • Watch
  • Browsersync

Production

$ gulp production

Ausgeführte Tasks:

  • HTML (s.o.)
  • CSS (s.o.)
  • JS (s.o.)
  • Assets (s.o.)

SVG

Wir nutzen hier einen SVG Workflow, der alle SVGs in einen externen SVG-Sprite zusammenführt. Dabei werden die SVGs zudem noch optimiert. Es ist zu beachten, dass die SVGs keine wichtigen Anweisungen in <defs>-Tags beinhalten dürfen, da diese bei der eingesetzten SVG-Sprite-Methode nicht berücksichtigt werden.

Browsersync

Browsersync läuft als Proxy vor der lokalen Dev-Domain, welche standardmäßig citygate.test lautet. Dies kann durch Setzen der Umgebungsvariable BROWSERSYNC_PROXY_DOMAIN in der .env-Datei geändert werden.

Beispiel .env-Datei:

BROWSERSYNC_PROXY_DOMAIN="citygate.local"

Author

Urs Grupp, https://www.21sieben.de/

citygate's People

Contributors

ugrupp avatar

Watchers

 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.