Skip to content

Commit b910440

Browse files
committed
Link to bundlephobia and npm
1 parent a3569a0 commit b910440

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

apps/components_guide_web/lib/components_guide_web/controllers/research_controller.ex

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,18 @@ defmodule ComponentsGuideWeb.ResearchController do
5353
%{"name" => name, "size" => size, "gzip" => size_gzip, "version" => version} ->
5454
emerging_3g_ms = floor(size_gzip / 50)
5555

56+
# bundlephobia_url_query = URI.encode_query(%{"p" => "#{name}@#{version}"})
57+
bundlephobia_url_query = "p=#{name}@#{version}"
58+
bundlephobia_url = "https://bundlephobia.com/result?#{bundlephobia_url_query}"
59+
5660
content_tag(:article, [
5761
h2("Bundlephobia"),
5862
Section.card([
59-
content_tag(:h3, "#{name}@#{version}", class: "text-2xl"),
63+
content_tag(
64+
:h3,
65+
link("#{name}@#{version}", to: bundlephobia_url),
66+
class: "text-2xl"
67+
),
6068
content_tag(
6169
:dl,
6270
[
@@ -90,7 +98,11 @@ defmodule ComponentsGuideWeb.ResearchController do
9098
content_tag(:article, [
9199
h2("NPM packages"),
92100
Section.card([
93-
content_tag(:h3, link(name, to: "https://www.npmjs.com/package/#{name}"), class: "text-2xl"),
101+
content_tag(
102+
:h3,
103+
link(name, to: "https://www.npmjs.com/package/#{name}"),
104+
class: "text-2xl"
105+
),
94106
content_tag(
95107
:dl,
96108
[

0 commit comments

Comments
 (0)