Skip to content

Commit 939d055

Browse files
authored
fix(2261): hardcode library intro authors bios (boostorg#2374)
1 parent 390c352 commit 939d055

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
@@ -83,7 +83,6 @@
8383

8484
from libraries.models import Library, LibraryVersion
8585
from libraries.utils import (
86-
build_library_intro_context,
8786
get_commit_data_by_release_for_library,
8887
commit_data_to_stats_bars,
8988
)
@@ -1774,6 +1773,48 @@ def get_context_data(self, **kwargs):
17741773

17751774
context["release_contributor_data"] = context["contributor_data"][:8]
17761775

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

0 commit comments

Comments
 (0)