The React Static Site Generator is designed to help create impressive websites impressively fast.
Right now, RSSG depends on bulma-styled-components
, a package created by Altamir's own mpaupulaire4. In the future, RSSG should be plug-and-play, allowing to pass in custom UI libraries and create amazing sites.
-
Navigate into any React.js project and run
npm install @altamir/react-static-site-generator
oryarn add @altamir/react-static-site-generator
. -
Import the module where it will be used.
import React from 'react'
import siteGenerator from '@altamir/react-static-site-generator'
- Generate static components
import ReactDOM from 'react-dom';
import siteGenerator from '@altamir/react-static-site-generator'
import * as Bulma from 'bulma-styled-components'
ReactDOM.render(siteGenerator({
pages: {
main: {
title: 'Home Page',
components: [{
type: Bulma.Notification,
content: 'hello'
}]
},
about: {
title: 'About Me',
content: ''
}
}
}, {
componentLibraries: [Bulma],
themeProvider: Bulma.BulmaStyledTheme
}), document.getElementById('root'));
Usage right now is very simplistic. Basically, RSSG is just accepting a JSON markup of a website, and then traversing that and spitting out a React SPA.
Here is an example of a site object that RSSG can take in:
siteGenerator({
pages: {
main: {
title: 'Home Page',
components: [{
type: Bulma.Notification,
content: 'hello'
}]
},
about: {
title: 'About Me',
content: ''
}
}
}, {
componentLibraries: [Bulma],
themeProvider: Bulma.BulmaStyledTheme
})
Please Contribute! Please remember to comment your code. This project deals largely in generics, so comments are enormously helpful in understanding what is going on.