feat: Add 'source_url' to news articles for original source attributi…
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_urlfrom 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).
- [x] Yes, I signed my commits.
🚀 Preview for commit a49201eb4ee21529bad458eaaa773cadf653534c at: https://6934720953d25512b3111772--layer5.netlify.app
@leecalcote , please review and give some feedback.
This is looking real good otherwise, @rishiraj38 👍
@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.
🚀 Preview for commit c9fc75ee05db80ab5a8cd7639a8b7f2aac840b02 at: https://6935782cc211bb3da70ebb7b--layer5.netlify.app
@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 🙂
🚀 Preview for commit b73e5c2d2ecb5fb6f613e54244ad878605a913de at: https://69367db053d25577e31116d2--layer5.netlify.app
@leecalcote ,please provide some feedback.
@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:
🚀 Preview for commit cd38790aa7c3e3625cf85d6b3dba1e1c18ec9e0e at: https://69370aec4fa46d596b5f4da7--layer5.netlify.app
@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
@Rajesh-Nagarajan-11 I don’t know what’s happening. The DCO is failing yet I’m making signed commits.
🚀 Preview for commit d6142868ca292e9a4aefe6b0305a56aaa327cb17 at: https://6937b4db9fe43cdf8c1e89c6--layer5.netlify.app
@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?
🚀 Preview for commit 585c3d91c66fa93480921ff06a5ca3e46426bad9 at: https://6937e3fdced81c3cc5450e85--layer5.netlify.app
@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?
🚀 Preview for commit 09c983107d1c56828cd909b9327d12fde523fa78 at: https://6944f0f5cae1f307d3938615--layer5.netlify.app