All Projects → luangjokaj → Gopablo

luangjokaj / Gopablo

Licence: mit
🐺 Static site generator.

Programming Languages

javascript
184084 projects - #8 most used programming language
es6
455 projects

Projects that are alternatives of or similar to Gopablo

Frontie Webpack
Front-end Boilerplate | Gulp 4 + Webpack 4 + Babel + ITCSS Architecture + BEM Methodology + Twig.js
Stars: ✭ 102 (-38.55%)
Mutual labels:  gulp, babel, workflow, browsersync
Gulp Webpack Starter
Gulp Webpack Starter - fast static website builder. The starter uses gulp toolkit and webpack bundler. Download to get an awesome development experience!
Stars: ✭ 199 (+19.88%)
Mutual labels:  gulp, static-site-generator, browsersync
Hugo theme pickles
Modern, Simple and beautiful Hugo theme
Stars: ✭ 168 (+1.2%)
Mutual labels:  gulp, babel, static-site-generator
genesis-sample-task-runner
Gulp workflow for Auto prefixing, Sass compiling, CSS minification, automatic browser reloading and more
Stars: ✭ 23 (-86.14%)
Mutual labels:  gulp, workflow, browsersync
Vanilla Back To Top
Simple and smooth Back To Top button
Stars: ✭ 179 (+7.83%)
Mutual labels:  babel, static-site-generator, postcss
bowman
A simple static site generator with an integrated toolchain for efficient development and delivery.
Stars: ✭ 17 (-89.76%)
Mutual labels:  static-site-generator, postcss, browsersync
Webpack-Starter-Kit
Webpack 4 stater kit with SCSS, PostCSS, Babel & ESLint
Stars: ✭ 41 (-75.3%)
Mutual labels:  babel, postcss, browsersync
Gulp Tutorial
Code examples for my Gulp.js tutorial series
Stars: ✭ 383 (+130.72%)
Mutual labels:  gulp, postcss, browsersync
Fastshell
Fiercely quick front-end boilerplate and workflows, HTML5, Gulp, Sass
Stars: ✭ 563 (+239.16%)
Mutual labels:  gulp, workflow, browsersync
Wordpress Starter
📦 A starter template for WordPress websites
Stars: ✭ 26 (-84.34%)
Mutual labels:  gulp, babel, browsersync
Generator Phaser Plus
[🛑 DISCONTINUED] It has been a long journey but development of `generator-phaser-plus` is now over. I recommend you have a look and fork `yandeu/phaser-project-template` instead.
Stars: ✭ 148 (-10.84%)
Mutual labels:  gulp, babel, browsersync
Wordpressify
🎈 A build system designed to automate your WordPress development workflow.
Stars: ✭ 1,374 (+727.71%)
Mutual labels:  gulp, workflow, postcss
Fuzzymail
📨 Email template generator. Making emails fun again.
Stars: ✭ 114 (-31.33%)
Mutual labels:  gulp, workflow, postcss
Barebones
A barebones boilerplate for getting started on a bespoke front end.
Stars: ✭ 127 (-23.49%)
Mutual labels:  babel, postcss
Fast
Develop, build, deploy, redeploy, and teardown frontend projects fast.
Stars: ✭ 126 (-24.1%)
Mutual labels:  babel, postcss
Web Starter Kit
Web Starter Kit is an opinionated boilerplate for web development. A solid starting point for both professionals and newcomers to the industry.
Stars: ✭ 130 (-21.69%)
Mutual labels:  gulp, browsersync
Gulp Starter Kit
A simple Gulp 4 Starter Kit for modern web development.
Stars: ✭ 134 (-19.28%)
Mutual labels:  gulp, babel
Frasco
Quick starter for Jekyll including full setup for Sass, PostCSS, Autoprefixer, stylelint, Webpack, ESLint, imagemin, Browsersync, etc.
Stars: ✭ 123 (-25.9%)
Mutual labels:  postcss, browsersync
Nightwatch Custom Commands Assertions
Nightwatch.js custom commands and assertions
Stars: ✭ 131 (-21.08%)
Mutual labels:  gulp, babel
Glup
Some of the gulp tutorial -《gulp笔记》
Stars: ✭ 136 (-18.07%)
Mutual labels:  gulp, babel

GoPablo

Version Dependencies

GoPablo a static site generator.

TL;DR

Initialize GoPablo

npx gopablo

Run development mode

Build and open your browser to http://localhost:3000.

npm run dev

Build distribution files for production

npm run prod

Ready to deploy 🚀


Introduction

Information Discord Donate
GoPablo is a static site generator with a modern development workflow, integrated web server, auto-reload, CSS preprocessors, and ES6 ready. Discord server BuyMeACoffee

Features

👇 Includes
📦 Live Server
🔥 Hot Reload & CSS Injection
Babel 7
🤖 Express Server
🎒 Code Minification
🌈 Image Compression
🕸 Templating & Partial HTML Injection
🎨 PostCSS & Next Generation CSS
🍒 Cherry Design System
✂️ Cache-Busting
🛎 Distribution Files

1. Installing Node.js

GoPablo requires Node.js v12+. This is the only global dependency. You can download Node.js here.

Node.js is a JavaScript runtime built on Chrome’s V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js’ package ecosystem, npm, is the largest ecosystem of open source libraries in the world.

2. Set Up Project

File Structure

    ├── build/                   # Build files
    ├── dist/                    # Distribution files
    ├── src/                     # Source files
    │   ├── assets/              # Assets directory
    │       ├── css/             # CSS files
    │       ├── fonts/           # Fonts directory
    │       ├── img/             # Image directory
    │       ├── js/              # JavaScript files
    │   ├── etc/                 # Extra files
    │   ├── includes/            # HTML template partials
    │   ├── index.html           # Index page
    └── .babelrc                 # Babel configuration
    └── .gitignore               # Git ignored files
	└── .editorconfig            # Editor code styles
    └── .stylelintrc             # Stylelint configuration
    └── gulpfile.js              # Gulp configuration
    └── LICENSE                  # License agreements
    └── package-lock.json        # Packages lock file
    └── package.json             # Node.js packages
    └── README.md                # You are reading this
    └── server.js                # Express server

Install GoPablo from NPM

To install GoPablo create a directory for the new website and from there run the command to generate the file structure:

npx gopablo

That's it 🍾 easy as that. Now start the development workflow: Start Workflow

Install GoPablo from Repository

To install GoPablo you need to clone the repository from GitHub:

git clone https://github.com/luangjokaj/gopablo
  • This will clone the repository on your local machine. Navigate to the newly created directory.

  • Replace the file: ./package.json with ./installer/package.json and continue with the dependency installation.

INSTALL DEPENDENCIES

npm install

Start Workflow

  • To start the development server run the command:
npm run dev
  • You are ready to go! Happy coding! 🤓

Generate production files

To generate your distribution files run the command:

npm run prod

The files will be generated in the dist/ directory.

Templating and HTML Partials

To avoid repetitive HTML code, GoPablo uses gulp-file-include. It has a simple templating synthax and allows to re-use chunks of code written in separate files. These partials are located in the directory:

src/includes/

For more information check out their documentation and examples: https://github.com/haoxins/gulp-file-include

New pages

To create new pages, simply create new .html files in the src/ directory.

3. CSS, PostCSS and Sass

PostCSS

By default GoPablo supports PostCSS, a similar preprocessor to Sass, Less and others but with more functionality. On top of that PostCSS is 3x faster than Sass and 4x faster than Less. Features come in the shape of PostCSS plugins. Think of these like using Lego, where each piece is a different feature that can transform your CSS in some way. PostCSS lets you stick these pieces together so that you can build up your own feature set, adding and removing plugins as and when you need them. postcss-preset-env is installed by default. Read more about PostCSS here.

POSTCSS PLUGINS

GoPablo has two different sets of PostCSS plugins - one for the development environment (pluginsListDev) and one for the production task (pluginsListProd).

//--------------------------------------------------------------------------------------------------
/* -------------------------------------------------------------------------------------------------
PostCSS Plugins
 ------------------------------------------------------------------------------------------------- */
const pluginsDev = [
	postcssImport,
	postCSSMixins,
	postcssPresetEnv({
		stage: 0,
		features: {
			'nesting-rules': true,
			'color-mod-function': true,
			'custom-media': true,
		},
	}),
];
const pluginsProd = [
	postcssImport,
	postCSSMixins,
	postcssPresetEnv({
		stage: 0,
		features: {
			'nesting-rules': true,
			'color-mod-function': true,
			'custom-media': true,
		},
	}),
	require('cssnano')({
		preset: [
			'default',
			{
				discardComments: true,
			},
		],
	}),
];
//--------------------------------------------------------------------------------------------------

WRITING CSS

The starting point for CSS is the file:

src/assets/css/styles.css

CHERRY DESIGN SYSTEM

Cherry is a minimal CSS framework that helps you organize your work from design to implementation.

Sass

GoPablo is super flexible. You can install Sass and use it as the main CSS preprocessor:

npm install gulp-sass --save-dev

Include Sass in gulpfile.js:

const sass = require('gulp-sass');

Change the gulp tasks stylesDev to:

function stylesDev() {
	return src('./src/assets/css/styles.scss')
		.pipe(sourcemaps.init())
		.pipe(sass({includePaths: 'node_modules'}).on('error', sass.logError))
		.pipe(sourcemaps.write('.'))
		.pipe(dest('./build/assets/css'))
		.pipe(browserSync.stream({ match: '**/*.css' }));
}

Also the watch task has to be changed in order to watch for .scss filetypes:

watch('./src/assets/css/**/*.scss', stylesDev);

Change the gulp tasks styleProd to:

function stylesProd() {
	return src('./src/assets/css/styles.scss')
		.pipe(sass({includePaths: 'node_modules'}).on('error', sass.logError))
		.pipe(dest('./dist/assets/css'))
}

4. Images and Fonts

Images

It is recommended to store image assets in the directory:

src/assets/img/

In the production build SVGs and other image assets will go through a minification process.

Fonts

Fonts are always special. Your fonts should be stored in:

src/assets/fonts/

Then you can include them in your CSS:

@font-face {
	font-family: 'Helvetica Neue Thin';
	src: url('./fonts/Helvetica-Neue-Thin.eot');
	src: url('./fonts/Helvetica-Neue-Thin.eot') format('eot'),
	url('./fonts/Helvetica-Neue-Thin.woff2') format('woff2'),
	url('./fonts/Helvetica-Neue-Thin.woff') format('woff'),
	url('./fonts/Helvetica-Neue-Thin.ttf') format('truetype'),
	url('./fonts/Helvetica-Neue-Thin.svg') format('svg');
}

5. JavaScript ES6

GoPablo supports ES6 JavaScript with Babel. Babel has support for the latest version of JavaScript through syntax transformers. These plugins allow you to use new syntax, right now without waiting for browser support.

Write ES6 JavaScript

Your JavaScript code should be located in:

src/assets/js/

GoPablo will watch for changes under the js directory and bundle the code in a single file, which will be included in the footer of the page as:

footer-bundle.js

Check the gulp configuration to learn more about how JavaScript is generated.

6. External Libraries

Including external JavaScript libraries is as simple as installing the npm script and including it in the gulpfile.js

/* -------------------------------------------------------------------------------------------------
Header & Footer JavaScript Boundles
-------------------------------------------------------------------------------------------------- */
const headerJS = [
	'./node_modules/jquery/dist/jquery.js',
	'./node_modules/nprogress/nprogress.js',
	'./node_modules/aos/dist/aos.js',
	'./node_modules/isotope-layout/dist/isotope.pkgd.js'
];
const footerJS = [
	'./src/assets/js/**'
];
//--------------------------------------------------------------------------------------------------

You can include the scripts in the head of the page before the DOM is loaded by placing them in the headerJS array or in the footer of the page after the DOM is loaded in the footerJS array. Only footer scripts are processed with Babel thus supporting ES6, however you can change this in the configuration if you want to run both header and footer scripts with Babel.

A build restart is required for changes to take effect.

7. Code Style Rules

GoPablo comes with its own set of code style rules:

.stylelintrc

Lint CSS

Before pushing changes make sure you have clean and consistent CSS. Run stylelint with the command:

npm run lint

8. Deploy

There are a lot of possiblities and different ways to deploy your static website. The most traditional one being: generating your distribution files and uploading them manually, usually FTP.

Heroku

With the help of a simple Express server, with GoPablo we can deploy to heroku out of the box.

  1. Create Heroku application: heroku create.
  2. Push the branch to Heroku origins: git push heroku master

Automated Netlify deployments

Netlify is a great service that can be used to deploy generated websites. All you have to do is:

  1. Connect your GitHub repository.
  2. Choose Branch to deploy, usually: master.
  3. Set the Build command to: npm run prod.
  4. Set the Publish directory to: dist/.

We are live 🌍


9. Audit and Page Speed

audit page-speed

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].