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

Commit

Permalink
Merge pull request #3247 from commerce-docs/ds_redirects
Browse files Browse the repository at this point in the history
Redirect MFTF v2 and 404
  • Loading branch information
dshevtsov authored Oct 16, 2023
2 parents 47e3431 + ff9e865 commit 2fb67d1
Show file tree
Hide file tree
Showing 3 changed files with 30 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
28 changes: 28 additions & 0 deletions _plugins/page-params/redirect_mftf_v2.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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 MFTF v2 pages to the MFTF repo.

# 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 2fb67d1

Please sign in to comment.