From 2d104877d5af40ef2b012e5707e14c127d4a2ce3 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Mon, 4 Sep 2017 08:52:41 +0800 Subject: [PATCH] Localize some strings --- Readme.md | 2 +- _config.yml | 3 +++ _data/content.yml | 10 ++++++++++ _includes/2017/top-nav.html | 2 +- _includes/social-list.html | 14 ++++++++++---- _layouts/2017/home.html | 5 ++--- index.md | 1 + 7 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 _data/content.yml diff --git a/Readme.md b/Readme.md index 00ca8ab5a..d25c0f119 100644 --- a/Readme.md +++ b/Readme.md @@ -37,10 +37,10 @@ Each sheet supports these metadata: ```yml --- title: React.js -category: React layout: 2017/sheet # 'default' | '2017/sheet' # Optional: +category: React updated: 2017-08-30 # To show in the updated list ads: false # Add this to disable ads weight: -5 # lower number = higher in related posts list diff --git a/_config.yml b/_config.yml index 18d77ff33..c5e32911b 100644 --- a/_config.yml +++ b/_config.yml @@ -59,6 +59,9 @@ defaults: url: http://ricostacruz.com/cheatsheets title: Cheatsheets +alt_title: Rico's Cheatsheets +home: + tagline: "Hey! I'm @rstacruz and this is a modest collection of cheatsheets I've written." # # Google analytics diff --git a/_data/content.yml b/_data/content.yml new file mode 100644 index 000000000..13684ac52 --- /dev/null +++ b/_data/content.yml @@ -0,0 +1,10 @@ +home: + title: "Rico's cheatsheets" + tagline: "Hey! I'm @rstacruz and this is a modest collection of cheatsheets I've written." +top_nav: + title: "Rico's cheatsheets" +social_list: + default_description: "Grand collection of web development cheatsheets" + description_prefix: "The ultimate cheatsheet for" + facebook_share: Share on Facebook + twitter_share: Share on Twitter diff --git a/_includes/2017/top-nav.html b/_includes/2017/top-nav.html index 2db0d1345..25c510798 100644 --- a/_includes/2017/top-nav.html +++ b/_includes/2017/top-nav.html @@ -7,7 +7,7 @@ {% endunless %} - Rico's cheatsheets + {{ site.data.content.top_nav.title }} {% unless include.noshare %} diff --git a/_includes/social-list.html b/_includes/social-list.html index 2fa854299..76a457acd 100644 --- a/_includes/social-list.html +++ b/_includes/social-list.html @@ -1,6 +1,12 @@ -{% assign description = "The ultimate cheatsheet for " | append: include.page.title | append: "." %} +{% 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: "." %} +{% endif %} diff --git a/_layouts/2017/home.html b/_layouts/2017/home.html index bb9d54c14..4db22bb42 100644 --- a/_layouts/2017/home.html +++ b/_layouts/2017/home.html @@ -18,11 +18,10 @@ type: website
diff --git a/index.md b/index.md index 716c5b115..c6a3c1510 100644 --- a/index.md +++ b/index.md @@ -3,4 +3,5 @@ full_title: "Cheatsheets — for web development and more" description: "A collection of cheatsheets I've written." layout: 2017/home type: website +home: true ---