Commit 9327f70d authored by Lauren Barker's avatar Lauren Barker
Browse files

moved posts inside post directories with blogs

parent ed81a09b
Pipeline #105823864 passed with stages
in 23 minutes and 2 seconds
......@@ -262,8 +262,7 @@ namespace :lint do
 
## Categories as defined in
## https://about.gitlab.com/handbook/marketing/blog/#categories
CATEGORIES = ['releases',
'engineering',
CATEGORIES = ['engineering',
'open source',
'culture',
'insights',
......@@ -276,7 +275,7 @@ namespace :lint do
puts ''
puts '=> Checking if any posts have incorrect categories...'
 
Dir['source/blog/*'].each do |post|
Dir['source/blog/posts/*'].each do |post|
content = File.read(post)
data = content.scan(YAML_FRONT_MATTER_REGEXP)&.last&.first
 
......@@ -577,7 +576,7 @@ task :new_post, :title do |t, args|
title = STDIN.gets.chomp
end
 
filename = "source/blog/#{Time.now.strftime('%Y-%m-%d')}-#{title.to_url}.html.md.erb"
filename = "source/blog/posts/#{Time.now.strftime('%Y-%m-%d')}-#{title.to_url}.html.md.erb"
puts "Creating new post: #{filename}"
File.open(filename, 'w') do |post|
post.puts '---'
......@@ -616,7 +615,7 @@ namespace :release do
desc 'Creates a new release post for major and minor versions'
task :monthly, :version do |t, args|
version = args.version
source_dir = File.expand_path('source', __dir__)
source_dir = File.expand_path('source/releases', __dir__)
date = Time.now.strftime('%Y-%m-22')
posts_dir = 'posts'
 
......@@ -664,7 +663,7 @@ namespace :release do
desc 'Creates a new release post for patch versions'
task :patch, :version do |t, args|
version = args.version
source_dir = File.expand_path('source', __dir__)
source_dir = File.expand_path('source/releases', __dir__)
posts_dir = 'posts'
 
raise 'You need to specify a patch version, like 10.1.1' unless /\A\d+\.\d+\.\d+\z/.match?(version)
......
......@@ -35,7 +35,7 @@ activate :blog do |blog|
blog.name = 'blog'
# This will add a prefix to all links, template references and source paths
blog.prefix = 'blog'
blog.sources = '{year}-{month}-{day}-{title}.html'
blog.sources = 'posts/{year}-{month}-{day}-{title}.html'
blog.permalink = '/{year}/{month}/{day}/{title}/index.html'
blog.layout = 'post'
# Allow draft posts to appear on all branches except master (for Review Apps)
......@@ -57,7 +57,7 @@ activate :blog do |blog|
blog.name = 'releases'
# This will add a prefix to all links, template references and source paths
blog.prefix = 'releases'
blog.sources = '{year}-{month}-{day}-{title}.html'
blog.sources = 'posts/{year}-{month}-{day}-{title}.html'
blog.permalink = '/{year}/{month}/{day}/{title}/index.html'
blog.layout = 'post'
# Allow draft posts to appear on all branches except master (for Review Apps)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment