From fda2a02ed96093306884b3a3b3517fb21b18e2cd Mon Sep 17 00:00:00 2001 From: Artur Trzop Date: Wed, 11 Dec 2024 20:07:27 +0100 Subject: [PATCH 1/6] Add canonical url to API docs --- _lib/tasks/api_doc.rake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/_lib/tasks/api_doc.rake b/_lib/tasks/api_doc.rake index f0f29fc5..3164c83a 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,12 @@ namespace :api do Kernel.system(cmd) exitstatus = $?.exitstatus if exitstatus.zero? + html_contents = File.read(html_file) + html_contents.gsub!('', '') + File.open(html_file, 'w') do |f| + f.write(html_contents) + end + puts "Compilation done for #{file[:src]}. Generated the #{file[:dest]} file." else puts "Something failed during RAML to HTML compilation for #{raml_file}." From 77952611b8ebf891f5d24ce4ae255197d4cf3f80 Mon Sep 17 00:00:00 2001 From: Artur Trzop Date: Fri, 13 Dec 2024 12:47:41 +0100 Subject: [PATCH 2/6] refactor: adding canonical to api --- _lib/tasks/api_doc.rake | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/_lib/tasks/api_doc.rake b/_lib/tasks/api_doc.rake index 3164c83a..449dc7cb 100644 --- a/_lib/tasks/api_doc.rake +++ b/_lib/tasks/api_doc.rake @@ -21,11 +21,13 @@ namespace :api do Kernel.system(cmd) exitstatus = $?.exitstatus if exitstatus.zero? - html_contents = File.read(html_file) - html_contents.gsub!('', '') - File.open(html_file, 'w') do |f| - f.write(html_contents) - end + 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 From dacf5ab6b529843bf99980475be86282b2962349 Mon Sep 17 00:00:00 2001 From: Artur Trzop Date: Fri, 13 Dec 2024 12:51:03 +0100 Subject: [PATCH 3/6] Delete 2015-04-04-welcome-to-knapsack-pro-documentation.md --- ...4-04-welcome-to-knapsack-pro-documentation.md | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 _posts/2015-04-04-welcome-to-knapsack-pro-documentation.md 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 %} From 79fc6a101df5dab730c280b0ed5a70bc746a283a Mon Sep 17 00:00:00 2001 From: Artur Trzop Date: Fri, 13 Dec 2024 12:53:19 +0100 Subject: [PATCH 4/6] Remove news category from Jekyll --- blog.html | 1 - continuous_integration.html | 1 - index.html | 1 - news.html | 24 ------------------------ tech_tips.html | 1 - 5 files changed, 28 deletions(-) delete mode 100644 news.html 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

    diff --git a/continuous_integration.html b/continuous_integration.html index da75940d..3436da46 100644 --- a/continuous_integration.html +++ b/continuous_integration.html @@ -12,7 +12,6 @@

    Continuous Integration

    Blog articles | Continuous Integration | Tech tips | - News

      diff --git a/index.html b/index.html index 8e71c561..24e521ea 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,6 @@

      Blog about testing & tech articles

      Blog articles | Continuous Integration | Tech tips | - News

        diff --git a/news.html b/news.html deleted file mode 100644 index 81986741..00000000 --- a/news.html +++ /dev/null @@ -1,24 +0,0 @@ ---- -layout: default -title: News | Knapsack Pro -permalink: /news/ ---- - -

        News

        - -

        subscribe via RSS

        - -

        - Blog articles | - Continuous Integration | - Tech tips | - News -

        - -
          - {% for post in site.posts %} - {% if post.categories contains "news" %} - {% include post_trailer.html post=post %} - {% endif %} - {% endfor %} -
        diff --git a/tech_tips.html b/tech_tips.html index 88d07a92..7e7b74d9 100644 --- a/tech_tips.html +++ b/tech_tips.html @@ -12,7 +12,6 @@

        Tech tips

        Blog articles | Continuous Integration | Tech tips | - News

          From f34769df6e19dc96f5f88c13480e4c7f650fcc97 Mon Sep 17 00:00:00 2001 From: Artur Trzop Date: Fri, 13 Dec 2024 12:56:01 +0100 Subject: [PATCH 5/6] remove news category from the example article --- _posts/2099-01-31-example-article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 --- From a19f9c5de75426692f71d74c43f275522a6a30ab Mon Sep 17 00:00:00 2001 From: Artur Trzop Date: Fri, 13 Dec 2024 12:56:08 +0100 Subject: [PATCH 6/6] Update algolia.config.json remove news url --- algolia.config.json | 1 - 1 file changed, 1 deletion(-) 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": {