-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multi-game randos displayed separately (#32)
* templates cleanup * multi-game randos
- Loading branch information
Showing
7 changed files
with
84 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<ul class="randos-list"> | ||
{%- assign randos = include.randos | sort_natural: "identifier" -%} | ||
{%- for rando in randos -%} | ||
{%- include rando.html rando=rando parent_name=include.parent_name showgames=include.showgames -%} | ||
{%- endfor -%} | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,38 @@ | ||
{%- assign series = include.series -%} | ||
{%- assign games = "" | split: "" -%} | ||
{%- for game in include.series.games -%} | ||
{%- assign games = games | push: game[0] -%} | ||
{%- endfor -%} | ||
{%- assign games = games | sort_natural -%} | ||
|
||
{%- assign seriesText = include.series.name -%} | ||
{%- assign firstGame = nil -%} | ||
{%- if games.size == 1 -%} | ||
{%- assign firstGame = games[0] -%} | ||
{%- comment -%} Series with a different name to the sole game within will have their title appended {%- endcomment -%} | ||
{%- if firstGame != seriesText -%} | ||
{%- assign series_suffix = ' <span class="text-muted">(SERIES)</span>' | replace: "SERIES", seriesText -%} | ||
{%- else -%} | ||
{%- assign series_suffix = null -%} | ||
{%- endif -%} | ||
|
||
{%- comment -%} Add release date to game listed if present {%- endcomment -%} | ||
{%- assign game_data = include.series.games[firstGame] -%} | ||
{%- assign release_year = game_data.release-date | split: "-" | first -%} | ||
{%- if release_year != null -%} | ||
{%- assign release_year_suffix = ' <span class="text-muted fs-5">(RELEASE)</span>' | replace: "RELEASE", release_year -%} | ||
{%- else -%} | ||
{%- assign release_year_suffix = null -%} | ||
{%- endif -%} | ||
|
||
{%- assign seriesText = firstGame | append: release_year_suffix | append: series_suffix -%} | ||
{%- endif -%} | ||
|
||
<h3 id="{{ include.series.name }}" class="my-0"><a href="#{{ include.series.name }}"><i class="bi bi-link-45deg"></i></a> {{ seriesText }}</h3> | ||
|
||
|
||
{%- if include.series.comment -%} | ||
<p>{{ include.series.comment | markdownify }}</p> | ||
<h3 id="{{ series.name | cgi_escape }}" class="my-0"><a href="#{{ series.name | cgi_escape }}"><i class="bi bi-link-45deg"></i></a> | ||
{% if games.size == 1 %} | ||
{%- assign firstGame = games[0] -%} | ||
{%- assign game_data = series.games[firstGame] -%} | ||
{%- assign release_year = game_data.release-date | split: "-" | first -%} | ||
|
||
{{ firstGame }} | ||
{% if release_year %} | ||
<span class="text-muted fs-5">({{ release_year }})</span> | ||
{% endif %} | ||
|
||
{%- comment -%} Series with a different name to the sole game within will have their title appended {%- endcomment -%} | ||
{% if firstGame != series.name %} | ||
<span class="text-muted">{{ series.name }}</span> | ||
{% endif %} | ||
{% else %} | ||
{{ series.name }} | ||
{% endif %} | ||
</h3> | ||
|
||
{%- if series.comment -%} | ||
<p>{{ series.comment | markdownify }}</p> | ||
{%- endif -%} | ||
|
||
|
||
<ul class="series-list"> | ||
{%- if include.games_merged -%} | ||
{%- assign randos = "" | split: "" -%} | ||
{%- for rando in include.series.randomizers -%} | ||
{%- assign randos = randos | push: rando -%} | ||
{%- endfor -%} | ||
{%- assign randos = randos | sort_natural: "identifier" -%} | ||
|
||
{%- for rando in randos -%} | ||
{%- include rando.html rando=rando parent_name=include.series.name standalone=true -%} | ||
{%- endfor -%} | ||
{%- include randos_list.html randos=series.randomizers parent_name=series.name showgames=true -%} | ||
{%- else -%} | ||
{%- if firstGame -%} | ||
{%- include game.html series=include.series game=firstGame notitle=true -%} | ||
{%- else -%} | ||
{%- for game in games -%} | ||
{%- include game.html series=include.series game=game -%} | ||
{%- endfor -%} | ||
{%- endif -%} | ||
{%- include series_games.html series=series -%} | ||
{%- endif -%} | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{%- assign series = include.series -%} | ||
{%- assign multirandos = series.randomizers | where_exp:"r", "r.games.size >= 3" -%} | ||
|
||
{%- assign cutoff = series.randomizers.size | minus: 2 -%} | ||
{%- if multirandos.size > 0 and multirandos.size > cutoff -%} | ||
{%- assign multirandos = series.randomizers -%} | ||
{%- elsif multirandos.size > 0 -%} | ||
<h4>Multi-Game Randomizers</h4> | ||
{%- endif -%} | ||
|
||
{%- if multirandos.size > 0 -%} | ||
{%- include randos_list.html series=series parent_name=series.name randos=multirandos showgames=true -%} | ||
{%- endif -%} | ||
|
||
{%- if multirandos.size < series.randomizers.size -%} | ||
{%- assign no_game_titles = false -%} | ||
{%- if games.size == 1 -%}{%- assign no_game_titles = true -%}{%- endif -%} | ||
|
||
{%- for game in games -%} | ||
{%- assign randos = series.randomizers | where_exp:"r", "r.games.size < 3" | where_exp:"r","r.games contains game" -%} | ||
{%- if randos.size == 0 -%} | ||
{%- continue -%} | ||
{%- endif -%} | ||
|
||
{%- include game.html series=series game=game notitle=no_game_titles -%} | ||
{%- include randos_list.html series=series parent_name=game randos=randos -%} | ||
{%- endfor -%} | ||
{%- endif -%} |