Skip to content

Commit

Permalink
only generated interested teams game page
Browse files Browse the repository at this point in the history
  • Loading branch information
shrekshao committed Apr 28, 2023
1 parent 8619c29 commit 7ec914e
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 3 deletions.
21 changes: 20 additions & 1 deletion 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,24 @@
<h1>404</h1>

<p><strong>Page not found :(</strong></p>
<p>The requested page could not be found.</p>
<p>你可能点开了GSF不感兴趣的别队比赛</p>
<p>░░░░░░░░░▄░░░░░░░░░░░░░░▄░░░░
░░░░░░░░▌▒█░░░░░░░░░░░▄▀▒▌░░░
░░░░░░░░▌▒▒█░░░░░░░░▄▀▒▒▒▐░░░
░░░░░░░▐▄▀▒▒▀▀▀▀▄▄▄▀▒▒▒▒▒▐░░░
░░░░░▄▄▀▒░▒▒▒▒▒▒▒▒▒█▒▒▄█▒▐░░░
░░░▄▀▒▒▒░░░▒▒▒░░░▒▒▒▀██▀▒▌░░░
░░▐▒▒▒▄▄▒▒▒▒░░░▒▒▒▒▒▒▒▀▄▒▒▌░░
░░▌░░▌█▀▒▒▒▒▒▄▀█▄▒▒▒▒▒▒▒█▒▐░░
░▐░░░▒▒▒▒▒▒▒▒▌██▀▒▒░░░▒▒▒▀▄▌░
░▌░▒▄██▄▒▒▒▒▒▒▒▒▒░░░░░░▒▒▒▒▌░
▐▒▀▐▄█▄█▌▄░▀▒▒░░░░░░░░░░▒▒▒▐░
▐▒▒▐▀▐▀▒░▄▄▒▄▒▒▒▒▒▒░▒░▒░▒▒▒▒▌
▐▒▒▒▀▀▄▄▒▒▒▄▒▒▒▒▒▒▒▒░▒░▒░▒▒▐░
░▌▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒░▒░▒░▒░▒▒▒▌░
░▐▒▒▒▒▒▒▒▒▒▒▒▒▒▒░▒░▒░▒▒▄▒▒▐░░
░░▀▄▒▒▒▒▒▒▒▒▒▒▒░▒░▒░▒▄▒▒▒▒▌░░
░░░░▀▄▒▒▒▒▒▒▒▒▒▒▄▄▄▀▒▒▒▒▄▀░░░
░░░░░░▀▄▄▄▄▄▄▀▀▀▒▒▒▒▒▄▄▀░░░░░
░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▀▀░░░░░░░░</p>
</div>
1 change: 1 addition & 0 deletions _data/seasons/22q2/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"link": "https://nccsf.org",
"rules": "*11人制\n*分为小组排位赛和淘汰赛两个阶段\n*16支球队抽签分为四组,进行两轮排位赛。小组内第一轮对阵由抽签决定,第二轮由第一轮的两场比赛胜者相互对阵,两场比赛败者相互对阵。\n*排位赛积分表现为第一轮胜者得2分,第二轮胜者得1分,败者不得分\n*两轮排位赛后,每个小组第一名争夺冠军杯,第二名争夺优胜者杯,第三名争夺矽谷杯,第四名争夺勇者杯\n*淘汰赛阶段每个奖杯分区四支队伍进行单循环淘汰赛,决定奖杯归属",
"winner": "CalBlue",
"interested_teams": ["GSF"],
"regions": {
"N1": [
"OverPower",
Expand Down
1 change: 1 addition & 0 deletions _data/seasons/22q3-1/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
]
},
"winner": "GSF",
"interested_teams": ["GSF"],
"rules": "*7人制\n*最终分为两组分别排名:校友组和社区组\n*相互对阵由抽签决定,不限分组"
}
1 change: 1 addition & 0 deletions _data/seasons/22q4/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"type": "league_table",
"link": "https://nccsf.org",
"winner": "SVTigers",
"interested_teams": ["GSF-U", "GSF-C"],
"rules": "*9人制\n*单场比赛净胜球最多计算3个,多出的胜方进球不计入赛果\n*弃权额外扣3分\n*本赛季结束排名决定下赛季分档,前八进入第一档,第九名及之后进入第二档"
}
1 change: 1 addition & 0 deletions _data/seasons/23q1/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"type": "league_table + region",
"link": "https://nccsf.org",
"rules": "*11人制\n*十轮循环赛+两轮区间内排位赛",
"interested_teams": ["GSF-U", "GSF-L"],
"regions": {
"D1": [
"CalBlue",
Expand Down
17 changes: 15 additions & 2 deletions _plugins/league_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,11 @@ def generate(site)
end
# -------------------------------------------------------------


generate_interested_teams_gamepage_only = false
if config['interested_teams'] != nil
interested_teams = Set.new(config['interested_teams'])
generate_interested_teams_gamepage_only = true
end

team_hash = season[1]['teams']
team_hash.each do |key, team|
Expand Down Expand Up @@ -955,7 +959,16 @@ def generate(site)
end
end

site.pages << GamePage.new(site, site.source, File.join('seasons', season[0], 'games', key), key, game, home_team, away_team)
generate_gamepage = true
if generate_interested_teams_gamepage_only
if !(interested_teams.member?(game['home']['key']) || interested_teams.member?(game['away']['key']))
generate_gamepage = false
end
end

if generate_gamepage
site.pages << GamePage.new(site, site.source, File.join('seasons', season[0], 'games', key), key, game, home_team, away_team)
end
end


Expand Down

0 comments on commit 7ec914e

Please sign in to comment.