Skip to content

Commit

Permalink
Merge pull request #29 from rocky-linux/feature/27-bug-missing-tradem…
Browse files Browse the repository at this point in the history
…ark-guidelines

Add redirect for /trademark to /legal/trademarks
  • Loading branch information
NebraskaCoder authored May 3, 2024
2 parents fc93811 + 230902a commit 1274743
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
10 changes: 9 additions & 1 deletion e2e/Redirects.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import { test } from "@playwright/test";
import { expectDownloadPage } from "./utils/PageUtils";
import {
expectDownloadPage,
expectTrademarkUsagePage,
} from "./utils/PageUtils";

test.describe("Website Redirects", () => {
test("redirects old /cloud-images to /download", async ({ page }) => {
await page.goto("/cloud-images");

await expectDownloadPage(page);
});
test("redirects old /trademark to /legal/trademarks", async ({ page }) => {
await page.goto("/trademark");

await expectTrademarkUsagePage(page);
});
});
5 changes: 5 additions & 0 deletions e2e/utils/PageUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ export const expectDownloadPage = async (page: Page) => {
await expect(page).toHaveURL(/\/download/);
await expect(page).toHaveTitle(/Download - Rocky Linux/);
};

export const expectTrademarkUsagePage = async (page: Page) => {
await expect(page).toHaveURL(/\/legal\/trademarks/);
await expect(page).toHaveTitle(/Trademark Usage - Rocky Linux/);
};
14 changes: 13 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ const withNextIntl = require("next-intl/plugin")("./i18n.ts");
/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
domains: ["www.rockylinux.org", "rockylinux.org"],
remotePatterns: [
{
hostname: "www.rockylinux.org",
},
{
hostname: "rockylinux.org",
},
],
},
async redirects() {
return [
Expand All @@ -12,6 +19,11 @@ const nextConfig = {
destination: "/download",
permanent: true,
},
{
source: "/trademark",
destination: "/legal/trademarks",
permanent: true,
},
];
},
};
Expand Down

0 comments on commit 1274743

Please sign in to comment.