diff --git a/base-theme/layouts/partials/external_resource_link.html b/base-theme/layouts/partials/external_resource_link.html index 889a758d6..60802775b 100644 --- a/base-theme/layouts/partials/external_resource_link.html +++ b/base-theme/layouts/partials/external_resource_link.html @@ -1,7 +1,5 @@ {{- $text := default .title .text -}} {{- $href := default "" .external_url -}} -{{- $isBroken := default false .is_broken -}} -{{- $backupUrl := default "" .backup_url -}} {{- $hasWarning := default true .has_external_license_warning -}} {{- $className := printf "%s %s" "external-link" (default "" .class) -}} {{- $onClick := "" -}} @@ -10,9 +8,6 @@ {{/* Prevents external links from being clicked before corresponding JS is fully loaded. */}} {{- $onClick = "event.preventDefault()" -}} {{- end -}} -{{- if and $isBroken $backupUrl -}} - {{- $href = $backupUrl -}} -{{- end -}} {{- if not (in $href "ocw.mit.edu") -}} {{- partial "link" (dict "href" $href diff --git a/test-sites/ocw-ci-test-course/content/external-resources/broken-googlecom.md b/test-sites/ocw-ci-test-course/content/external-resources/broken-googlecom.md deleted file mode 100644 index 05fea8fdb..000000000 --- a/test-sites/ocw-ci-test-course/content/external-resources/broken-googlecom.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -backup_url: https://old.ocw.mit.edu -content_type: external-resource -external_url: https://ocw.mit.edu -has_external_license_warning: true -is_broken: true -license: https://creativecommons.org/licenses/by-nc-sa/4.0/ -title: OCW (backed by old site) -uid: 3ee0856f-f641-4d3f-9cdc-79714fff907d ---- diff --git a/tests-e2e/ocw-ci-test-course/external-resources.spec.ts b/tests-e2e/ocw-ci-test-course/external-resources.spec.ts index cc3e62273..429c8e385 100644 --- a/tests-e2e/ocw-ci-test-course/external-resources.spec.ts +++ b/tests-e2e/ocw-ci-test-course/external-resources.spec.ts @@ -59,21 +59,6 @@ test("External resource in page opens a new tab", async ({ page }) => { ) }) -test("Broken external resource opens backup_url", async ({ page }) => { - const course = new CoursePage(page, "course") - await course.goto("/pages/external-resources-page") - - const link = page.getByRole("link", { name: "broken external resource" }) - - const targetAttribute = await link.getAttribute("target") - expect(targetAttribute).toBeNull() - - const classAttribute = await link.getAttribute("class") - expect(classAttribute).toBeNull() - - await link.click() -}) - test("External resource opens confirmation modal", async ({ page }) => { const course = new CoursePage(page, "course") await course.goto("/pages/external-resources-page")