5 This repository supports contribution using [gitpod](https://gitpod.io) which is online IDE using [Theia](https://github.com/eclipse-theia/theia).
7 To open-up the environment simple natigate on https://gitpod.io/#https://github.com/rstacruz/cheatsheets
10 [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/rstacruz/cheatsheets)
12 ### Preview built website
14 To preview the website you need to first build it then you can navigate to file that you are trying to contribute and preview directly.
16 <img src='_docs/images/gitpod_preview_tut.png' width=828 height=459/>
18 ## Starting a local instance
20 This starts Jekyll and Parcel. This requires recent versions of [Node.js], [Yarn], [Ruby] and [Bundler] installed.
25 env PORT=4001 yarn run dev
28 [node.js]: https://nodejs.org/en/download/package-manager/
29 [ruby]: https://www.ruby-lang.org/en/documentation/installation/
30 [yarn]: https://yarnpkg.com/en/docs/install
31 [bundler]: https://bundler.io/
35 You can also run a local instance using Docker. This is the preferred method, especially for Windows.
36 You only need to install Docker ([macOS](https://docs.docker.com/docker-for-mac/install/), [Windows](https://docs.docker.com/docker-for-windows/install/), [Ubuntu](https://docs.docker.com/install/linux/docker-ce/ubuntu/), [Arch Linux](https://www.archlinux.org/packages/community/x86_64/docker/), [other](https://www.docker.com/community-edition#download)).
41 # Build images (takes ~12mins)
45 docker-compose run --rm web bundle install && docker-compose run --rm web yarn install
56 See <https://devhints.io/cheatsheet-styles> for a reference on styling.
60 When updating JavaScript, be sure Parcel is running (`yarn dev` takes care of this).
62 This auto-updates `/assets/packed/` and `_includes/2017/critical/` with sources in `_parcel/`.
64 Before committing, run `yarn parcel:build` first.
68 There are also automated tests:
76 Each sheet supports these metadata:
81 layout: 2017/sheet # 'default' | '2017/sheet'
86 ads: false # Add this to disable ads
87 weight: -5 # lower number = higher in related posts list
88 deprecated: true # Don't show in related posts
89 deprecated_by: /enzyme # Point to latest version
90 prism_languages: [vim] # Extra syntax highlighting
92 This is some *Markdown* at the beginning of the article.
98 # (don't set these for cheatsheets)
99 type: home # home | article | error
100 og_type: website # opengraph type
107 For supported prism languages:
109 - <https://github.com/PrismJS/prism/tree/gh-pages/components>
111 ## Setting up redirects
113 This example sets up a redirect from `es2015` to `es6`:
127 See `_data/content.yml` for chrome strings.
131 So you want to fork this repo? Sure, here's what you need to know to whitelabel this:
133 - It's all GitHub pages, so the branch has to be `gh-pages`.
134 - All other GitHub pages gotchas apply (CNAME, etc).
135 - Edit everything in `_data/` - this holds all 'config' for the site: ad IDs, strings, etc.
136 - Edit `_config.yml` as well, lots of things may not apply to you.
138 ## CloudFlare purging
140 The site devhints.io is backed by CloudFlare. Updates will take 2 days to propagate to the website by default. To make sure recent changes will propagate, use this helper script. It will give instructions on how manual selective cache purging can be done.
143 ./_support/cf-purge.sh
148 There are multiple ways to set meta description.
150 ### Keywords (and intro)
152 Set `keywords` (and optionally `intro`). This is the easiest and the preferred
156 React cheatsheet - devhints.io
157 ------------------------------
158 https://devhints.io/react ▼
159 React.Component · render() · componentDidMount() · props/state · React is a
160 JavaScript library for building web...
163 ### Description (and intro)
165 Set `description` (and optionally `intro`)
168 React cheatsheet - devhints.io
169 ------------------------------
170 https://devhints.io/react ▼
171 One-page reference to React and its API. React is a JavaScript library for
172 building web user interfaces...
177 If you left out `description` or `keywords`, a default description will be added.