• Stars
    star
    411
  • Rank 105,247 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 6 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

⚡️ An opinionated, zero-config static site generator.


Charge

Charge

What?

Charge is an opinionated, zero-config static site generator written in JavaScript. It supports a wide variety of common uses and it does it without needing to be configured or customized. It’s fast, it’s simple, and it works the way you probably expect it to. That’s it.

Why?

Yeah, I know, another static site generator. Let me be clear, I really did not want to make a static site generator. It’s really the very last thing I wanted to do.

I went on StaticGen and looked at every JavaScript-based one. I could not find a single one that I thought was simple, well-documented, had the features I needed, was actively maintained, and was designed and worked the way I wanted. So here I am, making a static site generator.

Highlights

  • Zero configuration
  • Templating via JSX and MDX
  • React renders server-side, not client-side
  • Write futuristic JavaScript with Babel
  • Write futuristic CSS with PostCSS
  • Live-reloading development server
  • Rebuilds the minimum files necessary
  • Dynamic pages (coming soon)
  • Stellar documentation ✨

Documentation

You can find the Charge documentation on the website.

How is Charge different from GatsbyJS?

Gatsby is really cool, but it’s very different than Charge, with two particularly large differences.

Gatsby is configuration over convention. It can be used to build complex web applications, but because of that it can be very difficult to understand how to use it. You’ll need to know how to use Webpack, which personally gives me nightmares. It’s likely that you’ll need to spend time learning other tools and then configuring and tweaking Gatsby before you can use it for your site. Charge is convention over configuration. In fact, it has no configuration, it “just works”.

Gatsby renders pages client-side. That means it serves React and some related libraries to the browser along with your components in order to render the pages. Routing also happens client-side. Gatsby can render the initial page load server-side, but there’s no way to not serve hundreds of kilobytes of JavaScript to the browser. Charge uses React to render everything server-side. It generates a truly static site.

More practically, Gatsby is great if you’re building a large, complex website and want lots of control over how you build it. Charge is probably better if you’re building a small website and don’t want to waste time fiddling with configurations and cobbling different tools together.

Real examples

If you’d like to see everything in practice, check out these sites using Charge.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/brandonweiss/charge.

License

The package is available as open source under the terms of the MIT License.

More Repositories

1

discharge

⚡️ A simple, easy way to deploy static websites to Amazon S3.
JavaScript
534
star
2

pure.fish

A Pure-inspired prompt for fish shell.
Shell
68
star
3

promptconfig

🖥 Craft a custom terminal prompt with JSON.
JavaScript
35
star
4

railyard

🏗 Non-polluting Rails skeleton generator.
Ruby
25
star
5

hold_please

📞 Disable ActiveRecord callbacks in Rails for great justice!
Ruby
20
star
6

rack-minitest

Adds convenience methods for dealing with JSON to rack-test and MiniTest spec-style matchers for checking response statuses.
Ruby
15
star
7

brandonweiss

My personal website.
JavaScript
12
star
8

sonar-js

A tiny library for detecting when a browser is scrolled to the bottom of a web page.
JavaScript
10
star
9

dotfiles

My dotfiles, let me show you them!
Ruby
8
star
10

faraday-request-timer

Faraday request timing
Ruby
8
star
11

anti-pattern

My blog.
JavaScript
6
star
12

redcarpet-abbreviations

An extension for Redcarpet that supports abbreviations.
Ruby
5
star
13

git-hookshot

Share git hooks in Ruby projects among all the collaborators automatically, without them having to do anything.
Ruby
5
star
14

emojify

Converts emoji aliases into emoji.
Ruby
3
star
15

collector

An implementation of the Repository Pattern in Ruby for MongoDB.
Ruby
3
star
16

aversion

🔢 See what language versions each of your projects is using; upgrade to new versions and uninstall old versions.
TypeScript
2
star
17

wow-item-level-overlay

A World of Warcraft addon for displaying item levels over inventory slots in Character Info.
Lua
2
star
18

founderscard.safariextz

A Safari extension for FoundersCard.
JavaScript
1
star