Skip to content

Commit

Permalink
Update version in config.yml via YAML load / dump (#6677)
Browse files Browse the repository at this point in the history
Merge pull request 6677
  • Loading branch information
Crunch09 authored and jekyllbot committed Jan 6, 2018
1 parent a84e9e1 commit 6a82754
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 50 deletions.
85 changes: 37 additions & 48 deletions docs/_config.yml
@@ -1,60 +1,49 @@
sass:
style: compressed

version: 3.7.0 # latest version displayed in header
---
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

defaults:
-
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

defaults:
- scope:
path: _docs
type: docs
values:
layout: docs
- scope:
path: _posts
type: posts
values:
layout: news_item
image: "/img/twitter-card.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
sass:
style: compressed
exclude:
- .gitignore
- CNAME
- icomoon-selection.json
- readme.md
- ".gitignore"
- CNAME
- icomoon-selection.json
- readme.md
6 changes: 4 additions & 2 deletions rake/site.rake
Expand Up @@ -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

Expand Down

0 comments on commit 6a82754

Please sign in to comment.