Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a static site generated from the docs folder #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

koistya
Copy link

@koistya koistya commented Mar 21, 2016

Create a home page for this project that is generated from *.md files inside the /docs folder.

image

How to proceed with it:

  1. Create an orphan gh-pages branch
  2. npm install -g easystatic - installs Easystatic site generator, optimized for GH Pages sites
  3. npm run docs - generates a static site from *.md files in the docs folder and launches it in a browser with "live reload" enabled (via Browsersync)
  4. Customize the layout by editing docs/assets/*.*. The current layout is based on MDL.
  5. Set your Google Analytics ID in docs/assets/main.ejs (layout file)
  6. Register cash.js.org domain for your repo by sending a PR here
  7. npm run docs:deploy - pushes the generated static site to gh-pages branch

P.S.: I created this utility for my own OSS projects and though it might be helpful for you as well.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 97.864% when pulling 9d02d0c on koistya:docs into 8a93cc3 on dthree:master.

@dthree
Copy link
Owner

dthree commented Mar 22, 2016

Hey, looks cool. Thanks.

What's the drill when the docs go out of date?

To clarify, suppose I update the layout and CSS, however later want to regenerate the docs part of the site, is there a way to just update the markdown and not the layout?

@koistya
Copy link
Author

koistya commented Mar 22, 2016

To clarify how it works.. The docs folder contains the "source files" of your static website, from which the actual HTML/CSS content is generated into the temp docs/dist folder either when you run npm run docs:build or npm run docs:deploy. The contents of this folder will be --force pushed to gh-pages branch when you run npm run docs:deploy. Whatever you have on gh-pages branch will be available at http:https://cash.js.org

So.. whenever you edit something inside the docs folder and want to update the http:https://cash.js.org site, you should either run npm run docs:deploy manually, or append this command to .travis.yml if you want the site to be deployed (published) automatically for you, along with GITHUB_TOKEN env variable encrypted with Travis CLI utility.

Easystatic converts all the docs/**/*.md files into .html ones with the same names, e.g. docs/getting-started.md becomes docs/dist/getting-started.html etc. When you add a new .md file into the docs folder, it won't be automatically included into the menu/navigation. For that, you would need to edit the layout by hand (see docs/assets/header.ejs containing navigation links).

This layout is based on Material Design Lite (MDL), which is a great CSS framework developed by Google engineers with lots of stars/downloads and extensive documentation. Let me know if you need more help with the site.

@koistya
Copy link
Author

koistya commented Mar 23, 2016

Just have added GitHub stats into the header. See the screenshot above.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 97.837% when pulling 4a1cd4a on koistya:docs into 8c96411 on dthree:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 97.837% when pulling d6ac53f on koistya:docs into 8c96411 on dthree:master.

@nfischer
Copy link
Collaborator

Nice! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants