Skip to content

Link to the RSS/atom feed from the versions page. #8709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion app/lib/frontend/templates/package_versions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import 'package:_pub_shared/data/package_api.dart';
import 'package:collection/collection.dart' show IterableExtension;
import 'package:pub_dev/frontend/static_files.dart';
import 'package:pub_semver/pub_semver.dart';

import '../../package/model_properties.dart';
Expand Down Expand Up @@ -58,7 +59,34 @@ String renderPkgVersionsPage(
}
}

final blocks = <d.Node>[];
final blocks = <d.Node>[
d.p(classes: [
'versions-rss-wrapper',
], children: [
d.img(
classes: ['filter-invert-on-dark', 'versions-rss-image'],
image: d.Image(
src: staticUrls.getAssetUrl('/static/img/rss-feed-icon-4a4a4a.svg'),
alt: 'Versions feed',
width: 32,
height: 32,
),
),
d.span(
classes: ['versions-rss-text'],
children: [
d.text(
'Looking to receive notifications when a new version is published? '
'Subscribe to the package\'s '),
d.a(
href: urls.pkgFeedUrl(data.package.name!),
children: [d.text(' versions feed')],
),
d.text(' with your feed reader.'),
],
),
]),
];
if (stableVersionRows.isNotEmpty &&
prereleaseVersionRows.isNotEmpty &&
latestPrereleaseVersion != null) {
Expand Down
8 changes: 8 additions & 0 deletions app/test/frontend/golden/pkg_versions_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,14 @@ <h3 class="detail-lead-title">Metadata</h3>
<div class="detail-container detail-body-main">
<div class="detail-tabs-content">
<section class="tab-content detail-tab-versions-content -active">
<p class="versions-rss-wrapper">
<img class="filter-invert-on-dark versions-rss-image" src="/static/hash-%%etag%%/img/rss-feed-icon-4a4a4a.svg" alt="Versions feed" width="32" height="32"/>
<span class="versions-rss-text">
Looking to receive notifications when a new version is published? Subscribe to the package's
<a href="/api/packages/oxygen/feed.atom">versions feed</a>
with your feed reader.
</span>
</p>
<p>
The latest prerelease was
<a href="#prerelease">2.0.0-dev</a>
Expand Down
8 changes: 8 additions & 0 deletions app/test/task/testdata/goldens/packages/oxygen/versions.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,14 @@ <h3 class="detail-lead-title">Metadata</h3>
<div class="detail-container detail-body-main">
<div class="detail-tabs-content">
<section class="tab-content detail-tab-versions-content -active">
<p class="versions-rss-wrapper">
<img class="filter-invert-on-dark versions-rss-image" src="/static/hash-%%etag%%/img/rss-feed-icon-4a4a4a.svg" alt="Versions feed" width="32" height="32"/>
<span class="versions-rss-text">
Looking to receive notifications when a new version is published? Subscribe to the package's
<a href="/api/packages/oxygen/feed.atom">versions feed</a>
with your feed reader.
</span>
</p>
<h2 id="stable">Stable versions of oxygen</h2>
<table class="version-table" data-package="oxygen">
<thead>
Expand Down
14 changes: 14 additions & 0 deletions pkg/web_css/lib/src/_pkg.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,20 @@
margin-right: 3px;
}

.versions-rss-wrapper {
display: flex;

.versions-rss-image {
display: inline-block;
margin-right: 12px;
}

.versions-rss-text {
display: inline-block;
text-wrap-style: balance;
}
}

.version-table {
width: 100%;
border-spacing: 0;
Expand Down
1 change: 1 addition & 0 deletions static/img/rss-feed-icon-4a4a4a.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.