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

[SEO 8.] Add canonical url to API docs, remove news category #221

Merged
merged 6 commits into from
Dec 13, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions _lib/tasks/api_doc.rake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace :api do
task :generate_docs do
canonical_url = 'https://docs.knapsackpro.com/api/v1/'
raml2html = 'node_modules/raml2html/bin/raml2html'

raml_files = [
Expand All @@ -20,6 +21,14 @@ namespace :api do
Kernel.system(cmd)
exitstatus = $?.exitstatus
if exitstatus.zero?
html = File
.read(html_file)
.gsub('<head>', <<~HEAD)
<head><link rel="canonical" href="#{canonical_url}" />
HEAD

File.open(html_file, 'w') { |f| f.write(html) }

puts "Compilation done for #{file[:src]}. Generated the #{file[:dest]} file."
else
puts "Something failed during RAML to HTML compilation for #{raml_file}."
Expand Down
16 changes: 0 additions & 16 deletions _posts/2015-04-04-welcome-to-knapsack-pro-documentation.md

This file was deleted.

2 changes: 1 addition & 1 deletion _posts/2099-01-31-example-article.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: post
title: "Example article"
date: 2099-01-31 12:00:00 +0100
author: "Artur Trzop"
categories: techtips continuous_integration news
categories: techtips continuous_integration
og_image: "/images/blog/posts/example-article/image.jpg"
published: false
---
Expand Down
1 change: 0 additions & 1 deletion algolia.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"/blog",
"/continuous_integration",
"/tech_tips/",
"/news",
"/api"
],
"selectors": {
Expand Down
1 change: 0 additions & 1 deletion blog.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ <h1 class="post-title">Blog about testing & tech articles</h1>
<i class="fas fa-file-alt"></i> <b>Blog articles</b> |
<a href="{{ "/continuous_integration/" | prepend: site.baseurl }}"><i class="fas fa-cube"></i> <b>Continuous Integration</b></a> |
<a href="{{ "/tech_tips/" | prepend: site.baseurl }}"><i class="fas fa-lightbulb"></i> <b>Tech tips</b></a> |
<a href="{{ "/news/" | prepend: site.baseurl }}"><i class="fas fa-lightbulb"></i> <b>News</b></a>
</p>

<ul class="post-list">
Expand Down
1 change: 0 additions & 1 deletion continuous_integration.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ <h1 class="post-title">Continuous Integration</h1>
<a href="{{ "/blog/" | prepend: site.baseurl }}"><i class="fas fa-file-alt"></i> <b>Blog articles</b></a> |
<i class="fas fa-cube"></i> <b>Continuous Integration</b> |
<a href="{{ "/tech_tips/" | prepend: site.baseurl }}"><i class="fas fa-lightbulb"></i> <b>Tech tips</b></a> |
<a href="{{ "/news/" | prepend: site.baseurl }}"><i class="fas fa-lightbulb"></i> <b>News</b></a>
</p>

<ul class="post-list">
Expand Down
1 change: 0 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ <h1 class="post-title">Blog about testing & tech articles</h1>
<i class="fas fa-file-alt"></i> <b>Blog articles</b> |
<a href="{{ "/continuous_integration/" | prepend: site.baseurl }}"><i class="fas fa-cube"></i> <b>Continuous Integration</b></a> |
<a href="{{ "/tech_tips/" | prepend: site.baseurl }}"><i class="fas fa-lightbulb"></i> <b>Tech tips</b></a> |
<a href="{{ "/news/" | prepend: site.baseurl }}"><i class="fas fa-lightbulb"></i> <b>News</b></a>
</p>

<ul class="post-list">
Expand Down
24 changes: 0 additions & 24 deletions news.html

This file was deleted.

1 change: 0 additions & 1 deletion tech_tips.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ <h1 class="post-title">Tech tips</h1>
<a href="{{ "/blog/" | prepend: site.baseurl }}"><i class="fas fa-file-alt"></i> <b>Blog articles</b></a> |
<a href="{{ "/continuous_integration/" | prepend: site.baseurl }}"><i class="fas fa-cube"></i> <b>Continuous Integration</b></a> |
<i class="fas fa-lightbulb"></i> <b>Tech tips</b> |
<a href="{{ "/news/" | prepend: site.baseurl }}"><i class="fas fa-lightbulb"></i> <b>News</b></a>
</p>

<ul class="post-list">
Expand Down
Loading