From 9bd923d6c5ccf0d0f10b8e134b086fe753362216 Mon Sep 17 00:00:00 2001 From: Florian Thomas Date: Sat, 6 Jan 2018 14:53:28 +0000 Subject: [PATCH 1/2] Update version in `config.yml` via YAML load / dump --- docs/_config.yml | 65 ++++++++++++++++++++---------------------------- rake/site.rake | 6 +++-- 2 files changed, 31 insertions(+), 40 deletions(-) diff --git a/docs/_config.yml b/docs/_config.yml index e91ae126cc3..ad976f22ca2 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,60 +1,49 @@ +--- sass: style: compressed - -version: 3.7.0 # latest version displayed in header +version: 3.7.0 gauges_id: 503c5af6613f5d0f19000027 google_analytics_id: UA-50755011-1 google_site_verification: onQcXpAvtHBrUI5LlroHNE_FP0b2qvFyPq7VZw36iEY - repository: https://github.com/jekyll/jekyll - timezone: America/Los_Angeles - defaults: - - - scope: - path: "_docs" - type: "docs" - values: - layout: "docs" - - - scope: - path: "_posts" - type: "posts" - values: - layout: "news_item" - image: /img/twitter-card.png - +- scope: + path: _docs + type: docs + values: + layout: docs +- scope: + path: _posts + type: posts + values: + layout: news_item + image: "/img/twitter-card.png" collections: docs: - permalink: /:collection/:path/ + permalink: "/:collection/:path/" output: true posts: - permalink: /news/:year/:month/:day/:title/ + permalink: "/news/:year/:month/:day/:title/" output: true tutorials: output: true - name: Jekyll • Simple, blog-aware, static sites description: Transform your plain text into static websites and blogs url: https://jekyllrb.com - twitter: username: jekyllrb - -logo: /img/logo-2x.png - +logo: "/img/logo-2x.png" plugins: - - jekyll-avatar - - jekyll-feed - - jekyll-mentions - - jekyll-redirect-from - - jekyll-seo-tag - - jekyll-sitemap - - jemoji - +- jekyll-avatar +- jekyll-feed +- jekyll-mentions +- jekyll-redirect-from +- jekyll-seo-tag +- jekyll-sitemap +- jemoji exclude: - - .gitignore - - CNAME - - icomoon-selection.json - - readme.md +- ".gitignore" +- CNAME +- icomoon-selection.json +- readme.md diff --git a/rake/site.rake b/rake/site.rake index 05be2f7f233..87299a3a5ef 100644 --- a/rake/site.rake +++ b/rake/site.rake @@ -87,9 +87,11 @@ namespace :site do desc "Write the latest Jekyll version" task :latest_version do return if version =~ %r!(beta|rc|alpha)!i + require "safe_yaml/load" config_file = File.join(docs_folder, "_config.yml") - contents = File.read(config_file) - File.write(config_file, contents.sub(%r!(?:version\s*:\s+)(.+)!, "version: #{version}")) + config = SafeYAML.load_file(config_file) + config["version"] = version + File.write(config_file, YAML.dump(config)) File.open("#{docs_folder}/latest_version.txt", "wb") { |f| f.puts(version) } end From 7ef61d436d9e8e92dd1cc6874cc98c89ef2771f3 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Sat, 6 Jan 2018 16:06:39 +0100 Subject: [PATCH 2/2] Sort configuration file --- docs/_config.yml | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/_config.yml b/docs/_config.yml index ad976f22ca2..fe500a58387 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,12 +1,25 @@ --- -sass: - style: compressed version: 3.7.0 +name: Jekyll • Simple, blog-aware, static sites +description: Transform your plain text into static websites and blogs +url: https://jekyllrb.com +repository: https://github.com/jekyll/jekyll +timezone: America/Los_Angeles +twitter: + username: jekyllrb +logo: "/img/logo-2x.png" gauges_id: 503c5af6613f5d0f19000027 google_analytics_id: UA-50755011-1 google_site_verification: onQcXpAvtHBrUI5LlroHNE_FP0b2qvFyPq7VZw36iEY -repository: https://github.com/jekyll/jekyll -timezone: America/Los_Angeles +collections: + docs: + permalink: "/:collection/:path/" + output: true + posts: + permalink: "/news/:year/:month/:day/:title/" + output: true + tutorials: + output: true defaults: - scope: path: _docs @@ -19,21 +32,6 @@ defaults: values: layout: news_item image: "/img/twitter-card.png" -collections: - docs: - permalink: "/:collection/:path/" - output: true - posts: - permalink: "/news/:year/:month/:day/:title/" - output: true - tutorials: - output: true -name: Jekyll • Simple, blog-aware, static sites -description: Transform your plain text into static websites and blogs -url: https://jekyllrb.com -twitter: - username: jekyllrb -logo: "/img/logo-2x.png" plugins: - jekyll-avatar - jekyll-feed @@ -42,6 +40,8 @@ plugins: - jekyll-seo-tag - jekyll-sitemap - jemoji +sass: + style: compressed exclude: - ".gitignore" - CNAME