Fix updated logic
This commit is contained in:
parent
7006f8c430
commit
9429f63ab6
|
@ -12,7 +12,7 @@
|
||||||
<script src='https://unpkg.com/prismjs@1.6.0/components/prism-bash.min.js'></script>
|
<script src='https://unpkg.com/prismjs@1.6.0/components/prism-bash.min.js'></script>
|
||||||
<script src='https://unpkg.com/prismjs@1.6.0/components/prism-scss.min.js'></script>
|
<script src='https://unpkg.com/prismjs@1.6.0/components/prism-scss.min.js'></script>
|
||||||
<script src='https://unpkg.com/prismjs@1.6.0/components/prism-elixir.min.js'></script>
|
<script src='https://unpkg.com/prismjs@1.6.0/components/prism-elixir.min.js'></script>
|
||||||
<script src='https://unpkg.com/prismjs@1.6.0/components/prism-elixir.min.js'></script>
|
<script src='https://unpkg.com/prismjs@1.6.0/components/prism-ruby.min.js'></script>
|
||||||
{% for lang in page.prism_languages %}
|
{% for lang in page.prism_languages %}
|
||||||
<script src='https://unpkg.com/prismjs@1.6.0/components/prism-{{lang}}.min.js'></script>
|
<script src='https://unpkg.com/prismjs@1.6.0/components/prism-{{lang}}.min.js'></script>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -6,7 +6,7 @@ type: website
|
||||||
%}
|
%}
|
||||||
{% assign recent_pages = site.pages
|
{% assign recent_pages = site.pages
|
||||||
| where_exp: "page", "page.updated"
|
| where_exp: "page", "page.updated"
|
||||||
| where_exp: "page", "page.updated >= site.last_updated"
|
| sort: "updated", "first"
|
||||||
%}
|
%}
|
||||||
{% include 2017/head.html %}
|
{% include 2017/head.html %}
|
||||||
{% include 2017/top-nav.html page=page %}
|
{% include 2017/top-nav.html page=page %}
|
||||||
|
@ -40,10 +40,12 @@ type: website
|
||||||
<span>Recently updated</span>
|
<span>Recently updated</span>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
{% for page in recent_pages %}
|
{% for page in recent_pages reversed %}
|
||||||
{% unless page.tags contains 'Featured' %}
|
{% if forloop.index < 12 %}
|
||||||
{% include 2017/pages-list-item.html page=page class='article item' %}
|
{% unless page.tags contains 'Featured' %}
|
||||||
{% endunless %}
|
{% include 2017/pages-list-item.html page=page class='article item' %}
|
||||||
|
{% endunless %}
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% for category in site.category_names %}
|
{% for category in site.category_names %}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
title: cssnext
|
title: cssnext
|
||||||
category: CSS
|
category: CSS
|
||||||
layout: 2017/sheet
|
layout: 2017/sheet
|
||||||
|
updated: 201708.30
|
||||||
weight: -3
|
weight: -3
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
309
jekyll.md
309
jekyll.md
|
@ -86,27 +86,42 @@ See: [github/pages-gem](https://github.com/github/pages-gem)
|
||||||
|
|
||||||
### Basic frontmatter
|
### Basic frontmatter
|
||||||
|
|
||||||
---
|
```
|
||||||
layout: post
|
---
|
||||||
title: Hello
|
layout: post
|
||||||
---
|
title: Hello
|
||||||
|
---
|
||||||
|
Hello! this is my post.
|
||||||
|
```
|
||||||
|
{: data-line="1,2,3,4"}
|
||||||
|
|
||||||
|
Attach metadata to a page by adding them on top of the page, delimited by `---`.
|
||||||
See: [Front-matter](http://jekyllrb.com/docs/frontmatter/)
|
See: [Front-matter](http://jekyllrb.com/docs/frontmatter/)
|
||||||
|
|
||||||
### Other frontmatter stuff
|
### Other frontmatter stuff
|
||||||
|
|
||||||
permalink: '/hello'
|
```yaml
|
||||||
published: false
|
permalink: '/hello'
|
||||||
category: apple
|
published: false
|
||||||
categories: ['html', 'css']
|
category: apple
|
||||||
tags: ['html', 'css']
|
categories: ['html', 'css']
|
||||||
|
tags: ['html', 'css']
|
||||||
|
```
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
|
||||||
source: .
|
In `_config.yml`:
|
||||||
destination: _site
|
{: .-setup}
|
||||||
exclude: [dir, file, ...]
|
|
||||||
include: ['.htaccess']
|
```yaml
|
||||||
|
# Optional
|
||||||
|
source: .
|
||||||
|
destination: _site
|
||||||
|
exclude:
|
||||||
|
- Gemfile
|
||||||
|
- Gemfile.lock
|
||||||
|
include: ['.htaccess']
|
||||||
|
```
|
||||||
|
|
||||||
See: [Configuration](http://jekyllrb.com/docs/configuration/)
|
See: [Configuration](http://jekyllrb.com/docs/configuration/)
|
||||||
|
|
||||||
|
@ -384,132 +399,6 @@ real_name: Anne Rice
|
||||||
|
|
||||||
See: [Collections](http://jekyllrb.com/docs/collections/)
|
See: [Collections](http://jekyllrb.com/docs/collections/)
|
||||||
|
|
||||||
Helpers and filters
|
|
||||||
-------------------
|
|
||||||
|
|
||||||
### Dates
|
|
||||||
|
|
||||||
```
|
|
||||||
{{ site.time | date_to_xmlschema }} #=> 2008-11-07T13:07:54-08:00
|
|
||||||
{{ site.time | date_to_rfc822 }} #=> Mon, 07 Nov 2008 13:07:54 -0800
|
|
||||||
{{ site.time | date_to_string }} #=> 07 Nov 2008
|
|
||||||
{{ site.time | date_to_long_string }} #=> 07 November 2008
|
|
||||||
{{ site.time | date: "%Y %m %d" }}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Preprocessors
|
|
||||||
|
|
||||||
```
|
|
||||||
| textilize
|
|
||||||
| markdownify
|
|
||||||
| jsonify
|
|
||||||
| sassify
|
|
||||||
| scssify
|
|
||||||
```
|
|
||||||
|
|
||||||
### Array filters
|
|
||||||
|
|
||||||
```
|
|
||||||
{{ site.pages | where: "year","2014" }}
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
| where: "year","2014"
|
|
||||||
| where_exp: "item", "item.year >= 2014"
|
|
||||||
| group_by: "genre" #=> { name, items }
|
|
||||||
| sort
|
|
||||||
| sort: 'author'
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
| first
|
|
||||||
| last
|
|
||||||
| join: ","
|
|
||||||
| array_to_sentence_string #=> "CSS, JS and HTML"
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
| map: "post" # works like 'pluck'
|
|
||||||
| size
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
{% assign list = list | push: 'd' %}
|
|
||||||
```
|
|
||||||
|
|
||||||
### String filters
|
|
||||||
|
|
||||||
```rb
|
|
||||||
| default: "xxx"
|
|
||||||
```
|
|
||||||
|
|
||||||
```rb
|
|
||||||
| upcase
|
|
||||||
| downcase
|
|
||||||
```
|
|
||||||
|
|
||||||
```rb
|
|
||||||
| remove: "<p>"
|
|
||||||
| replace: "super", "mega"
|
|
||||||
| remove_first: "<p>"
|
|
||||||
| replace_first: "super", "mega"
|
|
||||||
```
|
|
||||||
|
|
||||||
```rb
|
|
||||||
| truncate: 5
|
|
||||||
| truncatewords: 20
|
|
||||||
```
|
|
||||||
|
|
||||||
```rb
|
|
||||||
| prepend: "Mr. "
|
|
||||||
| append: " Sr."
|
|
||||||
```
|
|
||||||
|
|
||||||
```rb
|
|
||||||
| camelize
|
|
||||||
| capitalize
|
|
||||||
| pluralize
|
|
||||||
| strip_html
|
|
||||||
| strip_newlines
|
|
||||||
| newline_to_br
|
|
||||||
```
|
|
||||||
|
|
||||||
```rb
|
|
||||||
| split: ','
|
|
||||||
```
|
|
||||||
|
|
||||||
```rb
|
|
||||||
| escape
|
|
||||||
| escape_once
|
|
||||||
```
|
|
||||||
|
|
||||||
```rb
|
|
||||||
| slice: -3, 3
|
|
||||||
```
|
|
||||||
|
|
||||||
See: [String filters](http://docs.shopify.com/themes/liquid-documentation/filters)
|
|
||||||
|
|
||||||
### String filters (Jekyll-only)
|
|
||||||
|
|
||||||
```
|
|
||||||
| number_of_words
|
|
||||||
| slugify
|
|
||||||
```
|
|
||||||
|
|
||||||
```rb
|
|
||||||
| xml_escape #=> CDATA
|
|
||||||
| cgi_escape #=> foo%2Cbar
|
|
||||||
| uri_escape #=> foo,%20bar
|
|
||||||
```
|
|
||||||
|
|
||||||
### Numbers
|
|
||||||
|
|
||||||
| minus: 2
|
|
||||||
| plus: 1
|
|
||||||
| time: 4
|
|
||||||
| divided_by: 3
|
|
||||||
| modulo: 2
|
|
||||||
|
|
||||||
### Code highlighter
|
### Code highlighter
|
||||||
|
|
||||||
```html
|
```html
|
||||||
|
@ -520,14 +409,154 @@ end
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Helpers and filters
|
||||||
|
-------------------
|
||||||
|
{: .-three-column}
|
||||||
|
|
||||||
|
### Dates
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
{{ site.time | date: "%Y %m %d" }}
|
||||||
|
```
|
||||||
|
{: .-setup}
|
||||||
|
|
||||||
|
| `date_to_xmlschema` | → `2008-11-07T13:07:54-08:00` |
|
||||||
|
| `date_to_rfc822` | → `Mon, 07 Nov 2008 13:07:54 -0800` |
|
||||||
|
| `date_to_string` | → `07 Nov 2008` |
|
||||||
|
| `date_to_long_string` | → `07 November 2008` |
|
||||||
|
| `date:` _'%Y %m %d'_ | → `2017 Nov 7` |
|
||||||
|
|
||||||
|
### Preprocessors
|
||||||
|
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
{{ page.description | markdownify }}
|
||||||
|
```
|
||||||
|
{: .-setup}
|
||||||
|
|
||||||
|
| Filter | Description |
|
||||||
|
| --- | --- |
|
||||||
|
| `textilize` | Textile |
|
||||||
|
| `markdownify` | Markdown |
|
||||||
|
| `jsonify` | JSON |
|
||||||
|
| `sassify` | Sass |
|
||||||
|
| `scssify` | SCSS |
|
||||||
|
| `smartify` | Smartypants |
|
||||||
|
|
||||||
|
### Array filters
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
{{ site.pages | where: "year", "2014" }}
|
||||||
|
```
|
||||||
|
{: .-setup}
|
||||||
|
|
||||||
|
| Filter | Description |
|
||||||
|
| --- | --- |
|
||||||
|
| `where:` _"year", "2014"_ | |
|
||||||
|
| `where_exp:` _"item", "item.year >= 2014"_ | |
|
||||||
|
| --- | --- |
|
||||||
|
| `group_by:` _"genre"_ | → `{name, items}` |
|
||||||
|
| `group_by_exp:` _"item", "item.genre"_ | → `{name, items}` |
|
||||||
|
| --- | --- |
|
||||||
|
| `sort` | |
|
||||||
|
| `sort:` _'author'_ | |
|
||||||
|
| --- | --- |
|
||||||
|
| `uniq` | |
|
||||||
|
| --- | --- |
|
||||||
|
| `first` | |
|
||||||
|
| `last` | |
|
||||||
|
| `join:` _','_ | |
|
||||||
|
| `array_to_setentence_string` | → `"X, Y and Z"` |
|
||||||
|
| --- | --- |
|
||||||
|
| `map:` _'post'_ | Works like 'pluck' |
|
||||||
|
| --- | --- |
|
||||||
|
| `size` | |
|
||||||
|
| `push:` _'xxx'_ | Adds an item |
|
||||||
|
|
||||||
|
### String filters
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
{{ page.title | default: "xxx" }}
|
||||||
|
```
|
||||||
|
{: .-setup}
|
||||||
|
|
||||||
|
| Filter | Description |
|
||||||
|
| --- | --- |
|
||||||
|
| `default:` _'xxx'_ | |
|
||||||
|
| --- | --- |
|
||||||
|
| `upcase` | |
|
||||||
|
| `downcase` | |
|
||||||
|
| --- | --- |
|
||||||
|
| `remove:` _'p'_ | |
|
||||||
|
| `replace:` _'super', 'mega'_ | |
|
||||||
|
| `remove_first:` _'p'_ | |
|
||||||
|
| `replace_first:` _'super', 'mega'_ | |
|
||||||
|
| --- | --- |
|
||||||
|
| `truncate:` _5_ | |
|
||||||
|
| `truncatewords:` _20_ | |
|
||||||
|
| --- | --- |
|
||||||
|
| `prepend:` _'Mr. '_ | |
|
||||||
|
| `append:` _'Jr.'_ | |
|
||||||
|
| --- | --- |
|
||||||
|
| `camelize` | |
|
||||||
|
| `capitalize` | |
|
||||||
|
| `strip_html` | |
|
||||||
|
| `strip_newlines` | |
|
||||||
|
| `newlines_to_br` | |
|
||||||
|
| --- | --- |
|
||||||
|
| `split:` _','_ | |
|
||||||
|
| --- | --- |
|
||||||
|
| `escape` | |
|
||||||
|
| `escape_once` | |
|
||||||
|
| --- | --- |
|
||||||
|
| `slice:` _-3, 3_ | |
|
||||||
|
|
||||||
|
See: [String filters](http://docs.shopify.com/themes/liquid-documentation/filters)
|
||||||
|
|
||||||
|
### String filters (Jekyll-only)
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
{{ page.excerpt | number_of_words }}
|
||||||
|
```
|
||||||
|
{: .-setup}
|
||||||
|
|
||||||
|
| Filter | Description |
|
||||||
|
| --- | --- |
|
||||||
|
| `number_of_words` | |
|
||||||
|
| `slugify` | |
|
||||||
|
| --- | --- |
|
||||||
|
| `xml_escape` | → `CDATA` |
|
||||||
|
| `cgi_escape` | → `foo%2Cbar` |
|
||||||
|
| `uri_escape` | → `foo,%20bar` |
|
||||||
|
|
||||||
|
### Numbers
|
||||||
|
|
||||||
|
```
|
||||||
|
{{ site.posts.size | minus: 2 }}
|
||||||
|
```
|
||||||
|
{: .-setup}
|
||||||
|
|
||||||
|
| Filter | Description |
|
||||||
|
| --- | --- |
|
||||||
|
| `minus:` _2_ | |
|
||||||
|
| `plus:` _2_ | |
|
||||||
|
| `times:` _2_ | |
|
||||||
|
| `divided_by:` _2_ | |
|
||||||
|
| `modulo:` _2_ | |
|
||||||
|
| --- | --- |
|
||||||
|
| `ceil` | |
|
||||||
|
| `floor` | |
|
||||||
|
| `round` | |
|
||||||
|
|
||||||
Integration
|
Integration
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
### Bundler
|
### Bundler
|
||||||
|
|
||||||
In `_plugins/bundler.rb`:
|
In `_plugins/bundler.rb`:
|
||||||
|
{: .-setup}
|
||||||
|
|
||||||
```rb
|
```ruby
|
||||||
require "bunder/setup"
|
require "bunder/setup"
|
||||||
Bundler.require :default
|
Bundler.require :default
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue