Skip to content

Commit b4cf93d

Browse files
authored
Expose versions list atom feed URL in the package page <head> element. (#8720)
1 parent f1f082c commit b4cf93d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+93
-50
lines changed

app/lib/frontend/templates/layout.dart

+6
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ String renderLayoutPage(
5151
/// The canonical content link that will be put in the header.
5252
/// https://support.google.com/webmasters/answer/139066?hl=en
5353
String? canonicalUrl,
54+
55+
/// The URL for the package versions feed.
56+
String? versionsFeedUrl,
57+
String? versionsFeedTitle,
5458
SearchForm? searchForm,
5559
bool noIndex = false,
5660
PageData? pageData,
@@ -120,6 +124,8 @@ String renderLayoutPage(
120124
schemaOrgSearchActionJson: isRoot ? _schemaOrgSearchAction : null,
121125
moderationUrl: moderationUrl,
122126
moderationSubject: moderationSubject,
127+
versionsFeedUrl: versionsFeedUrl,
128+
versionsFeedTitle: versionsFeedTitle,
123129
).toString();
124130
}
125131

app/lib/frontend/templates/package.dart

+3
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,9 @@ String _renderPkgPage({
290290
data.version,
291291
editable: pkgPageTab == urls.PkgPageTab.admin,
292292
),
293+
versionsFeedUrl: urls.pkgFeedUrl(data.package.name!),
294+
versionsFeedTitle:
295+
'Recently published versions of package ${data.package.name!} on pub.dev',
293296
);
294297
}
295298

app/lib/frontend/templates/views/shared/layout.dart

+10-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ d.Node pageLayoutNode({
3030
required Map<String, dynamic>? schemaOrgSearchActionJson,
3131
required String? moderationUrl,
3232
required ModerationSubject? moderationSubject,
33+
required String? versionsFeedUrl,
34+
required String? versionsFeedTitle,
3335
}) {
3436
final appleTouchIconUrl = faviconUrl.endsWith('.png')
3537
? faviconUrl
@@ -112,9 +114,16 @@ d.Node pageLayoutNode({
112114
d.link(
113115
rel: 'alternate',
114116
type: 'application/atom+xml',
115-
title: 'Updated Packages Feed for Pub',
117+
title: 'Recently published packages on pub.dev',
116118
href: '/feed.atom',
117119
),
120+
if (versionsFeedUrl != null && versionsFeedTitle != null)
121+
d.link(
122+
rel: 'alternate',
123+
type: 'application/atom+xml',
124+
title: versionsFeedTitle,
125+
href: versionsFeedUrl,
126+
),
118127
d.link(
119128
rel: 'stylesheet',
120129
type: 'text/css',

app/test/frontend/golden/authorized_page.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<link rel="stylesheet" href="https://www.gstatic.com/glue/v25_0/ccb.min.css"/>
2525
<link rel="search" type="application/opensearchdescription+xml" title="Dart packages" href="/osd.xml"/>
2626
<meta name="description" content="Pub is the package manager for the Dart programming language, containing reusable libraries &amp; packages for Flutter and general Dart programs."/>
27-
<link rel="alternate" type="application/atom+xml" title="Updated Packages Feed for Pub" href="/feed.atom"/>
27+
<link rel="alternate" type="application/atom+xml" title="Recently published packages on pub.dev" href="/feed.atom"/>
2828
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/material/bundle/styles.css"/>
2929
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/css/style.css"/>
3030
<script src="/static/hash-%%etag%%/material/bundle/script.min.js" defer="defer"></script>

app/test/frontend/golden/consent_page.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<link rel="stylesheet" href="https://www.gstatic.com/glue/v25_0/ccb.min.css"/>
2525
<link rel="search" type="application/opensearchdescription+xml" title="Dart packages" href="/osd.xml"/>
2626
<meta name="description" content="Pub is the package manager for the Dart programming language, containing reusable libraries &amp; packages for Flutter and general Dart programs."/>
27-
<link rel="alternate" type="application/atom+xml" title="Updated Packages Feed for Pub" href="/feed.atom"/>
27+
<link rel="alternate" type="application/atom+xml" title="Recently published packages on pub.dev" href="/feed.atom"/>
2828
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/material/bundle/styles.css"/>
2929
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/css/style.css"/>
3030
<script src="/static/hash-%%etag%%/material/bundle/script.min.js" defer="defer"></script>

app/test/frontend/golden/create_publisher_page.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<link rel="stylesheet" href="https://www.gstatic.com/glue/v25_0/ccb.min.css"/>
2525
<link rel="search" type="application/opensearchdescription+xml" title="Dart packages" href="/osd.xml"/>
2626
<meta name="description" content="Pub is the package manager for the Dart programming language, containing reusable libraries &amp; packages for Flutter and general Dart programs."/>
27-
<link rel="alternate" type="application/atom+xml" title="Updated Packages Feed for Pub" href="/feed.atom"/>
27+
<link rel="alternate" type="application/atom+xml" title="Recently published packages on pub.dev" href="/feed.atom"/>
2828
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/material/bundle/styles.css"/>
2929
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/css/style.css"/>
3030
<script src="/static/hash-%%etag%%/material/bundle/script.min.js" defer="defer"></script>

app/test/frontend/golden/error_page.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<link rel="stylesheet" href="https://www.gstatic.com/glue/v25_0/ccb.min.css"/>
2525
<link rel="search" type="application/opensearchdescription+xml" title="Dart packages" href="/osd.xml"/>
2626
<meta name="description" content="Pub is the package manager for the Dart programming language, containing reusable libraries &amp; packages for Flutter and general Dart programs."/>
27-
<link rel="alternate" type="application/atom+xml" title="Updated Packages Feed for Pub" href="/feed.atom"/>
27+
<link rel="alternate" type="application/atom+xml" title="Recently published packages on pub.dev" href="/feed.atom"/>
2828
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/material/bundle/styles.css"/>
2929
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/css/style.css"/>
3030
<script src="/static/hash-%%etag%%/material/bundle/script.min.js" defer="defer"></script>

app/test/frontend/golden/help_page.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<link rel="search" type="application/opensearchdescription+xml" title="Dart packages" href="/osd.xml"/>
2626
<link rel="canonical" href="https://pub.dev/help"/>
2727
<meta name="description" content="Pub is the package manager for the Dart programming language, containing reusable libraries &amp; packages for Flutter and general Dart programs."/>
28-
<link rel="alternate" type="application/atom+xml" title="Updated Packages Feed for Pub" href="/feed.atom"/>
28+
<link rel="alternate" type="application/atom+xml" title="Recently published packages on pub.dev" href="/feed.atom"/>
2929
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/material/bundle/styles.css"/>
3030
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/css/style.css"/>
3131
<script src="/static/hash-%%etag%%/material/bundle/script.min.js" defer="defer"></script>

app/test/frontend/golden/landing_page.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<link rel="search" type="application/opensearchdescription+xml" title="Dart packages" href="/osd.xml"/>
2626
<link rel="canonical" href="https://pub.dev/"/>
2727
<meta name="description" content="Pub is the package manager for the Dart programming language, containing reusable libraries &amp; packages for Flutter and general Dart programs."/>
28-
<link rel="alternate" type="application/atom+xml" title="Updated Packages Feed for Pub" href="/feed.atom"/>
28+
<link rel="alternate" type="application/atom+xml" title="Recently published packages on pub.dev" href="/feed.atom"/>
2929
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/material/bundle/styles.css"/>
3030
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/css/style.css"/>
3131
<script src="/static/hash-%%etag%%/material/bundle/script.min.js" defer="defer"></script>

app/test/frontend/golden/my_activity_log_page.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<link rel="stylesheet" href="https://www.gstatic.com/glue/v25_0/ccb.min.css"/>
2525
<link rel="search" type="application/opensearchdescription+xml" title="Dart packages" href="/osd.xml"/>
2626
<meta name="description" content="Pub is the package manager for the Dart programming language, containing reusable libraries &amp; packages for Flutter and general Dart programs."/>
27-
<link rel="alternate" type="application/atom+xml" title="Updated Packages Feed for Pub" href="/feed.atom"/>
27+
<link rel="alternate" type="application/atom+xml" title="Recently published packages on pub.dev" href="/feed.atom"/>
2828
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/material/bundle/styles.css"/>
2929
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/css/style.css"/>
3030
<script src="/static/hash-%%etag%%/material/bundle/script.min.js" defer="defer"></script>

app/test/frontend/golden/my_liked_packages.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<link rel="stylesheet" href="https://www.gstatic.com/glue/v25_0/ccb.min.css"/>
2525
<link rel="search" type="application/opensearchdescription+xml" title="Dart packages" href="/osd.xml"/>
2626
<meta name="description" content="Pub is the package manager for the Dart programming language, containing reusable libraries &amp; packages for Flutter and general Dart programs."/>
27-
<link rel="alternate" type="application/atom+xml" title="Updated Packages Feed for Pub" href="/feed.atom"/>
27+
<link rel="alternate" type="application/atom+xml" title="Recently published packages on pub.dev" href="/feed.atom"/>
2828
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/material/bundle/styles.css"/>
2929
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/css/style.css"/>
3030
<script src="/static/hash-%%etag%%/material/bundle/script.min.js" defer="defer"></script>

app/test/frontend/golden/my_packages.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<link rel="stylesheet" href="https://www.gstatic.com/glue/v25_0/ccb.min.css"/>
2525
<link rel="search" type="application/opensearchdescription+xml" title="Dart packages" href="/osd.xml"/>
2626
<meta name="description" content="Pub is the package manager for the Dart programming language, containing reusable libraries &amp; packages for Flutter and general Dart programs."/>
27-
<link rel="alternate" type="application/atom+xml" title="Updated Packages Feed for Pub" href="/feed.atom"/>
27+
<link rel="alternate" type="application/atom+xml" title="Recently published packages on pub.dev" href="/feed.atom"/>
2828
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/material/bundle/styles.css"/>
2929
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/css/style.css"/>
3030
<script src="/static/hash-%%etag%%/material/bundle/script.min.js" defer="defer"></script>

app/test/frontend/golden/my_publishers.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<link rel="stylesheet" href="https://www.gstatic.com/glue/v25_0/ccb.min.css"/>
2525
<link rel="search" type="application/opensearchdescription+xml" title="Dart packages" href="/osd.xml"/>
2626
<meta name="description" content="Pub is the package manager for the Dart programming language, containing reusable libraries &amp; packages for Flutter and general Dart programs."/>
27-
<link rel="alternate" type="application/atom+xml" title="Updated Packages Feed for Pub" href="/feed.atom"/>
27+
<link rel="alternate" type="application/atom+xml" title="Recently published packages on pub.dev" href="/feed.atom"/>
2828
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/material/bundle/styles.css"/>
2929
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/css/style.css"/>
3030
<script src="/static/hash-%%etag%%/material/bundle/script.min.js" defer="defer"></script>

app/test/frontend/golden/pkg_activity_log_page.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<link rel="stylesheet" href="https://www.gstatic.com/glue/v25_0/ccb.min.css"/>
2525
<link rel="search" type="application/opensearchdescription+xml" title="Dart packages" href="/osd.xml"/>
2626
<meta name="description" content="Pub is the package manager for the Dart programming language, containing reusable libraries &amp; packages for Flutter and general Dart programs."/>
27-
<link rel="alternate" type="application/atom+xml" title="Updated Packages Feed for Pub" href="/feed.atom"/>
27+
<link rel="alternate" type="application/atom+xml" title="Recently published packages on pub.dev" href="/feed.atom"/>
2828
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/material/bundle/styles.css"/>
2929
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/css/style.css"/>
3030
<script src="/static/hash-%%etag%%/material/bundle/script.min.js" defer="defer"></script>

app/test/frontend/golden/pkg_admin_page.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<link rel="stylesheet" href="https://www.gstatic.com/glue/v25_0/ccb.min.css"/>
2525
<link rel="search" type="application/opensearchdescription+xml" title="Dart packages" href="/osd.xml"/>
2626
<meta name="description" content="Pub is the package manager for the Dart programming language, containing reusable libraries &amp; packages for Flutter and general Dart programs."/>
27-
<link rel="alternate" type="application/atom+xml" title="Updated Packages Feed for Pub" href="/feed.atom"/>
27+
<link rel="alternate" type="application/atom+xml" title="Recently published packages on pub.dev" href="/feed.atom"/>
2828
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/material/bundle/styles.css"/>
2929
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/css/style.css"/>
3030
<script src="/static/hash-%%etag%%/material/bundle/script.min.js" defer="defer"></script>

app/test/frontend/golden/pkg_changelog_page.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
<link rel="search" type="application/opensearchdescription+xml" title="Dart packages" href="/osd.xml"/>
2626
<link rel="canonical" href="https://pub.dev/packages/oxygen/changelog"/>
2727
<meta name="description" content="oxygen is awesome"/>
28-
<link rel="alternate" type="application/atom+xml" title="Updated Packages Feed for Pub" href="/feed.atom"/>
28+
<link rel="alternate" type="application/atom+xml" title="Recently published packages on pub.dev" href="/feed.atom"/>
29+
<link rel="alternate" type="application/atom+xml" title="Recently published versions of package oxygen on pub.dev" href="/api/packages/oxygen/feed.atom"/>
2930
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/material/bundle/styles.css"/>
3031
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/css/style.css"/>
3132
<script src="/static/hash-%%etag%%/material/bundle/script.min.js" defer="defer"></script>

app/test/frontend/golden/pkg_example_page.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
<link rel="search" type="application/opensearchdescription+xml" title="Dart packages" href="/osd.xml"/>
2626
<link rel="canonical" href="https://pub.dev/packages/oxygen/example"/>
2727
<meta name="description" content="oxygen is awesome"/>
28-
<link rel="alternate" type="application/atom+xml" title="Updated Packages Feed for Pub" href="/feed.atom"/>
28+
<link rel="alternate" type="application/atom+xml" title="Recently published packages on pub.dev" href="/feed.atom"/>
29+
<link rel="alternate" type="application/atom+xml" title="Recently published versions of package oxygen on pub.dev" href="/api/packages/oxygen/feed.atom"/>
2930
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/material/bundle/styles.css"/>
3031
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/css/style.css"/>
3132
<script src="/static/hash-%%etag%%/material/bundle/script.min.js" defer="defer"></script>

app/test/frontend/golden/pkg_index_page.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<link rel="search" type="application/opensearchdescription+xml" title="Dart packages" href="/osd.xml"/>
2626
<link rel="canonical" href="https://pub.dev/packages?q=sdk%3Adart"/>
2727
<meta name="description" content="Pub is the package manager for the Dart programming language, containing reusable libraries &amp; packages for Flutter and general Dart programs."/>
28-
<link rel="alternate" type="application/atom+xml" title="Updated Packages Feed for Pub" href="/feed.atom"/>
28+
<link rel="alternate" type="application/atom+xml" title="Recently published packages on pub.dev" href="/feed.atom"/>
2929
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/material/bundle/styles.css"/>
3030
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/css/style.css"/>
3131
<script src="/static/hash-%%etag%%/material/bundle/script.min.js" defer="defer"></script>

app/test/frontend/golden/pkg_install_page.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
<link rel="search" type="application/opensearchdescription+xml" title="Dart packages" href="/osd.xml"/>
2626
<link rel="canonical" href="https://pub.dev/packages/oxygen/install"/>
2727
<meta name="description" content="oxygen is awesome"/>
28-
<link rel="alternate" type="application/atom+xml" title="Updated Packages Feed for Pub" href="/feed.atom"/>
28+
<link rel="alternate" type="application/atom+xml" title="Recently published packages on pub.dev" href="/feed.atom"/>
29+
<link rel="alternate" type="application/atom+xml" title="Recently published versions of package oxygen on pub.dev" href="/api/packages/oxygen/feed.atom"/>
2930
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/material/bundle/styles.css"/>
3031
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/css/style.css"/>
3132
<script src="/static/hash-%%etag%%/material/bundle/script.min.js" defer="defer"></script>

app/test/frontend/golden/pkg_score_page.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
<link rel="search" type="application/opensearchdescription+xml" title="Dart packages" href="/osd.xml"/>
2626
<link rel="canonical" href="https://pub.dev/packages/oxygen/score"/>
2727
<meta name="description" content="oxygen is awesome"/>
28-
<link rel="alternate" type="application/atom+xml" title="Updated Packages Feed for Pub" href="/feed.atom"/>
28+
<link rel="alternate" type="application/atom+xml" title="Recently published packages on pub.dev" href="/feed.atom"/>
29+
<link rel="alternate" type="application/atom+xml" title="Recently published versions of package oxygen on pub.dev" href="/api/packages/oxygen/feed.atom"/>
2930
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/material/bundle/styles.css"/>
3031
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/css/style.css"/>
3132
<script src="/static/hash-%%etag%%/material/bundle/script.min.js" defer="defer"></script>

app/test/frontend/golden/pkg_score_page_with_downloads_chart.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
<link rel="search" type="application/opensearchdescription+xml" title="Dart packages" href="/osd.xml"/>
2626
<link rel="canonical" href="https://pub.dev/packages/oxygen/score"/>
2727
<meta name="description" content="oxygen is awesome"/>
28-
<link rel="alternate" type="application/atom+xml" title="Updated Packages Feed for Pub" href="/feed.atom"/>
28+
<link rel="alternate" type="application/atom+xml" title="Recently published packages on pub.dev" href="/feed.atom"/>
29+
<link rel="alternate" type="application/atom+xml" title="Recently published versions of package oxygen on pub.dev" href="/api/packages/oxygen/feed.atom"/>
2930
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/material/bundle/styles.css"/>
3031
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/css/style.css"/>
3132
<script src="/static/hash-%%etag%%/material/bundle/script.min.js" defer="defer"></script>

app/test/frontend/golden/pkg_show_page.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
<link rel="search" type="application/opensearchdescription+xml" title="Dart packages" href="/osd.xml"/>
2626
<link rel="canonical" href="https://pub.dev/packages/oxygen"/>
2727
<meta name="description" content="oxygen is awesome"/>
28-
<link rel="alternate" type="application/atom+xml" title="Updated Packages Feed for Pub" href="/feed.atom"/>
28+
<link rel="alternate" type="application/atom+xml" title="Recently published packages on pub.dev" href="/feed.atom"/>
29+
<link rel="alternate" type="application/atom+xml" title="Recently published versions of package oxygen on pub.dev" href="/api/packages/oxygen/feed.atom"/>
2930
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/material/bundle/styles.css"/>
3031
<link rel="stylesheet" type="text/css" href="/static/hash-%%etag%%/css/style.css"/>
3132
<script src="/static/hash-%%etag%%/material/bundle/script.min.js" defer="defer"></script>

0 commit comments

Comments
 (0)