Skip to content
Snippets Groups Projects
Verified Commit ed419863 authored by Achilleas Pipinellis's avatar Achilleas Pipinellis
Browse files

Add lint checker for blog posts categories

parent e92c09b9
No related branches found
No related tags found
No related merge requests found
Showing
with 73 additions and 7 deletions
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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')
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
@@ -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.
Loading
Loading
Loading
Loading
@@ -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>
Loading
Loading
Loading
Loading
@@ -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>
 
Loading
Loading
Loading
Loading
@@ -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>
Loading
Loading
@@ -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>
Loading
Loading
@@ -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>
Loading
Loading
@@ -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>
Loading
Loading
---
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
Loading
Loading
Loading
Loading
@@ -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>
Loading
Loading
Loading
Loading
@@ -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>
 
Loading
Loading
Loading
Loading
@@ -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>
Loading
Loading
@@ -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>
Loading
Loading
@@ -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>
Loading
Loading
Loading
Loading
@@ -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>
Loading
Loading
@@ -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>
 
Loading
Loading
Loading
Loading
@@ -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>
Loading
Loading
Loading
Loading
@@ -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>
Loading
Loading
Loading
Loading
@@ -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.
 
Loading
Loading
Loading
Loading
@@ -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.
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment