This commit is contained in:
Rico Sta. Cruz 2017-08-29 00:37:00 +08:00
parent fffe9c38f9
commit 593ab680de
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
8 changed files with 201 additions and 18 deletions

View File

@ -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

View File

@ -7,10 +7,10 @@
<div class='actions'>
{% include social-list.html class="social page-actions" page=include.page %}
{% if include.page.type == 'article' %}
{% if include.page.type != 'website' %}
<ul class='page-actions'>
<li class='link github -button hint--bottom' data-hint='Edit this page on GitHub'>
<a href='https://github.com/rstacruz/cheatsheets/blob/gh-pages/{{ page.path | remove: '.html' }}'>
<a href='{{ site.github.repository_url }}/blob/gh-pages/{{ page.path | remove: '.html' }}'>
<span class='text -visible'>Edit</span>
</a>
</li>

View File

@ -15,10 +15,10 @@ type: website
<span>Top cheatsheets</span>
</h2>
{{ 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 %}

View File

@ -2,6 +2,7 @@
title: CSS antialiasing
category: CSS
layout: 2017/sheet
tags: [Featured]
---
### Antialias

145
jekyll-github.md Normal file
View File

@ -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 %}
<a href='{{ repository.html_url }}'>
{{ repository.name }}
</a>
{% endfor %}
```
### Link to repo
```html
<a href='{{ site.github.repository_url }}'>
{{ site.github.project_title }}
</a>
```
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 %}

View File

@ -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)

View File

@ -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 <hi@ricostacruz.com>",
"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}
* <http://package.json.nodejitsu.com/>
* `npm help package.json`
{: .-also-see}

View File

@ -2,6 +2,7 @@
title: Xpath
category: HTML
layout: default-ad
tags: [Featured]
---
### Descendant selectors