hydrogen-cli
Voted the world's lightest static-site generator built with TypeScript ❤ It uses 🔥 lit-html inspired templating for super duper performant template generation
Last updated 3 months ago by shailen .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install hydrogen-cli 
SYNC missed versions from official npm registry.

???? Hydrogen

Voted the world's lightest static-site generator built with TypeScript ❤ It uses ???? lit-html inspired templating for super duper performant template generation.

BTW Hydrogen is much faster than @11ty/eleventy ????

Netlify Status Version codecov Downloads/week License

Features

  • Millisecond Builds. With the global average attention span being 8 seconds, why wait seconds for your builds when you can wait milliseconds. Read the SLA.
  • ???? JavaScript Templates. With ES6 template literals, who needs template engines like pug and handlebars. You now have access to the full-power of a JavaScript.
  • ???? Use External APIs. Plug into your data with remote APIs.
  • ???? Powerful Metadata API. Get the best SEO for your static pages.

Quick start

Add Hydrogen CLI to your project

$ yarn add hydrogen-cli

Create a simple index.js file with below code

const page = ({ title, data, head }) => `
  <!DOCTYPE html>
  <html>
    <head>
      <title>${title}</title>
      ${head}
    </head>
    <body>
      <h2>${data.project}</h2>
      <p>${data.description}</p>
    <body>
  </html>
`;

module.exports = {
  page,
  title: 'Welcome to Hydrogen',
  data: () => ({
    project: 'Hydrogen',
    description: 'Super fast static-site generator'
  }),
  head: ({ data }) => [
    ['meta', { name: 'description', content: data.description }]
  ]
}

Run the below command to generate your template to HTML

$ npx hydrogen generate index.js

The below HTML is outputted to an HTML file with the same name as the source index.html

  <!DOCTYPE html>
  <html>
    <head>
      <title>Welcome to Hydrogen</title>
      <meta name="description" content="Super fast static-site generator" />
    </head>
    <body>
      <h2>Hydrogen</h2>
      <p>Super fast static-site generator</p>
    <body>
  </html>

If you want to see a more advanced setup using Hydrogen, checkout ⚙ Advanced Setup

Development

Pull requests are more than welcome :)

  1. Install Docker
  2. Clone repo
  3. All commands are in the package.json file

Run the below commands:

$ yarn docker:setup # Builds Docker image and create Docker container

$ yarn docker:start # Starts Docker image

$ yarn docker:cli:dev # Runs CLI in dev mode

This will run your changes to the Hydrogen CLI over the Hydrogen documentation

Note: There are pre-commit and pre-push hooks that run tests

Roadmap

V1

  • [ ] Debugging - How to debug a Hydrogen build process
  • [ ] Project rewrite - To improve modularity
  • [ ] Improve documention

Current Tags

  • 0.7.0                                ...           0.7-beta.0 (8 months ago)
  • 1.0.1-beta.0                                ...           beta (17 days ago)
  • 1.0.0                                ...           latest (3 months ago)
  • 0.6.3-beta.0                                ...           next (9 months ago)

74 Versions

  • 1.0.1-beta.0                                ...           17 days ago
  • 1.0.0                                ...           3 months ago
  • 1.0.0-beta.1                                ...           3 months ago
  • 0.9.1-beta.1                                ...           3 months ago
  • 0.9.1-beta.0                                ...           3 months ago
  • 0.9.0                                ...           3 months ago
  • 0.9.0-beta.0                                ...           3 months ago
  • 0.8.0                                ...           5 months ago
  • 0.8.0-beta.0                                ...           6 months ago
  • 0.7.2                                ...           7 months ago
  • 0.7.2-beta.0                                ...           7 months ago
  • 0.7.1                                ...           7 months ago
  • 0.7.0-beta.2                                ...           7 months ago
  • 0.7.0-beta.1                                ...           8 months ago
  • 0.7.0-beta.0                                ...           8 months ago
  • 0.7.0                                ...           8 months ago
  • 0.6.4                                ...           8 months ago
  • 0.6.3                                ...           9 months ago
  • 0.6.3-beta.0                                ...           9 months ago
  • 0.6.2                                ...           10 months ago
  • 0.6.2-beta.0                                ...           10 months ago
  • 0.6.1                                ...           10 months ago
  • 0.6.0                                ...           10 months ago
  • 0.6.0-beta.0                                ...           10 months ago
  • 0.5.12                                ...           10 months ago
  • 0.5.11                                ...           10 months ago
  • 0.5.10                                ...           10 months ago
  • 0.5.9                                ...           10 months ago
  • 0.5.8                                ...           10 months ago
  • 0.5.7                                ...           10 months ago
  • 0.5.6                                ...           10 months ago
  • 0.5.5                                ...           10 months ago
  • 0.5.4                                ...           10 months ago
  • 0.5.3                                ...           10 months ago
  • 0.5.2                                ...           10 months ago
  • 0.5.1                                ...           10 months ago
  • 0.5.0                                ...           10 months ago
  • 0.4.3                                ...           10 months ago
  • 0.4.2                                ...           10 months ago
  • 0.4.1                                ...           10 months ago
  • 0.4.0                                ...           10 months ago
  • 0.3.2                                ...           10 months ago
  • 0.3.1                                ...           10 months ago
  • 0.3.0                                ...           10 months ago
  • 0.2.4                                ...           10 months ago
  • 0.2.3                                ...           10 months ago
  • 0.2.2                                ...           10 months ago
  • 0.2.1                                ...           10 months ago
  • 0.2.0                                ...           10 months ago
  • 0.1.5                                ...           10 months ago
  • 0.1.4                                ...           10 months ago
  • 0.1.3                                ...           10 months ago
  • 0.1.2                                ...           10 months ago
  • 0.1.1                                ...           10 months ago
  • 0.1.0                                ...           10 months ago
  • 0.0.20                                ...           10 months ago
  • 0.0.19                                ...           10 months ago
  • 0.0.18                                ...           10 months ago
  • 0.0.17                                ...           10 months ago
  • 0.0.16                                ...           10 months ago
  • 0.0.15                                ...           10 months ago
  • 0.0.14                                ...           10 months ago
  • 0.0.13                                ...           10 months ago
  • 0.0.12                                ...           10 months ago
  • 0.0.11                                ...           10 months ago
  • 0.0.10                                ...           10 months ago
  • 0.0.9                                ...           10 months ago
  • 0.0.8                                ...           10 months ago
  • 0.0.7                                ...           10 months ago
  • 0.0.6                                ...           10 months ago
  • 0.0.4                                ...           10 months ago
  • 0.0.3                                ...           10 months ago
  • 0.0.2                                ...           10 months ago
  • 0.0.1                                ...           10 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 138
Last Day 0
Last Week 0
Last Month 73
Dependencies (15)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |