diff --git a/_config.yml b/_config.yml
index 8b972f86e..5b0a6508b 100644
--- a/_config.yml
+++ b/_config.yml
@@ -1,3 +1,8 @@
+# gems
+gems:
+ - jekyll-redirect-from
+ - jekyll-github-metadata
+
# files
exclude:
- Makefile
@@ -24,6 +29,7 @@ defaults:
type: pages
values:
layout: "default"
+ type: article
category: "Others"
# Site info
@@ -55,3 +61,6 @@ category_names:
- Ruby libraries
- Vim
- Others
+
+# https://help.github.com/articles/repository-metadata-on-github-pages/
+repository: rstacruz/cheatsheets
diff --git a/_includes/2017/top-nav.html b/_includes/2017/top-nav.html
index 027287052..8cc799eb0 100644
--- a/_includes/2017/top-nav.html
+++ b/_includes/2017/top-nav.html
@@ -7,10 +7,10 @@
{% include social-list.html class="social page-actions" page=include.page %}
- {% if include.page.type == 'article' %}
+ {% if include.page.type != 'website' %}
-
-
+
Edit
diff --git a/_layouts/2017/home.html b/_layouts/2017/home.html
index 153baf89b..f69cb4308 100644
--- a/_layouts/2017/home.html
+++ b/_layouts/2017/home.html
@@ -15,10 +15,10 @@ type: website
Top cheatsheets
- {{ site.tags }}
-
- {% for page in site.tags.Featured %}
- {% include 2017/pages-list-item.html page=page %}
+ {% for page in site.pages %}
+ {% if page.tags contains 'Featured' %}
+ {% include 2017/pages-list-item.html page=page %}
+ {% endif %}
{% endfor %}
{% for category in site.category_names %}
@@ -28,9 +28,7 @@ type: website
{% for page in site.pages %}
{% if page.category == category %}
- {% if page.type == article %}
- {% include 2017/pages-list-item.html page=page %}
- {% endif %}
+ {% include 2017/pages-list-item.html page=page %}
{% endif %}
{% endfor %}
{% endfor %}
diff --git a/css-antialias.md b/css-antialias.md
index 1ce39f45b..34c9464fb 100644
--- a/css-antialias.md
+++ b/css-antialias.md
@@ -2,6 +2,7 @@
title: CSS antialiasing
category: CSS
layout: 2017/sheet
+tags: [Featured]
---
### Antialias
diff --git a/jekyll-github.md b/jekyll-github.md
new file mode 100644
index 000000000..ae8e8589d
--- /dev/null
+++ b/jekyll-github.md
@@ -0,0 +1,145 @@
+---
+title: Jekyll for GitHub pages
+jekyll_escape: true
+layout: 2017/sheet
+tags: [WIP]
+---
+
+{% raw %}
+
+Jekyll
+------
+{: .-three-column}
+
+### Jekyll gems
+
+* jekyll-avatar
+* jekyll-coffeescript
+* jekyll-default-layout
+* jekyll-feed
+* jekyll-gist
+* jekyll-github-metadata
+* jekyll-mentions
+* jekyll-optional-front-matter
+* jekyll-paginate
+* jekyll-readme-index
+* jekyll-redirect-from
+* jekyll-relative-links
+* jekyll-sass-converter
+* jekyll-seo-tag
+* jekyll-sitemap
+
+As of github-pages v156.
+
+jekyll-github-metadata
+----------------------
+
+### Configuration
+
+```yaml
+gems:
+ - jekyll-github-metadata
+
+repository: username/project
+```
+
+Put this in your `_config.yml`.
+See: [Repository metadata on GitHub pages](https://help.github.com/articles/repository-metadata-on-github-pages/)
+
+### Listing erpos
+
+```html
+{% for repository in site.github.public_repositories %}
+
+ {{ repository.name }}
+
+{% endfor %}
+```
+
+### Link to repo
+
+```html
+
+ {{ site.github.project_title }}
+
+```
+
+jekyll-gist
+-----------
+
+### Configuration
+
+```yaml
+gems:
+ - jekyll-gist
+```
+
+See: [jekyll-gist](https://github.com/jekyll/jekyll-gist)
+
+### Usage
+
+```js
+{% gist parkr/c08ee0f2726fd0e3909d %}
+```
+
+This places a Gist in your page.
+
+jekyll-mentions
+---------------
+
+### Configuration
+
+```yaml
+gems:
+ - jekyll-mentions
+```
+
+See: [jekyll-mentions](https://github.com/jekyll/jekyll-mentions)
+
+### Usage
+
+```js
+Hey @rstacruz, what do you think of this?
+```
+
+Just mention anyone in any page. Their names will be turned into links.
+
+
+jekyll-redirect-from
+--------------------
+{: .-three-column}
+
+### Configuration
+
+```yaml
+gems:
+ - jekyll-redirect-from
+```
+
+See: [jekyll-redirect-from](https://rubygems.org/gems/jekyll-redirect-from)
+
+### Usage
+
+```yaml
+---
+redirect_from:
+ - /foo
+---
+```
+
+Place on any page.
+
+### Redirecting
+
+```yaml
+---
+redirect_to:
+ - /foo
+---
+```
+
+Place on any page.
+See: [redirect to](https://github.com/jekyll/jekyll-redirect-from#redirect-to)
+
+{% endraw %}
+
diff --git a/jekyll.md b/jekyll.md
index 8a37afaf8..4c1ab61b7 100644
--- a/jekyll.md
+++ b/jekyll.md
@@ -133,12 +133,33 @@ Markup
{{ page.date | date: "%b %d, %Y" }}
-### If
+### Conditionals
- {% if page.image.feature %}
- {% else if xyz %}
- {% else %}
- {% endif %}
+```html
+{% if page.image.feature %}
+{% else if xyz %}
+{% else %}
+{% endif %}
+```
+
+```html
+{% if page.category == 'React' %}
+{% if page.category == 'React' or page.featured %}
+{% if page.tags contains 'Featured' %}
+```
+
+### Case
+
+```html
+{% case shipping.title %}
+ {% when 'international' %}
+ Arriving in 2-3 weeks
+ {% when 'Domestic' %}
+ Arriving in 2-3 days
+ {% else %}
+ Thank you for your order!
+{% endcase %}
+```
### Includes (partials)
diff --git a/package.md b/package.json.md
similarity index 86%
rename from package.md
rename to package.json.md
index 2d424d574..8f4f3810a 100644
--- a/package.md
+++ b/package.json.md
@@ -1,6 +1,10 @@
---
title: package.json
category: Node.js
+layout: 2017/sheet
+redirect_from:
+- /package.html
+- /package
---
### Basic
@@ -11,7 +15,9 @@ category: Node.js
"keywords": [""],
"author": "Rico Sta. Cruz ",
"version": "0.1.0",
- "engines": {"node": ">=0.8.0"},
+ "engines": {
+ "node": ">=0.8.0"
+ },
"main": "index",
"bin": {
"command": "./bin/command"
@@ -64,7 +70,9 @@ category: Node.js
}
```
-### References
-
- * http://package.json.nodejitsu.com/
+## References
+{: .-one-column}
+
+ *
* `npm help package.json`
+{: .-also-see}
diff --git a/xpath.md b/xpath.md
index 315c7effe..fe9711d18 100644
--- a/xpath.md
+++ b/xpath.md
@@ -2,6 +2,7 @@
title: Xpath
category: HTML
layout: default-ad
+tags: [Featured]
---
### Descendant selectors