Add lint checker for blog posts categories

Based on the recently updated
https://about.gitlab.com/handbook/marketing/blog/#categories
parent e92c09b9
Pipeline #23470262 passed with stages
in 16 minutes and 31 seconds
......@@ -6,6 +6,7 @@ desc 'Run all lint tasks'
task lint: ['lint:scss',
'lint:features:solutions',
'lint:features:links',
'lint:blog:categories',
'lint:docs_ee'] do
end
......@@ -62,6 +63,49 @@ namespace :lint do
end
end
namespace :blog do
desc "Ensure every post has one of the right categories"
task :categories do
## Taken from Jekyll
## https://github.com/jekyll/jekyll/blob/3.5-stable/lib/jekyll/document.rb#L13
YAML_FRONT_MATTER_REGEXP = /\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)/m
## Categories as defined in
## https://about.gitlab.com/handbook/marketing/blog/#categories
CATEGORIES = ['releases',
'engineering',
'open source',
'culture',
'insights',
'GitLab news'].freeze
count = 0
Dir['source/posts/*'].each do |post|
content = File.read(post)
data = content.scan(YAML_FRONT_MATTER_REGEXP).last.first
## Disable Rubocop due to https://github.com/ruby/psych/issues/262
## We only parse the file, so there's no security issue anyway
# rubocop:disable Security/YAMLLoad
to_yaml = YAML.load(data)
# rubocop:enable Security/YAMLLoad
unless CATEGORIES.include? to_yaml['categories']
puts "=> Missing proper category in #{post}"
count += 1
end
end
if count.positive?
puts
puts "#{count} missing or wrong defined categories found. To get this sorted, read:"
puts 'https://about.gitlab.com/handbook/marketing/blog/#categories'
exit count
end
end
end
desc "Check that all docs point to /ee/"
task :docs_ee do
abort unless system('./scripts/docs_ee_check.sh')
......
......@@ -273,7 +273,7 @@ title: "This is the post title"
author: Firstname Lastname
author_gitlab: GitLab.com username # included in February, 2017
author_twitter: Twitter username
categories: technical overview
categories: engineering
image_title: '/images/blogimages/post-cover-image.jpg'
description: "Short description for the blog post" # included in August, 2016
tags: tag1, tag2, tag3 # added June, 2018
......@@ -352,18 +352,22 @@ Use only **one** of the following categories per post.
**Do not** change the capitalization, spelling, or anything else,
otherwise you'll create another category, which is something we don't want to do accidentally.
- releases – release posts, security updates, patch releases, etc.
- engineering – technical, actionable content. Anything covering how to do something, use something, or solve a problem should fall under this category
- open source – stories from or about our community, users, or the wider open source community
- culture – posts about remote work, working together, or GitLab culture
- insights – industry, data, newsjacking, developer survey, etc.
- GitLab news – company or product announcements, policy changes, events, etc.
- `releases` – release posts, security updates, patch releases, etc.
- `engineering` – technical, actionable content. Anything covering how to do something, use something, or solve a problem should fall under this category
- `open source` – stories from or about our community, users, or the wider open source community
- `culture` – posts about remote work, working together, or GitLab culture
- `insights` – industry, data, newsjacking, developer survey, etc.
- `GitLab news` – company or product announcements, policy changes, events, etc.
We're working on improving category pages and tagging, but for now you can find posts under the same category by navigating to
`https://about.gitlab.com/blog/categories/category-name/`. Dashes will be automatically added
to multi-word categories and all of them will be lowercased in the URL. For example, the
category "GitLab news" will be available under `https://about.gitlab.com/blog/categories/gitlab-news/`.
Note that there's a CI test that checks for wrong or missing categories. If one of
the above should change or a new category is added, don't forget to also change the
[categories that are in the checker](https://gitlab.com/gitlab-com/www-gitlab-com/blob/8a8aef34a6a7c2c5413024bef2163935748d8701/Rakefile#L88-93).
#### Cover image
Do not leave the post without a cover image (`image_title`), unless you have a strong reason to do so.
......
......@@ -4,6 +4,7 @@ wordpress_id: 8
wordpress_url: http://blog.gitlabhq.com/?p=7
date: 2011-10-24 12:17:18 +00:00
comments: false
categories: releases
---
<h3>1. Download (501 MB)
<a title="ubuntu server 10.04" href="http://downloads.gitlabhq.com/gitlab-ubuntu-server-10.04-amd64.zip">http://downloads.gitlabhq.com/gitlab-ubuntu-server-10.04-amd64.zip</a>
......
......@@ -4,6 +4,7 @@ wordpress_id: 25
wordpress_url: http://blog.gitlabhq.com/?p=25
date: 2011-11-07 21:37:44 +00:00
comments: false
categories: GitLab news
---
<a href="http://blog.gitlabhq.com/wp-content/uploads/2011/11/gitlab_issues1.png"><img src="http://blog.gitlabhq.com/wp-content/uploads/2011/11/gitlab_issues1.png" alt="" title="Issues" width="974" class="alignnone size-full wp-image-27" /></a>
......
......@@ -4,5 +4,6 @@ wordpress_id: 36
wordpress_url: http://blog.gitlabhq.com/?p=36
date: 2011-11-08 09:08:10 +00:00
comments: false
categories: GitLab news
---
<a href="http://www.ryanwersal.com/blog/2011/10/18/installing-gitlab-on-ubuntu-server/" title="installing-gitlab-on-ubuntu-server">Install guide from Ryan Wersal</a>
......@@ -4,5 +4,6 @@ wordpress_id: 39
wordpress_url: http://blog.gitlabhq.com/?p=39
date: 2011-11-16 07:32:49 +00:00
comments: false
categories: GitLab news
---
<a href="http://blog.gitlabhq.com/wp-content/uploads/2011/11/network1.png"><img src="http://blog.gitlabhq.com/wp-content/uploads/2011/11/network1.png" alt="" title="network" width="602" class="size-full wp-image-40" /></a>
......@@ -4,5 +4,6 @@ wordpress_id: 48
wordpress_url: http://blog.gitlabhq.com/?p=48
date: 2011-11-16 19:52:19 +00:00
comments: false
categories: GitLab news
---
<a href="http://blog.gitlabhq.com/wp-content/uploads/2011/11/project_activities1.png"><img src="http://blog.gitlabhq.com/wp-content/uploads/2011/11/project_activities1.png" alt="" title="project_activities" width="602" class="alignnone size-full wp-image-49" /></a>
......@@ -4,6 +4,7 @@ wordpress_id: 52
wordpress_url: http://blog.gitlabhq.com/?p=52
date: 2011-11-17 14:34:11 +00:00
comments: false
categories: releases
---
<ol>
<li><h3>New design</h3></li>
......
---
title: Pronto released
wordpress_id: 69
categories: releases
wordpress_url: http://blog.gitlabhq.com/?p=69
date: 2011-11-22 20:28:54 +00:00
comments: false
......
......@@ -4,6 +4,7 @@ wordpress_id: 84
wordpress_url: http://blog.gitlabhq.com/?p=84
date: 2011-11-22 23:05:13 +00:00
comments: false
categories: releases
---
'Pronto' released. We are on our way to version 2. The main goal is <strong>gitolite</strong> support. I think of some other features I find useful for project:
<ul>
......
......@@ -4,6 +4,7 @@ wordpress_id: 96
wordpress_url: http://blog.gitlabhq.com/?p=96
date: 2011-11-24 23:51:01 +00:00
comments: false
categories: GitLab news
---
<a href="http://blog.gitlabhq.com/wp-content/uploads/2011/11/11660251.png"><img src="http://blog.gitlabhq.com/wp-content/uploads/2011/11/11660251.png" alt="" title="issue with branch" width="602" class="alignnone size-full wp-image-97" /></a>
......
......@@ -4,6 +4,7 @@ wordpress_id: 100
wordpress_url: http://blog.gitlabhq.com/?p=100
date: 2011-11-27 15:30:43 +00:00
comments: false
categories: GitLab news
---
I prefer dark colors so i Implemented ability to switch for dark one.
<a href="http://blog.gitlabhq.com/wp-content/uploads/2011/11/11715191.png"><img src="http://blog.gitlabhq.com/wp-content/uploads/2011/11/11715191.png" alt="" title="1171519" width="602" class="aligncenter size-full wp-image-101" /></a>
......@@ -4,6 +4,7 @@ wordpress_id: 103
wordpress_url: http://blog.gitlabhq.com/?p=103
date: 2011-11-27 15:34:27 +00:00
comments: false
categories: GitLab news
---
We decided to keep issue show page simplier.
<a href="http://blog.gitlabhq.com/wp-content/uploads/2011/11/issues_11.png"><img src="http://blog.gitlabhq.com/wp-content/uploads/2011/11/issues_11.png" alt="" title="issues_1" width="602" class="aligncenter size-full wp-image-105" /></a>
......@@ -4,6 +4,7 @@ wordpress_id: 108
wordpress_url: http://blog.gitlabhq.com/?p=108
date: 2011-11-28 21:05:56 +00:00
comments: false
categories: GitLab news
---
Merge requests list
<a href="http://blog.gitlabhq.com/wp-content/uploads/2011/11/gitlab_merge_requests_11.png"><img src="http://blog.gitlabhq.com/wp-content/uploads/2011/11/gitlab_merge_requests_11.png" alt="" title="gitlab_merge_requests_1" width="601" class="aligncenter size-full wp-image-109" /></a>
......
......@@ -4,6 +4,7 @@ wordpress_id: 114
wordpress_url: http://blog.gitlabhq.com/?p=114
date: 2011-12-01 09:54:07 +00:00
comments: false
categories: GitLab news
---
We restyled commit page & added anchors to line numbers
<a href="http://blog.gitlabhq.com/wp-content/uploads/2011/12/commits1.png"><img src="http://blog.gitlabhq.com/wp-content/uploads/2011/12/commits1.png" alt="" title="commits" width="1059" height="883" class="aligncenter size-full wp-image-115" /></a>
......@@ -4,6 +4,7 @@ wordpress_id: 119
wordpress_url: http://blog.gitlabhq.com/?p=119
date: 2011-12-07 14:25:25 +00:00
comments: false
categories: GitLab news
---
<a href="http://blog.gitlabhq.com/wp-content/uploads/2011/12/gitLab_access1.png"><img class="aligncenter size-full wp-image-120" title="gitLab_access" src="http://blog.gitlabhq.com/wp-content/uploads/2011/12/gitLab_access1.png" alt="" width="1162" height="782" /></a>
......
......@@ -4,6 +4,7 @@ wordpress_id: 128
wordpress_url: http://blog.gitlabhq.com/?p=128
date: 2011-12-09 16:31:11 +00:00
comments: false
categories: GitLab news
---
Activities (old dashboard page)
<a href="http://blog.gitlabhq.com/wp-content/uploads/2011/12/dashboard11.png"><img src="http://blog.gitlabhq.com/wp-content/uploads/2011/12/dashboard11.png" alt="" title="dashboard1" width="1096" height="557" class="aligncenter size-full wp-image-129" /></a>
......
......@@ -4,6 +4,7 @@ wordpress_id: 153
wordpress_url: http://blog.gitlabhq.com/?p=153
date: 2011-12-22 09:54:45 +00:00
comments: false
categories: releases
---
<h2>Giltab v2.0 'Moderno' released!</h2>
<p>We finally moved from gitosis to gitolite. It'll allow us to make a lot of useful features in future.</p>
......
......@@ -4,6 +4,7 @@ wordpress_id: 183
wordpress_url: http://blog.gitlabhq.com/?p=183
date: 2012-01-05 18:23:58 +00:00
comments: false
categories: releases
---
For last week we made some changes to gitlab so we are a bit closer to 2.1 release.
......
......@@ -4,6 +4,7 @@ wordpress_id: 191
wordpress_url: http://blog.gitlabhq.com/?p=191
date: 2012-01-13 21:43:55 +00:00
comments: false
categories: GitLab news
---
We made changes to design & layout of gitlab.
Goal of changes is to reach bigger working area & minimalistic UI.
......
---
title: Gitlabhq 2.1 released!
wordpress_id: 202
categories: releases
wordpress_url: http://blog.gitlabhq.com/?p=202
date: 2012-01-22 19:11:57 +00:00
comments: false
......
......@@ -4,6 +4,7 @@ wordpress_id: 214
wordpress_url: http://blog.gitlabhq.com/?p=214
date: 2012-02-22 10:32:45 +00:00
comments: false
categories: releases
---
<h2>Up to v2.2</h2>
......
......@@ -4,6 +4,7 @@ wordpress_id: 246
wordpress_url: http://blog.gitlabhq.com/?p=246
date: 2012-03-07 12:26:43 +00:00
comments: false
categories: releases
---
We have 2 major backend changes in 2.3
1. Resque <strong/>is required</strong> for application functionality
......
......@@ -4,6 +4,7 @@ wordpress_id: 254
wordpress_url: http://blog.gitlabhq.com/?p=254
date: 2012-03-09 18:52:26 +00:00
community: true
categories: GitLab news
---
We pushed to master new support util.
If you have some troubles with gitlab installation - try diagnostic tool.
......
......@@ -4,6 +4,7 @@ wordpress_id: 260
wordpress_url: http://blog.gitlabhq.com/?p=260
date: 2012-03-12 07:28:15 +00:00
community: true
categories: GitLab news
---
Now mysql is officially supported by gitlabhq.
Follow next steps to migrate to mysql
......
---
title: Gitlab 2.3 released
wordpress_id: 263
categories: releases
wordpress_url: http://blog.gitlabhq.com/?p=263
date: 2012-03-22 08:52:09 +00:00
community: true
......
......@@ -4,6 +4,7 @@ wordpress_id: 304
wordpress_url: http://blog.gitlabhq.com/?p=304
date: 2012-03-27 12:51:34 +00:00
community: true
categories: GitLab news
---
<p>We've started donation campaign to get support from our users. We are going to provide a better software for you with every new release. GitLab is open source project and now it needs your help.</p>
......
---
title: GitLab v2.4 released
wordpress_id: 336
categories: releases
wordpress_url: http://blog.gitlabhq.com/?p=336
date: 2012-04-22 15:26:36 +00:00
community: true
......
......@@ -4,6 +4,7 @@ wordpress_id: 353
wordpress_url: http://blog.gitlabhq.com/?p=353
date: 2012-05-19 10:10:38 +00:00
community: true
categories: releases
---
Hi!
......
......@@ -4,6 +4,7 @@ wordpress_id: 363
wordpress_url: http://blog.gitlabhq.com/?p=363
date: 2012-05-22 16:24:33 +00:00
community: true
categories: releases
---
Hi!
......
......@@ -4,6 +4,7 @@ wordpress_id: 401
wordpress_url: http://blog.gitlabhq.com/?p=401
date: 2012-06-01 18:04:23 +00:00
community: true
categories: GitLab news
---
Now You can move around the graph by using arrow keys (left and right).
......
......@@ -4,6 +4,7 @@ wordpress_id: 407
wordpress_url: http://blog.gitlabhq.com/?p=407
date: 2012-06-06 08:28:18 +00:00
community: true
categories: GitLab news
---
<p>We added some improvement to keep your repo cleaner. Now you can remove source branch with merge.
Just check "Remove source-branch" before accept MR. And source branch will be removed after successful merge </p>
......
---
title: "GITLAB Wallpaper"
date: 2012-06-20 11:43
categories:
categories: GitLab news
---
![Wallpaper](/images/gitlab.jpg)
---
title: GITLAB v2.6 released
wordpress_id: 419
categories: releases
wordpress_url: http://blog.gitlabhq.com/?p=419
date: 2012-06-22 04:00:57 +00:00
community: true
......
---
title: "GITLAB 2.7"
date: 2012-07-17 16:45
categories:
categories: releases
community: true
---
......
---
title: Initial announcement
tags: []
categories: GitLab news
status: publish
type: post
published: true
......
---
title: More than 500 people signed up
tags: []
categories: GitLab news
status: publish
type: post
published: true
......
---
title: Gitlab.io is now Gitlab.com
tags: []
categories: GitLab news
status: publish
type: post
published: true
......
---
title: Install Gitlab on AWS with a single script
tags: []
categories: GitLab news
status: publish
type: post
published: true
......
---
title: Welcome Marin
tags: []
categories: GitLab news
status: publish
type: post
published: true
......
---
title: Working on getting the first people online
tags: []
categories: engineering
status: publish
type: post
published: true
......
---
title: First 10 people got access
tags: []
categories: GitLab news
status: publish
type: post
published: true
......
---
title: "News from the front"
date: 2012-09-17 17:45
categories:
categories: releases
community: true
---
......
---
title: Next 100 people got access
tags: []
categories: GitLab news
status: publish
type: post
published: true
......
---
title: Gitlab improvements
tags: []
categories: GitLab news
status: publish
type: post
published: true
......
---
title: More invites send out
tags: []
categories: GitLab news
status: publish
type: post
published: true
......
......@@ -4,6 +4,7 @@ tags: []
status: publish
type: post
published: true
categories: GitLab news
meta:
_wpas_done_1532919: '1'
_publicize_done_external: a:1:{s:7:"twitter";a:1:{i:776273100;b:1;}}
......