Skip to content

Commit 8e9aaee

Browse files
author
Cristian Yáñez
committed
fix(2261): hardcode library intro authors bios
1 parent 4c4c153 commit 8e9aaee

1 file changed

Lines changed: 42 additions & 2 deletions

File tree

core/views.py

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@
8484

8585
from libraries.models import Library, LibraryVersion
8686
from libraries.utils import (
87-
build_library_intro_context,
8887
get_commit_data_by_release_for_library,
8988
commit_data_to_stats_bars,
9089
)
@@ -1780,6 +1779,48 @@ def get_context_data(self, **kwargs):
17801779

17811780
context["release_contributor_data"] = context["contributor_data"][:8]
17821781

1782+
# Hardcoded for the demo page. The production library intro context is
1783+
# built by `libraries.utils.build_library_intro_context`; reuse it when
1784+
# integrating this component into the real library pages.
1785+
context["library_intro"] = {
1786+
"library_name": "Boost.Beast.",
1787+
"description": (
1788+
"Lightweight utilities that power dozens of other Boost libraries"
1789+
),
1790+
"authors": [
1791+
{
1792+
"name": "Vinnie Falco",
1793+
"role": "Author",
1794+
"avatar_url": f"{settings.STATIC_URL}img/v3/demo_page/Avatar.png",
1795+
"badge_url": (
1796+
f"{settings.STATIC_URL}img/v3/badges/badge-first-place.png"
1797+
),
1798+
"badge": "",
1799+
"bio": "Big C++ fan. Not quite kidney-donation level, but close.",
1800+
"profile_url": "",
1801+
},
1802+
{
1803+
"name": "Alex Wells",
1804+
"role": "Contributor",
1805+
"avatar_url": f"{settings.STATIC_URL}img/v3/demo_page/Avatar.png",
1806+
"badge_url": "",
1807+
"badge": "",
1808+
"bio": "C++ enthusiast who has worked at Intel and Microsoft.",
1809+
"profile_url": "",
1810+
},
1811+
{
1812+
"name": "Dave Abrahams",
1813+
"role": "Contributor",
1814+
"avatar_url": f"{settings.STATIC_URL}img/v3/demo_page/Avatar.png",
1815+
"badge_url": f"{settings.STATIC_URL}img/v3/badges/badge-bronze.png",
1816+
"badge": "",
1817+
"bio": "Contributor to Boost since 2009.",
1818+
"profile_url": "",
1819+
},
1820+
],
1821+
"cta_url": "#",
1822+
}
1823+
17831824
latest = Version.objects.most_recent()
17841825
if latest:
17851826
lv = (
@@ -1788,7 +1829,6 @@ def get_context_data(self, **kwargs):
17881829
.first()
17891830
)
17901831
if lv:
1791-
context["library_intro"] = build_library_intro_context(lv)
17921832
deps = lv.dependencies.order_by("name")
17931833
context["dependencies_card_data"] = [
17941834
{

0 commit comments

Comments
 (0)