From 295d6d79483589473bacd3f109dd7e23220fc483 Mon Sep 17 00:00:00 2001 From: Artur Trzop Date: Fri, 13 Dec 2024 12:59:33 +0100 Subject: [PATCH] [SEO 8.] Add canonical url to API docs, remove news category (#221) * Add canonical url to API docs * Remove news category from Jekyll --- _lib/tasks/api_doc.rake | 9 +++++++ ...4-welcome-to-knapsack-pro-documentation.md | 16 ------------- _posts/2099-01-31-example-article.md | 2 +- algolia.config.json | 1 - blog.html | 1 - continuous_integration.html | 1 - index.html | 1 - news.html | 24 ------------------- tech_tips.html | 1 - 9 files changed, 10 insertions(+), 46 deletions(-) delete mode 100644 _posts/2015-04-04-welcome-to-knapsack-pro-documentation.md delete mode 100644 news.html diff --git a/_lib/tasks/api_doc.rake b/_lib/tasks/api_doc.rake index f0f29fc5..449dc7cb 100644 --- a/_lib/tasks/api_doc.rake +++ b/_lib/tasks/api_doc.rake @@ -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 = [ @@ -20,6 +21,14 @@ namespace :api do Kernel.system(cmd) exitstatus = $?.exitstatus if exitstatus.zero? + html = File + .read(html_file) + .gsub('', <<~HEAD) + + 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}." diff --git a/_posts/2015-04-04-welcome-to-knapsack-pro-documentation.md b/_posts/2015-04-04-welcome-to-knapsack-pro-documentation.md deleted file mode 100644 index 1da3b6f0..00000000 --- a/_posts/2015-04-04-welcome-to-knapsack-pro-documentation.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -layout: post -title: "Welcome to KnapsackPro.com Documentation!" -categories: news -date: 2015-04-04 21:20:21 ---- - -If you want to help with this documentation you may want to take a look at the repository - -[{{ site.github_repository }}]({{ site.github_repository }}) - -{% highlight ruby %} -def hello(name) - puts "Hi, #{name}" -end -{% endhighlight %} diff --git a/_posts/2099-01-31-example-article.md b/_posts/2099-01-31-example-article.md index e6d84b9c..3af35526 100644 --- a/_posts/2099-01-31-example-article.md +++ b/_posts/2099-01-31-example-article.md @@ -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 --- diff --git a/algolia.config.json b/algolia.config.json index 69844a1e..0e19ff5e 100644 --- a/algolia.config.json +++ b/algolia.config.json @@ -17,7 +17,6 @@ "/blog", "/continuous_integration", "/tech_tips/", - "/news", "/api" ], "selectors": { diff --git a/blog.html b/blog.html index 2ff708af..64e352b2 100644 --- a/blog.html +++ b/blog.html @@ -12,7 +12,6 @@

Blog about testing & tech articles

Blog articles | Continuous Integration | Tech tips | - News