p5.js-website
p5.js-website copied to clipboard
Examples are not being generated with 'watch' script
Most appropriate sections of the p5.js website?
Examples
What is your operating system?
Windows
Web browser and version
103.0.5060.114 (Official Build) (64-bit) (cohort: Stable)
Actual Behavior
When following the 'setup' and 'running' instructions in the readme, the npm run watch script generates examples/index.html, but none of the individual examples. All example pages, such as http://localhost:9000/examples/3d-basic-shader.html, return Cannot GET /examples/3d-basic-shader.html. All other pages, including reference pages, appear to be generated properly.
This might be some confusion or misconfiguration on my end, and if appropriate I'd like to update the readme to help others who run into the same issue.
Expected Behavior
I expect the individual example pages to be generated when either the npm run watch or npm run assemble commands are run.
Steps to reproduce
I forked p5.js-website, confirmed that Java is installed, ran npm install then npm run watch. Then, I navigated to http://localhost:9000/examples/, which displays properly, after which all individual examples return the same error.
Would you like to work on the issue?
If appropriate I'd be happy to update the readme with more info
Yes, I am also getting the same error.
I'm not able to replicate this. Can you check that in the generated dist/examples/ folder there are generated example html files? If not does running npm run build generates them?
@limzykenneth, there is only a single html file in dist/examples/ even after running the npm run build
@adarrssh Are you on the latest commit with no changes in the local repo? There is no other steps to build the examples than npm run build so if you cannot build with it, it's more than just the watch script problem.
Yes, I am not the latest commit with no changes in the local repo.
Is this Git changing line endings on Windows again?
https://github.com/processing/p5.js-website/issues/430#issuecomment-474461235
@takyano thanks for bringing this up, it appears that this was the problem! After running git config core.autocrlf false and doing a full refresh of my fork, it appears that the pages are being assembled properly.
Would there be any value in including a .gitattributes file to disable autocrlf for the repository?
Would there be any value in including a .gitattributes file to disable autocrlf for the repository?
I think that would help. You can file a PR for this if you like.
Now it's working, thanks @takyano.