Skip to content

Commit 9b9d431

Browse files
committed
2 parents 6202d5d + 899bc01 commit 9b9d431

File tree

10 files changed

+369
-88
lines changed

10 files changed

+369
-88
lines changed

.github/workflows/hugo.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,7 @@ jobs:
5757
HUGO_ENV: production
5858
TZ: America/Los_Angeles
5959
run: |
60-
hugo \
61-
--gc \
62-
--minify \
63-
--baseURL "${{ steps.pages.outputs.base_url }}/"
60+
hugo --gc --minify --baseURL "${{ steps.pages.outputs.base_url }}/" && cd public/en && cp 404.html ../404.html
6461
- name: Upload artifact
6562
uses: actions/upload-pages-artifact@v3
6663
with:

assets/free_basket_calendar.json

Lines changed: 330 additions & 69 deletions
Large diffs are not rendered by default.

assets/js/critical/tableCardViewSwitch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if (window.location.href.includes("/free-basketball-live-streams/")) {
2828
});
2929

3030
var searchBox = document.getElementById("searchBoxInlinePage");
31-
if (searchBox != null) {
31+
if (searchBox != null) {
3232
searchBox.addEventListener("input", function () {
3333
var filter = this.value.toLowerCase();
3434
var items = document.querySelectorAll('[data-search-content]');

config/_default/server.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ for = '/**'
4040
"""
4141
Access-Control-Allow-Origin = "*"
4242
# toml-docs-end server-config
43+
4344
defaultContentLanguage = 'en'
4445
defaultContentLanguageInSubdir = true
4546
[[redirects]]

i18n/de.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,15 @@
193193
- id: tablePageSelectAll
194194
translation: Alle
195195

196-
196+
# Basketball streams table
197+
- id: SwitchCardTableView
198+
translation: Ansicht wechseln
197199
- id: Date
198200
translation: Datum
199201
- id: Time
200202
translation: Uhrzeit
201203
- id: Description
202-
translation: Beschreibung
204+
translation: Beschreibung
205+
- id: League
206+
translation: Liga
207+

i18n/en.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,19 @@
99
# Toast color.js saved
1010
- id: websiteThemeMode
1111
translation: Website Theme Mode
12-
1312
- id: websiteThemeModeText
1413
translation: Saved to local browser storage.
15-
1614
- id: tablePageSelectAll
1715
translation: "All"
1816

19-
20-
17+
# Basketball streams table
18+
- id: SwitchCardTableView
19+
translation: Switch view
2120
- id: Date
2221
translation: Date
2322
- id: Time
2423
translation: Time
2524
- id: Description
26-
translation: Description
25+
translation: Description
26+
- id: League
27+
translation: League

layouts/404.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
</span>
1111
{{- $home := printf "<a href=\"%s\">%s</a>" $base (T "pageNotFoundHome") -}}
1212
<p>{{ T "pageNotFound" $home | safeHTML }}</p>
13+
<p>Die Seite ist nicht vorhanden. Zurück zur Startseite <a href=/de>Startseite (de)</a>.</p>
1314
</div>
1415
</div>
1516
</div>

layouts/shortcodes/basketCalendarJsonTable.html

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{{ $data := transform.Unmarshal $json.Content }}
66
{{ if $data }}
77
<p class="text-end">
8-
<button id="toggleView" class="btn btn-warning">Switch View</button>
8+
<button id="toggleView" class="btn btn-warning">{{ i18n "SwitchCardTableView" }}</button>
99
</p>
1010
<div id="content">
1111

@@ -20,13 +20,20 @@
2020
{{ range $index, $item := $data }}
2121
<div class="col-sm-4 mb-3 mb-sm-1" data-search-content="{{ time.Format " :date_short" (time.AsTime $item.begin) }}
2222
{{ time.Format ":time_short" (time.AsTime $item.begin) }} {{ $item.name }}">
23-
2423
<div class="card h-100">
2524
<div class="card-body">
26-
<h4 class="card-title">{{ $item.name }}</h4>
25+
<h4 class="card-title">{{ with $item.league }}
26+
{{ if ne . "" }}
27+
{{ $item.name }} ({{ . }})
28+
{{ else }}
29+
{{ $item.name }}
30+
{{ end }}
31+
{{ else }}
32+
{{ $item.name }}
33+
{{ end }}</h4>
2734
<h5 class="card-text">{{ time.Format ":date_short" (time.AsTime $item.begin) }} {{
2835
time.Format ":time_short" (time.AsTime $item.begin) }}</h5>
29-
<p class="card-muted">{{ $item.description }}</p>
36+
<p class="card-muted"><small>{{ $item.description }}</small></p>
3037
</div>
3138
<div class="card-footer">
3239
<p class="text-center">
@@ -60,7 +67,8 @@ <h5 class="card-text">{{ time.Format ":date_short" (time.AsTime $item.begin) }}
6067
<th data-sortable="false">{{ i18n "Date" }}</th>
6168
<th data-sortable="false">{{ i18n "Time" }}</th>
6269
<th>Teams</th>
63-
<th>{{ i18n "Description" }}</th>
70+
<th>{{ i18n "League" }}</th>
71+
<th><small>{{ i18n "Description" }}</small></th>
6472
<th>Channel</th>
6573
</tr>
6674
</thead>
@@ -70,7 +78,8 @@ <h5 class="card-text">{{ time.Format ":date_short" (time.AsTime $item.begin) }}
7078
<td data-text="{{ $item.begin }}">{{ time.Format ":date_short" (time.AsTime $item.begin) }}</td>
7179
<td data-text="{{ $item.begin }}">{{ time.Format ":time_short" (time.AsTime $item.begin) }}</td>
7280
<td>{{ $item.name }}</td>
73-
<td>{{ $item.description }}</td>
81+
<td>{{ $item.league }}</td>
82+
<td><small>{{ $item.description }}</small></td>
7483
<td>
7584
{{ if $item.url }}
7685
<a href="{{ $item.url }}" rel="noopener noreferrer">{{ $item.location }}</a>

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"start:example:prod": "npm run -s prestart && hugo server --bind=0.0.0.0 --disableFastRender --printI18nWarnings --minify -e production -s exampleSite",
2525
"prebuild": "npm run clean:public && npm run -s mod:vendor",
2626
"build": "hugo --gc --minify",
27+
"build:de": "hugo --gc --minify && cd public/en/404.html public/404.html",
2728
"build:cache": "npm run -s prebuild && hugo config | grep cachedir && hugo --gc --minify -e ci",
2829
"build:example": "npm run -s prebuild && hugo --gc --minify -s exampleSite",
2930
"build:example:ci": "npm run -s prebuild && hugo --gc --minify -s exampleSite -e ci",

update_basket_calendar_json.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ def fetch_ics_file(url):
3939
berlin_tz = pytz.timezone('Europe/Berlin')
4040

4141
def add_http_if_missing(url):
42+
if not url:
43+
return None
44+
4245
if not url.startswith(('http://', 'https://')):
4346
print(f"add https to url %s" % url)
4447
return f"https://{url}"
@@ -65,7 +68,9 @@ def get_domain_name(url):
6568
url = extract_first_url(event.location)
6669
url = add_http_if_missing(url) # Add https if missing
6770
location = get_domain_name(url) if url and url.startswith('http') else event.location
68-
71+
if not url:
72+
printf(f"url is empty {event.name}")
73+
6974
# Check for 'league: Name' in description and remove it
7075
league = None
7176
if 'league:' in event.description:

0 commit comments

Comments
 (0)