Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update version in config.yml via YAML load / dump #6677

Merged
merged 2 commits into from Jan 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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