More localizations

This commit is contained in:
Rico Sta. Cruz 2017-09-04 09:15:31 +08:00
parent 4d93951467
commit c363322aa8
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
14 changed files with 114 additions and 61 deletions

View File

@ -1,14 +1,28 @@
:)
# Rico's cheatsheets
> Collection of web development cheatsheets:
Visit: **<https://ricostacruz.com/cheatsheets/>**
---
## Notes
# Dev notes
## Starting a local instance
This is a mere Jekyll site, and `bundle exec jekyll serve` should be fine. But I suggest you use this instead:
```
make
```
## CSS classes
`h2` supports these:
{: .-two-column}
{: .-three-column}
{: .-wide-second} # combine with -x-column
{: .-wide-second} # combine with -xxx-column
{: .-left-reference}
`h3` supports these:
@ -32,6 +46,8 @@
{: .-four-column}
{: .-six-column}
## Frontmatter
Each sheet supports these metadata:
```yml
@ -49,6 +65,8 @@ prism_languages: [vim] # Extra syntax highlighting
---
```
## Prism languages
For supported prism languages:
- <https://github.com/PrismJS/prism/tree/gh-pages/components>
@ -65,3 +83,7 @@ category: Hidden
redirect_to: /es6
---
```
## Localizations
See `_data/content.yml` for chrome strings.

View File

@ -59,9 +59,6 @@ defaults:
url: http://ricostacruz.com/cheatsheets
title: Cheatsheets
alt_title: Rico's Cheatsheets
home:
tagline: "Hey! I'm <a href='https://ricostacruz.com'>@rstacruz</a> and this is a modest collection of cheatsheets I've written."
#
# Google analytics
@ -100,9 +97,3 @@ category_names:
# https://help.github.com/articles/repository-metadata-on-github-pages/
repository: rstacruz/cheatsheets
#
# Disqus comments: uncomment to disable disqus
#
disqus_host: devhints.disqus.com

2
_data/carbon.yml Normal file
View File

@ -0,0 +1,2 @@
enabled: true
src: //cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=ricostacruzcom

View File

@ -1,10 +1,35 @@
home:
title: "Rico's cheatsheets"
tagline: "Hey! I'm <a href='https://ricostacruz.com'>@rstacruz</a> and this is a modest collection of cheatsheets I've written."
top_nav:
title: "Rico's cheatsheets"
edit: Edit
edit_on_github: Edit this page on GitHub
sheet:
suffix: cheatsheet
social_list:
default_description: "Grand collection of web development cheatsheets"
description_prefix: "The ultimate cheatsheet for"
description: "The ultimate cheatsheet for TITLE."
facebook_share: Share on Facebook
twitter_share: Share on Twitter
related_posts_callout:
description: Over SIZE curated cheatsheets, by developers for developers.
link: Cheatsheets home
related_posts_group:
top: Top cheatsheets
other: Other cheatsheets
category: Other CATEGORY cheatsheets
search_form:
default_placeholder: Search SIZE+ cheatsheets
home_placeholder: Search...
prefix: devhints.io
comments_area:
suffix: for this cheatsheet.
link: "Write yours!"

2
_data/disqus.yml Normal file
View File

@ -0,0 +1,2 @@
enabled: true
host: devhints.disqus.com

View File

@ -1,22 +1,24 @@
{% assign identifier = include.page.url | remove: '.html' | remove_first: '/' %}
<section class='comments-area' id='comments'>
<div class='container'>
<details class='comments-details'>
<summary>
<strong class='count'>
<span class='disqus-comment-count' data-disqus-identifier="{{ identifier }}" data-disqus-url='{{ site.url }}/{{ identifier }}'>0 Comments</span>
</strong>
<span class='suffix'>for this cheatsheet.</span>
<span class='fauxlink'>Write yours!</span>
</summary>
<div class='comments-section'>
<div class='comments'>
<div id='disqus_thread'></div>
<noscript data-js-disqus='{"host":"{{ site.disqus_host }}","url":"{{ site.url }}/{{ identifier }}","identifier":"{{ identifier }}"}'></noscript>
{% if site.data.disqus.enabled %}
<section class='comments-area' id='comments'>
<div class='container'>
<details class='comments-details'>
<summary>
<strong class='count'>
<span class='disqus-comment-count' data-disqus-identifier="{{ identifier }}" data-disqus-url='{{ site.url }}/{{ identifier }}'>0 Comments</span>
</strong>
<span class='suffix'>{{ site.data.content.comments_area.suffix }}</span>
<span class='fauxlink'>{{ site.data.content.comments_area.link }}</span>
</summary>
<div class='comments-section'>
<div class='comments'>
<div id='disqus_thread'></div>
<noscript data-js-disqus='{"host":"{{ site.data.disqus.host }}","url":"{{ site.url }}/{{ identifier }}","identifier":"{{ identifier }}"}'></noscript>
</div>
</div>
</div>
</details>
</div>
</section>
</details>
</div>
</section>
<script id='dsq-count-scr' src='//{{ site.disqus_host }}/count.js' async></script>
<script id='dsq-count-scr' src='//{{ site.data.disqus.host }}/count.js' async></script>
{% endif %}

View File

@ -10,6 +10,7 @@
| where_exp: "page", "page.deprecated != true"
| sort: "weight", "last"
%}
{% assign size = site.pages | size %}
<footer class='related-posts-area' id='related'>
<div class='container'>
<div class='related-posts-section'>
@ -19,11 +20,11 @@
<i class='icon'></i>
<span class='description'>
Over {{ site.pages | size }} curated cheatsheets, by developers for developers.
{{ site.data.content.related_posts_callout.description | replace: "SIZE", size }}
</span>
<span class='push-button -dark'>
Cheatsheets home
{{ site.data.content.related_posts_callout.link }}
</span>
</div>
</a>
@ -32,9 +33,9 @@
<div class='group'>
<div class='related-posts-group'>
{% if include.page.category == 'Others' %}
<h3>Other cheatsheets</h3>
<h3>{{ site.data.content.related_posts_group.other }}</h3>
{% else %}
<h3>Other {{ include.page.category }} cheatsheets</h3>
<h3>{{ site.data.content.related_posts_group.category | replace: "CATEGORY", include.page.category }}</h3>
{% endif %}
<ul class='related-post-list'>
@ -47,7 +48,7 @@
<div class='group'>
<div class='related-posts-group'>
<h3>Top cheatsheets</h3>
<h3>{{ site.data.content.related_posts_group.top }}</h3>
<ul class='related-post-list'>
{% for page in top_pages limit: 6 %}

View File

@ -3,16 +3,19 @@
class='search'action='{{ base }}' method='get'>
<label class='search-box {{ include.class }}'>
{% comment %}
<span class='prefix'>devhints.io</span>
<span class='prefix'>{{ site.data.content.search_form.prefix }}</span>
<span class='sep'>/</span>
{% endcomment %}
<input name='q'
type='text'
{% if include.live %}
{% assign placeholder = site.data.content.search_form.home_placeholder | replace: "%{size}", size %}
autofocus data-js-search-input
placeholder='Search...'
placeholder='{{ placeholder }}'
{% else %}
placeholder='Search {{ site.pages | size }}+ cheatsheets'
{% assign size = site.pages | size %}
{% assign placeholder = site.data.content.search_form.default_placeholder | replace: "SIZE", size %}
placeholder='{{ placeholder }}'
{% endif %}>
</label>
</form>

View File

@ -14,15 +14,15 @@
<div class='actions'>
{% include social-list.html class="social page-actions" page=include.page %}
{% if include.page.type != 'website' %}
{% unless include.is_home %}
<ul class='page-actions'>
<li class='link github -button hint--bottom' data-hint='Edit this page on GitHub'>
<li class='link github -button hint--bottom' data-hint='{{ site.data.content.top_nav.edit_on_github }}'>
<a href='{{ site.github.repository_url }}/blob/gh-pages/{{ page.path | remove: '.html' }}'>
<span class='text -visible'>Edit</span>
<span class='text -visible'>{{ site.data.content.top_nav.edit }}</span>
</a>
</li>
</ul>
{% endif %}
{% endunless %}
</div>
{% endunless %}
</div>

View File

@ -1,7 +1,7 @@
{% if include.page.home %}
{% assign description = site.data.content.social_list.default_description %}
{% else %}
{% assign description = site.data.content.social_list.description_prefix | append: " " | append: include.page.title | append: "." %}
{% assign description = site.data.content.social_list.description | replace: "TITLE", include.page.title %}
{% endif %}
<ul class="social-list {{ include.class }}">
<li class="facebook link hint--bottom" data-hint="{{ site.data.content.social_list.facebook_share }}"><a href="https://www.facebook.com/sharer/sharer.php?u={{ site.url }}{{ include.page.url }}" target="share"><span class="text"></span></a></li>

View File

@ -11,9 +11,11 @@ type: website
{% include 2017/head.html %}
{% include 2017/top-nav.html page=page is_home=true %}
<div class='SideAd'>
<script async src='//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=ricostacruzcom' id="_carbonads_js"></script>
</div>
{% if site.data.carbon.enabled %}
<div class='SideAd'>
<script async src='{{ site.data.carbon.src }}' id="_carbonads_js"></script>
</div>
{% endif %}
<div class='body-area -slim'>
<div class='site-header'>

View File

@ -7,11 +7,13 @@ type: article
<div class='body-area'>
<header class='main-heading {% if page.ads != false %}-with-ads{% endif %}'>
<h1 class='h1'>{{ page.title }} <em>cheatsheet</em></h1>
<h1 class='h1'>{{ page.title }} <em>{{ site.data.content.sheet.suffix }}</em></h1>
{% if page.ads != false %}
<div class='HeadlineAd ad'>
<script async src='//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=ricostacruzcom' id="_carbonads_js"></script>
</div>
{% if site.data.carbon.enabled %}
<div class='HeadlineAd ad'>
<script async src='{{ site.data.carbon.src }}' id="_carbonads_js"></script>
</div>
{% endif %}
{% endif %}
</header>
@ -28,10 +30,7 @@ type: article
<div class='pre-footer'><i class='icon'></i></div>
{% if site.disqus_host %}
{% include 2017/comments-area.html page=page %}
{% endif %}
{% include 2017/search-footer.html %}
{% include 2017/related-posts.html page=page %}
{% include 2017/foot.html %}

View File

@ -13,9 +13,11 @@ type: article
<h1><span>{{ page.title }}</span></h1>
</div>
<div class='headline-ad'>
<script async src='//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=ricostacruzcom' id="_carbonads_js"></script>
</div>
{% if site.data.carbon.enabled %}
<div class='headline-ad'>
<script async src='{{ site.data.carbon.src }}' id="_carbonads_js"></script>
</div>
{% endif %}
<div class='post-content -cheatsheet'>
{{ content }}

View File

@ -20,8 +20,10 @@ html_class: home
</div>
{% endfor %}
<div class='side-ad'>
<script async src='//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=ricostacruzcom' id="_carbonads_js"></script>
</div>
{% if site.data.carbon.enabled %}
<div class='side-ad'>
<script async src='{{ site.data.carbon.src }}' id="_carbonads_js"></script>
</div>
{% endif %}
{% include foot.html %}