mitodl / ocw-hugo-themes

A Hugo theme for building OCW websites
BSD 3-Clause "New" or "Revised" License
5 stars 4 forks source link

feat: update shortcodes and partials for external-resource content #1298

Closed HussainTaj-arbisoft closed 8 months ago

HussainTaj-arbisoft commented 10 months ago

What are the relevant tickets?

Closes https://github.com/mitodl/hq/issues/3405

Description (What does it do?)

This PR:

We will keep the external_resource_link shortcode or resource_link changes. It depends on what we decide in https://github.com/mitodl/hq/issues/3416.

If a new UI element (CKEditor plugin) is to be created, we'll go with the external_resource_link shortcode, making things less complicated.

Screenshots (if appropriate):

https://github.com/mitodl/ocw-hugo-themes/assets/71316217/0bc23776-6cb3-4d4a-a14e-32cffa55ec3e

How can this be tested?

Prerequisites

Steps

  1. Grab this content.
  2. Place the content inside your ocw-content directory.
  3. Navigate to your ocw-hugo-themes directory.
  4. Switch to branch hussaintaj/3358-link-shortcode.
  5. Run
    yarn start course test90
  6. Open HTTP://localhost:3000/pages/page.
  7. Expect to see content similar to what is shown in the screen recording above.
  8. Expect all links to work as expected, except the one named "broken".
  9. Expect broken links to redirect you to the backup URL (see content md file for actual and backup URLs).

Additional Context

https://github.com/mitodl/hq/issues/3358

Checklist

Before merging this change:

github-actions[bot] commented 10 months ago

Netlify Deployments:
www: https://ocw-hugo-themes-www-pr-1298--ocw-next.netlify.app/
Course v2: https://ocw-hugo-themes-course-v2-pr-1298--ocw-next.netlify.app/

HussainTaj-arbisoft commented 8 months ago

@gumaerc this PR is ready for another look.

The most significant changes since you last saw this PR are:

Right now we're going with the default UI. There is a potential for a new UI in https://github.com/mitodl/hq/issues/3416 but no solid decision has been made yet. I haven't removed the new external_resource_link shortcode from this PR in anticipation of a new UI component, but let me know if you think we should remove it until it's needed.

I've added some new data for the tests. https://github.com/mitodl/ocw-studio/pull/2116 updates the fixtures. It would be great if you could look at that too.