- name: Media columns: - size: small # Added new small column on the left widgets: - type: hacker-news # Added Hacker News widget limit: 15 collapse-after: 5 - size: full # Existing full column is now second widgets: - type: custom-api title: Epic Games cache: 1h url: https://store-site-backend-static.ak.epicgames.com/freeGamesPromotions?locale=en&country=US&allowCountries=US template: |
{{ if eq .Response.StatusCode 200 }}
{{ range .JSON.Array "data.Catalog.searchStore.elements" }} {{ $price := .String "price.totalPrice.discountPrice" }} {{ $hasPromo := gt (len (.Array "promotions.promotionalOffers")) 0 }} {{ if and $hasPromo (eq $price "0") }} {{ $gamePage := .String "productSlug" }} {{ if gt (len (.Array "offerMappings")) 0 }} {{ $gamePage = .String "offerMappings.0.pageSlug" }} {{end }} {{ $title := .String "title" }} {{ range .Array "keyImages" }} {{ if eq (.String "type") "OfferImageWide" }} {{ $title }} {{ end }} {{ end }}
{{ $title }}
{{ if $hasPromo }} {{ $promotions := .Array "promotionalOffers" }} {{ if gt (len $promotions) 0 }} {{ $firstPromo := index $promotions 0 }} {{ $offers := $firstPromo.Array "promotionalOffers" }} {{ if gt (len $offers) 0 }} {{ $firstOffer := index $offers 0 }} Free until {{ slice ($firstOffer.String "endDate") 0 10 }} {{ else }} Free this week! {{ end }} {{ else }} Free this week! {{ end }} {{ end }}
{{ end }} {{ end }}
{{ else }}

Error fetching Epic Games data.

{{ end }}
- type: videos title: For You style: grid-cards collapse-after-rows: 2 channels: - UCwWhs_6x42TyRM4Wstoq8HA - UCLuYADJ6hESLHX87JnsGbjA - UC-gW4TeZAlKm7UATp24JsWQ - UCETqJYEne9Tks-eZYIrFZvg - UCOT2iLov0V7Re7ku_3UBtcQ - UCFe2Kq8Hg15UomoVYdmRg_Q - type: videos title: Engineering style: grid-cards collapse-after-rows: 2 channels: - UCUyeluBRhGPCW4rPe_UvBZQ - UCFhXFikryT4aFcLkLw2LBLA - UCsBjURrPoezykLs9EqgamOA - UCHnyfMqiRRG1u-2MsSQLbXA - UC6biysICWOJ-C3P4Tyeggzg