Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Redirect MFTF v2 and 404
Browse files Browse the repository at this point in the history
  • Loading branch information
dshevtsov committed Oct 13, 2023
1 parent 47e3431 commit 4c60351
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Docfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ content_map:
filter: true
-
directory: src/mftf/v2
repository: magento/magento2-functional-testing-framework
repository: commerce-docs/magento2-functional-testing-framework-public
branch: 2.x-develop
filter: true
-
Expand Down
30 changes: 30 additions & 0 deletions _plugins/page-params/redirect_mftf_v2.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 2023 Adobe
# All Rights Reserved.
#
# NOTICE: All information contained herein is, and remains
# the property of Adobe and its suppliers, if any. The intellectual
# and technical concepts contained herein are proprietary to Adobe
# and its suppliers and are protected by all applicable intellectual
# property laws, including trade secret and copyright laws.
# Dissemination of this information or reproduction of this material
# is strictly forbidden

# This plugin redirects 2.3 pages to the DevSite.
# It uses redirect metadata from the 2.4 version of the page.
# If there is no 2.4 version of the page, then it redirects to https://developer.adobe.com/commerce/docs/

# frozen_string_literal: true

Jekyll::Hooks.register :site, :post_read do |site|
pages = site.pages

pages.each do |page|
# Skip pages where the parameter is already set
next unless page.path.start_with? 'mftf/v2'

# Process only files with 'md' and 'html' extensions
next unless File.extname(page.path).match?(/md/)

page.data['redirect_to'] = "https://github.com/magento/magento2-functional-testing-framework/blob/2.x-develop/#{page.path.delete_prefix('mftf/v2/')}"
end
end
1 change: 1 addition & 0 deletions src/404.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
layout: full-width
title: Page Not Found
permalink: /404.html
redirect_to: https://developer.adobe.com/commerce/docs/
---

## Sorry!
Expand Down

0 comments on commit 4c60351

Please sign in to comment.