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

Commit 4c60351

Browse files
committed
Redirect MFTF v2 and 404
1 parent 47e3431 commit 4c60351

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

Docfile.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ content_map:
1212
filter: true
1313
-
1414
directory: src/mftf/v2
15-
repository: magento/magento2-functional-testing-framework
15+
repository: commerce-docs/magento2-functional-testing-framework-public
1616
branch: 2.x-develop
1717
filter: true
1818
-
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright 2023 Adobe
2+
# All Rights Reserved.
3+
#
4+
# NOTICE: All information contained herein is, and remains
5+
# the property of Adobe and its suppliers, if any. The intellectual
6+
# and technical concepts contained herein are proprietary to Adobe
7+
# and its suppliers and are protected by all applicable intellectual
8+
# property laws, including trade secret and copyright laws.
9+
# Dissemination of this information or reproduction of this material
10+
# is strictly forbidden
11+
12+
# This plugin redirects 2.3 pages to the DevSite.
13+
# It uses redirect metadata from the 2.4 version of the page.
14+
# If there is no 2.4 version of the page, then it redirects to https://developer.adobe.com/commerce/docs/
15+
16+
# frozen_string_literal: true
17+
18+
Jekyll::Hooks.register :site, :post_read do |site|
19+
pages = site.pages
20+
21+
pages.each do |page|
22+
# Skip pages where the parameter is already set
23+
next unless page.path.start_with? 'mftf/v2'
24+
25+
# Process only files with 'md' and 'html' extensions
26+
next unless File.extname(page.path).match?(/md/)
27+
28+
page.data['redirect_to'] = "https://github.com/magento/magento2-functional-testing-framework/blob/2.x-develop/#{page.path.delete_prefix('mftf/v2/')}"
29+
end
30+
end

src/404.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
layout: full-width
33
title: Page Not Found
44
permalink: /404.html
5+
redirect_to: https://developer.adobe.com/commerce/docs/
56
---
67

78
## Sorry!

0 commit comments

Comments
 (0)