Skip to content

Commit

Permalink
feat(mainpage): new Hearthstone main page (#5336)
Browse files Browse the repository at this point in the history
* feat(mainpage): Set up Hearthstone main page

* Update Banner.less

* Create filter_buttons_config.lua

* Update main_page_layout_data.lua

* Update components/main_page/wikis/hearthstone/main_page_layout_data.lua

Co-authored-by: Rikard Blixt <[email protected]>

* Update components/main_page/wikis/hearthstone/main_page_layout_data.lua

Co-authored-by: Rikard Blixt <[email protected]>

---------

Co-authored-by: Rikard Blixt <[email protected]>
  • Loading branch information
Kanopedia and Rathoz authored Jan 16, 2025
1 parent 11f30df commit 05709d4
Show file tree
Hide file tree
Showing 3 changed files with 229 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
-- @Liquipedia
-- wiki=hearthstone
-- page=Module:FilterButtons/Config
--
-- Please see https://github.com/Liquipedia/Lua-Modules to contribute
--

local Tier = require('Module:Tier/Utils')
local Config = {}

Config.categories = {
{
name = 'liquipediatier',
property = 'liquipediaTier',
load = function(category)
category.items = {}
for _, tier in Tier.iterate('tiers') do
table.insert(category.items, tier.value)
end
end,
defaultItems = {'1', '2', '3', '4'},
transform = function(tier)
return Tier.toName(tier)
end,
},
}

return Config
194 changes: 194 additions & 0 deletions components/main_page/wikis/hearthstone/main_page_layout_data.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
---
-- @Liquipedia
-- wiki=hearthstone
-- page=Module:MainPageLayout/data
--
-- Please see https://github.com/Liquipedia/Lua-Modules to contribute
--

local CONTENT = {
usefulArticles = {
heading = 'Useful Articles',
body = '{{Liquipedia:Useful Articles}}',
padding = true,
boxid = 1503,
},
wantToHelp = {
heading = 'Want To Help?',
body = '{{Liquipedia:Want_to_help}}',
padding = true,
boxid = 1504,
},
transfers = {
heading = 'Transfers',
body = '{{Transfer List|limit=15}}\n<div style{{=}}"display:block; text-align:center; padding:0.5em;">\n' ..
'<div style{{=}}"display:inline; float:left; font-style:italic;">\'\'[[#Top|Back to top]]\'\'</div>\n' ..
'<div style{{=}}"display:inline; float:right;" class="plainlinks smalledit">' ..
'&#91;[{{FULLURL:Player Transfers/{{CURRENTYEAR}}/1st_Quarter|action=edit}} edit]&#93;</div>\n' ..
'<div style{{=}}"white-space:nowrap; display:inline; margin:0 10px font-size:15px; font-style:italic;">' ..
'[[Portal:Transfers|See more transfers]]<span style="font-style:normal; padding:0 5px;">&#8226;</span>' ..
'[[Transfer query]]<span style{{=}}"font-style:normal; padding:0 5px;">&#8226;</span>' ..
'[[lpcommons:Special:RunQuery/Transfer|Input Form]]' ..
'<span style="font-style:normal; padding:0 5px;">&#8226;</span>' ..
'[[Portal:Rumours|Rumours]]</center></div>\n</div>',
boxid = 1509,
},
thisDay = {
heading = 'This day in Hearthstone <small id="this-day-date" style = "margin-left: 5px">' ..
'({{#time:F}} {{Ordinal|{{#time:j}}}})</small>',
body = '{{Liquipedia:This day}}',
padding = true,
boxid = 1510,
},
specialEvents = {
noPanel = true,
body = '{{Liquipedia:Special Event}}',
},
filterButtons = {
noPanel = true,
body = '<div style{{=}}"width:100%;margin-bottom:8px;">' ..
'{{#invoke:Lua|invoke|module=FilterButtons|fn=getFromConfig}}</div>',
},
matches = {
heading = 'Matches',
body = '{{#invoke:Lua|invoke|module=Widget/Factory|fn=fromTemplate|widget=Match/Ticker/Container}}' ..
'<div style{{=}}"white-space:nowrap; display: block; margin:0 10px; ' ..
'font-size:15px; font-style:italic; text-align:center;">[[Liquipedia:Matches|See more matches]]</div>',
padding = true,
boxid = 1507,
},
tournaments = {
heading = 'Tournaments',
body = '{{#invoke:Lua|invoke|module=Widget/Factory|fn=fromTemplate|widget=Tournaments/Ticker' ..
'|upcomingDays=30|completedDays=20}}',
padding = true,
boxid = 1508,
},
}

return {
banner = {
lightmode = 'Hearthstone_full logo.png',
darkmode = 'Hearthstone_full logo.png',
},
metadesc = 'The Hearthstone esports wiki covering everything from players, teams and transfers, ' ..
'to tournaments and results, heroes, and cards.',
title = 'Hearthstone',
navigation = {
{
file = 'Team Ukraine 2017 Hearthstone Global Games .jpg',
title = 'Teams',
link = 'Portal:Teams',
count = {
method = 'LPDB',
table = 'team',
},
},
{
file = 'Hunterace World Championship 2019.jpg',
title = 'Players',
link = 'Portal:Players',
count = {
method = 'LPDB',
table = 'player',
},
},
{
file = 'Masters Tour 2020 Arlington Trophy.jpg',
title = 'Tournaments',
link = 'Portal:Tournaments',
count = {
method = 'LPDB',
table = 'tournament',
},
},
{
file = 'Casie and Surrender Grandmasters 2019 Finals.jpg',
title = 'Transfers',
link = 'Portal:Transfers',
count = {
method = 'LPDB',
table = 'transfer',
},
},
{
file = 'Masters Tour 2020 Statistics.jpg',
title = 'Statistics',
link = 'Portal:Statistics',
},
{
file = 'Icon_Class_HS_Shaman.png',
title = 'Classes',
link = 'Classes',
count = {
method = 'CATEGORY',
category = 'Classes',
}
},
},
layouts = {
main = {
{ -- Left
size = 6,
children = {
{
mobileOrder = 1,
content = CONTENT.specialEvents,
},
{
mobileOrder = 3,
content = CONTENT.transfers,
},
{
mobileOrder = 6,
content = CONTENT.wantToHelp,
},
}
},
{ -- Right
size = 6,
children = {
{
mobileOrder = 2,
children = {
{
children = {
{
noPanel = true,
content = CONTENT.filterButtons,
},
},
},
{
size = 6,
children = {
{
noPanel = true,
content = CONTENT.matches,
},
},
},
{
size = 6,
children = {
{
noPanel = true,
content = CONTENT.tournaments,
},
},
},
},
},
{
mobileOrder = 5,
content = CONTENT.thisDay,
},
{
mobileOrder = 4,
content = CONTENT.usefulArticles,
},
},
},
},
},
}
6 changes: 6 additions & 0 deletions stylesheets/commons/Banner.less
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
}
}

.wiki-hearthstone & {
@media ( min-width: 768px ) {
background: url( https://liquipedia.net/commons/images/4/4d/Hearthstone_banner_bg.png ) no-repeat center / cover;
}
}

.wiki-rainbowsix & {
@media ( min-width: 768px ) {
background: url( https://liquipedia.net/commons/images/c/c0/R6_bg.png ) no-repeat center / cover;
Expand Down

0 comments on commit 05709d4

Please sign in to comment.