From bbd9f03f6e56ab268eba6e612d16d15892507132 Mon Sep 17 00:00:00 2001 From: Vanessa Yuen <6842965+vanessayuenn@users.noreply.github.com> Date: Thu, 8 Apr 2021 22:51:37 +0200 Subject: [PATCH] Populate product-landing "What's new" section using GitHub Changelog (#18328) Co-authored-by: Jason Etcovitch Co-authored-by: Rachael Sewell Co-authored-by: Sarah Schneider --- content/README.md | 8 +- content/actions/index.md | 13 +-- content/discussions/index.md | 2 + content/education/index.md | 15 +-- content/packages/index.md | 11 +- layouts/product-landing.html | 6 +- lib/changelog.js | 42 +++++++ lib/frontmatter.js | 12 +- .../contextualizers/whats-new-changelog.js | 13 +++ middleware/index.js | 1 + package-lock.json | 23 +++- package.json | 1 + stylesheets/type.scss | 4 - tests/fixtures/rss-feed.xml | 103 ++++++++++++++++++ tests/unit/get-rss-feeds.js | 46 ++++++++ translations/de-DE/content/actions/index.md | 14 +-- .../de-DE/content/discussions/index.md | 2 + translations/de-DE/content/education/index.md | 17 +-- translations/de-DE/content/packages/index.md | 14 +-- translations/es-ES/content/actions/index.md | 11 +- .../es-ES/content/discussions/index.md | 2 + translations/es-ES/content/education/index.md | 13 +-- translations/es-ES/content/packages/index.md | 11 +- translations/ja-JP/content/actions/index.md | 14 +-- .../ja-JP/content/discussions/index.md | 2 + translations/ja-JP/content/education/index.md | 17 +-- translations/ja-JP/content/packages/index.md | 14 +-- translations/ko-KR/content/actions/index.md | 14 +-- .../ko-KR/content/discussions/index.md | 2 + translations/ko-KR/content/education/index.md | 17 +-- translations/ko-KR/content/packages/index.md | 14 +-- translations/pt-BR/content/actions/index.md | 14 +-- .../pt-BR/content/discussions/index.md | 2 + translations/pt-BR/content/education/index.md | 13 +-- translations/pt-BR/content/packages/index.md | 11 +- translations/ru-RU/content/actions/index.md | 14 +-- .../ru-RU/content/discussions/index.md | 2 + translations/ru-RU/content/education/index.md | 17 +-- translations/ru-RU/content/packages/index.md | 14 +-- translations/zh-CN/content/actions/index.md | 14 +-- .../zh-CN/content/discussions/index.md | 2 + translations/zh-CN/content/education/index.md | 17 +-- translations/zh-CN/content/packages/index.md | 14 +-- 43 files changed, 292 insertions(+), 320 deletions(-) create mode 100644 lib/changelog.js create mode 100644 middleware/contextualizers/whats-new-changelog.js create mode 100644 tests/fixtures/rss-feed.xml create mode 100644 tests/unit/get-rss-feeds.js diff --git a/content/README.md b/content/README.md index 45b571c32317..ca4ad5debde0 100644 --- a/content/README.md +++ b/content/README.md @@ -184,8 +184,10 @@ featuredLinks: ### `changelog` -- Purpose: Render a list of changelog items with timestamps on product pages (ex: `layouts/product-landing.html`) -- Type: `Array`, items are objects `{ href: string, title: string, date: 'YYYY-MM-DD' }` +- Purpose: Render a list of items pulled from [GitHub Changelog](https://github.blog/changelog/) on product landing pages (ex: `layouts/product-landing.html`). The one exception is Education, which pulls from https://github.blog/category/community/education. +- Type: `Object`, properties: + - `label` -- must be present and corresponds to the labels used in the [GitHub Changelog](https://github.blog/changelog/) + - `prefix` -- optional string that starts each changelog title that should be omitted in the docs feed. For example, with the prefix `GitHub Actions: ` specified, changelog titles like `GitHub Actions: Some Title Here` will render as `Some Title Here` in the docs feed). - Optional. ### `defaultPlatform` @@ -223,7 +225,7 @@ includeGuides: ``` ### `type` -- Purpose: Indicate the type of article. +- Purpose: Indicate the type of article. - Type: `String`, one of the `overview`, `quick_start`, `tutorial`, `how_to`, `reference`. - Optional. diff --git a/content/actions/index.md b/content/actions/index.md index 48ff80ce2c95..d32dfec985e6 100644 --- a/content/actions/index.md +++ b/content/actions/index.md @@ -22,18 +22,9 @@ featuredLinks: - /actions/reference/environment-variables - /actions/reference/encrypted-secrets changelog: - - title: Environments, environment protection rules and environment secrets (beta) - date: '2020-12-15' - href: https://github.blog/changelog/2020-12-15-github-actions-environments-environment-protection-rules-and-environment-secrets-beta/ - - title: Workflow visualization - date: '2020-12-08' - href: https://github.blog/changelog/2020-12-08-github-actions-workflow-visualization/ - - title: Removing set-env and add-path commands on November 16 - date: '2020-11-09' - href: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/ - + label: 'actions' + prefix: 'GitHub Actions: ' product_video: https://www.youtube-nocookie.com/embed/cP0I9w2coGU - redirect_from: - /articles/automating-your-workflow-with-github-actions/ - /articles/customizing-your-project-with-github-actions/ diff --git a/content/discussions/index.md b/content/discussions/index.md index 84d965fd4ae4..9974eb20a236 100644 --- a/content/discussions/index.md +++ b/content/discussions/index.md @@ -22,6 +22,8 @@ featuredLinks: - /discussions/guides/finding-discussions-across-multiple-repositories - /discussions/collaborating-with-your-community-using-discussions/collaborating-with-maintainers-using-discussions - /discussions/managing-discussions-for-your-community/managing-categories-for-discussions-in-your-repository +changelog: + label: 'discussions' product_video: https://www.youtube-nocookie.com/embed/IpBw2SJkFyk layout: product-landing versions: diff --git a/content/education/index.md b/content/education/index.md index 44ffabc2e0d6..abd70e5dc199 100644 --- a/content/education/index.md +++ b/content/education/index.md @@ -19,21 +19,8 @@ featuredLinks: - /desktop - /github/getting-started-with-github/github-cli - /education/manage-coursework-with-github-classroom/teach-with-github-classroom - changelog: - - title: 'Try something new at Local Hack Day: Learn' - date: '2020-10-15' - href: https://github.blog/2020-10-15-try-something-new-at-local-hack-day-learn/ - - title: 'Remote Education: Creating community through shared experiences' - date: '2020-09-24' - href: https://github.blog/2020-09-24-remote-education-creating-community-through-shared-experiences/ - - title: 'Remote Education: A series of best practices for online campus communities' - date: '2020-09-10' - href: https://github.blog/2020-09-10-remote-education-a-series-of-best-practices-for-online-campus-communities/ - - title: Welcome to the inaugural class of MLH Fellows - date: '2020-06-24' - href: https://github.blog/2020-06-24-welcome-to-the-inaugural-class-of-mlh-fellows/ - + label: 'education' layout: product-landing versions: free-pro-team: '*' diff --git a/content/packages/index.md b/content/packages/index.md index 14afebfca805..56deb1e54872 100644 --- a/content/packages/index.md +++ b/content/packages/index.md @@ -20,15 +20,8 @@ featuredLinks: - /packages/guides/enabling-improved-container-support - /packages/guides/configuring-rubygems-for-use-with-github-packages changelog: - - title: ghcr.io maintenance mode on 2021-01-09 - date: '2021-01-08' - href: https://github.blog/changelog/2021-01-08-packages-ghcr-io-maintenance-mode-on-2021-01-09/ - - title: ghcr.io container names redirect to the container page - date: '2020-12-14' - href: https://github.blog/changelog/2020-12-14-ghcr-io-container-names-redirect-to-the-container-page/ - - title: Filter for tagged and untagged containers - date: '2020-12-14' - href: https://github.blog/changelog/2020-12-14-packages-can-filter-for-tagged-and-untagged-containers/ + label: 'packages' + prefix: 'Packages: ' redirect_from: - /github/managing-packages-with-github-packages - /categories/managing-packages-with-github-package-registry diff --git a/layouts/product-landing.html b/layouts/product-landing.html index d876231a4779..5cd7f12c2025 100644 --- a/layouts/product-landing.html +++ b/layouts/product-landing.html @@ -98,12 +98,12 @@