layer5 icon indicating copy to clipboard operation
layer5 copied to clipboard

feat: Add 'source_url' to news articles for original source attributi…

Open rishiraj38 opened this issue 2 weeks ago • 16 comments

Description This PR adds an optional source_url field to the news article data model. This allows reprinted news articles to properly attribute and link back to the original source.

Changes included:

  • Updated src/templates/news-single.js to retrieve source_url from frontmatter.
  • Updated src/sections/Company/News-single/index.js to conditionally display an "Originally published at [URL]" link when the field is present.
  • Updated the news issue template (.github/ISSUE_TEMPLATE/news.md) and the content template (index.mdx) to include this new field.
  • Updated CONTRIBUTING.md with usage instructions.
  • Added a unit test source_url.test.js to verify the rendering logic.

This fixes #7135.

Requirements

  • [x] Add an optional field to the news article data model (e.g., source_url).
  • [x] Update the news collection/template to read the new field.
  • [x] When the field is present, display a visible link on the article page with the text: "Originally published at [Source Name or URL]".
  • [x] The link should open in a new tab.
  • [x] The feature must be optional and not affect articles that do not provide a source URL.
  • [x] Include a short unit or visual test to verify the link is rendered only when the field exists.

Suggested tasks

  • [x] Update news schema/frontmatter to include optional source_url.
  • [x] Modify the news article template to conditionally render the attribution link (graphql).
  • [x] Add or update one news item as an example to demonstrate the behavior.
  • [x] Update the news_template.md to include an example and comment explaining the property.
  • [x] Add a short note in CONTRIBUTING.md or the newsroom author guide about the new field and how to use it.

Acceptance criteria

  • [x] news.md issue template has been updated.
  • [x] Existing news pages with no source field remain unchanged.
  • [x] A news page with original_url shows a single, clearly labeled "Originally published at" link that opens in a new tab.
  • [x] The code change is documented in CONTRIBUTING or the content guide (where news authoring is described).

Notes for Reviewers You can verify this by checking any news article that has the source_url field added to its frontmatter (none are added in this PR to keep it valid for existing content, but the template is updated for future use).

Signed commits

  • [x] Yes, I signed my commits.

rishiraj38 avatar Dec 06 '25 17:12 rishiraj38

🚀 Preview for commit a49201eb4ee21529bad458eaaa773cadf653534c at: https://6934720953d25512b3111772--layer5.netlify.app

l5io avatar Dec 06 '25 18:12 l5io

@leecalcote , please review and give some feedback.

rishiraj38 avatar Dec 06 '25 18:12 rishiraj38

This is looking real good otherwise, @rishiraj38 👍

leecalcote avatar Dec 06 '25 20:12 leecalcote

@leecalcote Yes, source_url is fully optional. If it's not present , the UI simply doesn't render the "Originally published at" link, and the build remains unaffected.

rishiraj38 avatar Dec 07 '25 06:12 rishiraj38

🚀 Preview for commit c9fc75ee05db80ab5a8cd7639a8b7f2aac840b02 at: https://6935782cc211bb3da70ebb7b--layer5.netlify.app

l5io avatar Dec 07 '25 12:12 l5io

@rishiraj38 Thank you for your contribution! Let's discuss this during the website call tomorrow at 6:30 PM IST | 8 AM CT Add it as an agenda item to the meeting minutes, if you would 🙂

Fireentity avatar Dec 07 '25 14:12 Fireentity

🚀 Preview for commit b73e5c2d2ecb5fb6f613e54244ad878605a913de at: https://69367db053d25577e31116d2--layer5.netlify.app

l5io avatar Dec 08 '25 07:12 l5io

@leecalcote ,please provide some feedback.

rishiraj38 avatar Dec 08 '25 08:12 rishiraj38

@rishiraj38 Thank you for your contribution! Let's discuss this during the website call today at 6:30 PM IST | 8 AM CT Add it as an agenda item to the meeting minutes, if you would :slightly_smiling_face:

kishore08-07 avatar Dec 08 '25 10:12 kishore08-07

🚀 Preview for commit cd38790aa7c3e3625cf85d6b3dba1e1c18ec9e0e at: https://69370aec4fa46d596b5f4da7--layer5.netlify.app

l5io avatar Dec 08 '25 17:12 l5io

@leecalcote ,please provide some feedback.

Best that you describe what changes you've made, so that I'm aware of what, specifically, you're looking for feedback on, @rishiraj38

leecalcote avatar Dec 08 '25 22:12 leecalcote

@Rajesh-Nagarajan-11 I don’t know what’s happening. The DCO is failing yet I’m making signed commits.

rishiraj38 avatar Dec 09 '25 05:12 rishiraj38

🚀 Preview for commit d6142868ca292e9a4aefe6b0305a56aaa327cb17 at: https://6937b4db9fe43cdf8c1e89c6--layer5.netlify.app

l5io avatar Dec 09 '25 05:12 l5io

@leecalcote , I’ve added the source URL to the news article that contained an eurl. Now, what do I do with the news articles that don’t have eurl?

rishiraj38 avatar Dec 09 '25 08:12 rishiraj38

🚀 Preview for commit 585c3d91c66fa93480921ff06a5ca3e46426bad9 at: https://6937e3fdced81c3cc5450e85--layer5.netlify.app

l5io avatar Dec 09 '25 08:12 l5io

@leecalcote please review, I’ve added the source URL to the news article that contained an eurl. Now, what do I do with the news articles that don’t have eurl?

rishiraj38 avatar Dec 12 '25 13:12 rishiraj38

🚀 Preview for commit 09c983107d1c56828cd909b9327d12fde523fa78 at: https://6944f0f5cae1f307d3938615--layer5.netlify.app

l5io avatar Dec 19 '25 06:12 l5io