Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Generate purely static website #874

Closed
gmarty opened this issue Nov 14, 2016 · 8 comments
Closed

Generate purely static website #874

gmarty opened this issue Nov 14, 2016 · 8 comments

Comments

@gmarty
Copy link

gmarty commented Nov 14, 2016

It doesn't seem to be possible to generate purely static websites (that is without JS, only plain HTML and assets).
At the very least that'd be nice to have an option not to get the bundled JavaScript in the HTML files.

MoOx added a commit that referenced this issue Nov 14, 2016
This allows you to turn Phenomic into a standard static website
generator

Closes #874
@MoOx
Copy link
Owner

MoOx commented Nov 14, 2016

Next release will have a "clientScripts" option (boolean, true by default) to control the output of the javascript inserted in html files.
By turning this off (clientScripts: false in package.json phenomic section or --no-client-scripts in package.json script section), you should turn Phenomic into a standard static website generator.

@gmarty
Copy link
Author

gmarty commented Nov 15, 2016

👍 That was fast!
I can't wait for the next version to be released.

@gmarty
Copy link
Author

gmarty commented Nov 15, 2016

As a followup, I think it makes sense to call ReactDOMServer.renderToStaticMarkup() instead of ReactDOMServer.renderToString() when in purely static mode as React additional attributes and tags are not used:

const render = ReactDOMserver[
!testing
? "renderToString"
: "renderToStaticMarkup"
]

@MoOx
Copy link
Owner

MoOx commented Nov 15, 2016

I already took care of that in 233b0ef ;)

@gmarty
Copy link
Author

gmarty commented Nov 15, 2016

Oh! As I said, fast! 👍 👍 ;-)

@DavidWells
Copy link
Contributor

@gmarty Just out of curiosity. What is the use case for purely static sites with no-js?

@dab
Copy link

dab commented Nov 18, 2016

@DavidWells you can use w3m to browse it 😆

@MoOx
Copy link
Owner

MoOx commented Nov 18, 2016

You can already do that. Removing the JS only remove the client side enhancement. Phenomic works without JS out of the box.

@MoOx MoOx closed this as completed in c569eb2 Nov 21, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants