Fix Jekyll escaping.
This commit is contained in:
parent
277effd6dd
commit
b79dc1712b
|
@ -1,3 +1,6 @@
|
|||
{% if page.jekyll_escape %}
|
||||
<script>var JekyllEscape=true;</script>
|
||||
{% endif %}
|
||||
<script src="assets/highlight.min.js"></script>
|
||||
<script src="assets/script.js"></script>
|
||||
<script>
|
||||
|
|
|
@ -15,3 +15,15 @@
|
|||
});
|
||||
}
|
||||
})();
|
||||
|
||||
(function () {
|
||||
var tags = document.querySelectorAll('pre code, pre span');
|
||||
|
||||
for (var i=0, len=tags.length; i<len; i++) {
|
||||
var tag = tags[i];
|
||||
if (~tag.innerHTML.indexOf('{\\%'))
|
||||
tag.innerHTML = tag.innerHTML.replace(/{\\%/g, '{%');
|
||||
if (~tag.innerHTML.indexOf('{\\{'))
|
||||
tag.innerHTML = tag.innerHTML.replace(/{\\{/g, '{{');
|
||||
}
|
||||
})();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
html, body {
|
||||
font-family: lato, sans-serif;
|
||||
font-size: 15px;
|
||||
font-size: 16px;
|
||||
line-height: 1.556;
|
||||
color: #444;
|
||||
margin: 0;
|
||||
|
@ -19,9 +19,13 @@ h1 {
|
|||
font-weight: 100;
|
||||
}
|
||||
|
||||
pre {
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
pre, code {
|
||||
font-family: menlo, monospace;
|
||||
font-size: 12px;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
a {
|
||||
|
@ -52,7 +56,7 @@ a {
|
|||
* stuff
|
||||
*/
|
||||
|
||||
.header, .content, .pages {
|
||||
div.header, div.content, div.pages {
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
padding-left: 15px;
|
||||
|
|
89
jekyll.md
89
jekyll.md
|
@ -1,6 +1,7 @@
|
|||
---
|
||||
title: Jekyll
|
||||
layout: default
|
||||
jekyll_escape: true
|
||||
---
|
||||
|
||||
### Installation
|
||||
|
@ -26,8 +27,7 @@ layout: default
|
|||
_site/
|
||||
...
|
||||
|
||||
Frontmatter
|
||||
-----------
|
||||
## [Front-matter](http://jekyllrb.com/docs/frontmatter/)
|
||||
|
||||
---
|
||||
layout: post
|
||||
|
@ -42,10 +42,6 @@ Frontmatter
|
|||
categories: ['html', 'css']
|
||||
tags: ['html', 'css']
|
||||
|
||||
### Reference
|
||||
|
||||
* [Front-matter](http://jekyllrb.com/docs/frontmatter/)
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
|
@ -58,8 +54,7 @@ Configuration
|
|||
|
||||
* [Configuration](http://jekyllrb.com/docs/configuration/)
|
||||
|
||||
Variables
|
||||
---------
|
||||
## [Variables](http://jekyllrb.com/docs/variables/)
|
||||
|
||||
{\{ site }} - from config.yml
|
||||
{\{ page }} - from frontmatter, and page-specific info
|
||||
|
@ -75,6 +70,8 @@ Variables
|
|||
{\{ site.categories.CATEGORY }} - list
|
||||
{\{ site.tags.TAG }} - list
|
||||
|
||||
{\{ site.static_files }}
|
||||
|
||||
### Page
|
||||
|
||||
{\{ page.content }} - un-rendered content
|
||||
|
@ -82,19 +79,53 @@ Variables
|
|||
{\{ page.excerpt }} - un-rendered excerpt
|
||||
{\{ page.url }}
|
||||
{\{ page.date }}
|
||||
{\{ page.id }}
|
||||
{\{ page.id }} - unique id for RSS feeds
|
||||
{\{ page.categories }}
|
||||
{\{ page.tags }}
|
||||
{\{ page.path }}
|
||||
{\{ post.excerpt | remove: '<p>' | remove: '</p>' }}
|
||||
{\{ post.excerpt | strip_html }}
|
||||
|
||||
### Paginator
|
||||
<!-- blog pagination: -->
|
||||
{\{ page.next }}
|
||||
{\{ page.previous }}
|
||||
|
||||
### [Paginator](http://jekyllrb.com/docs/pagination/)
|
||||
|
||||
{\{ paginator.page }} - page number
|
||||
{\{ paginator.total_posts}}
|
||||
{\{ paginator.total_pages}}
|
||||
{\{ paginator.per_page }}
|
||||
{\{ paginator.posts }}
|
||||
|
||||
{\% for post in paginator.posts %} ... {\% endfor %}
|
||||
|
||||
{\% if paginator.previous_page %}
|
||||
<a href="{\{ paginator.previous_page_path }}">Previous</a>
|
||||
{\% else %}
|
||||
{\% endif %}
|
||||
|
||||
{\{ paginator.next_page }} - page number
|
||||
{\{ paginator.next_page_path }}
|
||||
...
|
||||
|
||||
Sample code
|
||||
-----------
|
||||
{\% if paginator.total_pages > 1 %}
|
||||
{\% endif %}
|
||||
|
||||
Add this to `_config.yml`:
|
||||
|
||||
paginate: 5
|
||||
paginate_path: "blog/:num"
|
||||
|
||||
### Code
|
||||
|
||||
{\% highlight ruby linenos %}
|
||||
def show
|
||||
...
|
||||
end
|
||||
{\% endhighlight %}
|
||||
|
||||
Markup
|
||||
------
|
||||
|
||||
### Loops
|
||||
|
||||
|
@ -119,6 +150,34 @@ Sample code
|
|||
|
||||
{\% include header.html %}
|
||||
|
||||
Blogging
|
||||
--------
|
||||
|
||||
_posts/YEAR-MONTH-DAY-title.md
|
||||
|
||||
### Image paths
|
||||
|
||||

|
||||
|
||||
### [Drafts](http://jekyllrb.com/docs/drafts/)
|
||||
|
||||
vi _drafts/a-draft-post.md
|
||||
jekyll build --drafts
|
||||
|
||||
### [Permalinks](http://jekyllrb.com/docs/permalinks/)
|
||||
|
||||
# _config.yml
|
||||
permalink: date # /:categories/:year/:month/:day/:title.html
|
||||
permalink: pretty # /:categories/:year/:month/:day/:title/
|
||||
permalink: none # /:categories/:title.html
|
||||
permalink: "/:title"
|
||||
|
||||
## [Data](http://jekyllrb.com/docs/datafiles/)
|
||||
|
||||
_data/members.yml
|
||||
|
||||
{\% for member in site.data.members %}
|
||||
|
||||
Integration
|
||||
-----------
|
||||
|
||||
|
@ -132,3 +191,7 @@ Integration
|
|||
|
||||
* [Compass](https://gist.github.com/parkr/2874934)
|
||||
* [Asset pipeline](https://github.com/matthodan/jekyll-asset-pipeline)
|
||||
|
||||
### References
|
||||
|
||||
* http://jekyllrb.com/docs/home/
|
||||
|
|
Loading…
Reference in New Issue