Commit 79ba26e9 authored by Phu Nguyen's avatar Phu Nguyen
Browse files

Auto update images of new Plasma releases

- For home page and Plasma page
- Needs to have an updated image from kde-hugo
parent f9bd55fe
......@@ -9,7 +9,7 @@
display: flex;
align-items: center;
justify-content: center;
background-image: url(/announcements/plasma/5/5.24.0/wavy-mcwallpaperface-blur.jpg);
background-image: url(/reusable-assets/home-blur.jpg);
height: 350px;
background-position: center center;
background-size: cover;
......
......@@ -8,9 +8,6 @@ description: "Plasma is KDE's desktop environment. Simple by default, powerful w
type: plasma-desktop
get: Get Plasma for your device
buy: Buy a device with Plasma
plasma_release: About Plasma 5.24
plasma_release_desc: "Plasma 5.24 improves in looks, ease of use and consistency."
plasma_release_title: "Latest Release: Plasma 5.24"
see_announcements: See Announcements
parts:
- title: Simple by default
......
......@@ -397,6 +397,12 @@ compile-gear-desc:
package-distro:
other: Note that packages of this release might not be available on all distributions at the time of this announcement.
plasma.release.bar:
other: About Plasma %1
comment: '%1 version number'
plasma.release.title:
other: 'Latest Release: Plasma %1'
comment: '%1 version number'
plasma.connect.replay:
other: Replay
......
......@@ -4,17 +4,21 @@
{{ end }}
{{ define "main" }}
{{- $latest := partialCached "fn/latest_plasma" . "plasma" }}
{{- $major := index $latest 1 }}
{{- $majMin := print $major "." (index $latest 2) }}
{{- $srcLink := printf "/announcements/plasma/%s/%s.0/fullscreen_with_apps.png" $major $majMin }}
<main id="home">
<section class="text-center py-4 mt-0 header-plasma20" style="background-image: url(/announcements/plasma/5/5.24.0/wavy-mcwallpaperface-blur.jpg);background-size:cover; color: white">
<section class="text-center py-4 mt-0 header-plasma20" style="background-image: url(/reusable-assets/home-blur.jpg);background-size:cover; color: white">
<h1>{{ i18n "plasma" }}</h1>
<h2>{{ i18n "plasma-desc" }}</h2>
<div class="laptop-with-overlay d-block mt-5 mb-3 mx-auto w-100" style="max-width: 1000px">
<img class="laptop img-fluid" src="/reusable-assets/laptop.svg" alt="empty laptop with an overlay" width=2000 height=1220>
<div class="laptop-overlay">
<picture>
<source srcset="/announcements/plasma/5/5.24.0/fullscreen_with_apps.png" media="(prefers-color-scheme: dark)" type="image/webp">
<source srcset="/announcements/plasma/5/5.24.0/fullscreen_with_apps.png" media="(prefers-color-scheme: light)" type="image/webp">
<img class="img-fluid" src="/announcements/plasma/5/5.24.0/fullscreen_with_apps.png" alt="Plasma" />
<source srcset="{{ $srcLink }}" media="(prefers-color-scheme: dark)" type="image/webp">
<source srcset="{{ $srcLink }}" media="(prefers-color-scheme: light)" type="image/webp">
<img class="img-fluid" src="{{ $srcLink }}" alt="Plasma" />
</picture>
</div>
</div>
......
{{/*
SPDX-FileCopyrightText: 2022 Phu Hung Nguyen <phu.nguyen@kdemail.net>
SPDX-License-Identifier: LGPL-3.0-or-later
*/}}
{{- $anncListPage := site.GetPage "/announcements" }}
{{- $firstAnncListPage := index $anncListPage.AllTranslations 0 }}
{{- $anncs := $anncListPage.RegularPagesRecursive }}
{{- if ne $anncListPage $firstAnncListPage }}
{{- $anncs = $anncs | lang.Merge $firstAnncListPage.RegularPagesRecursive }}
{{- end }}
{{- $old := $firstAnncListPage.GetPage "plasma/5/5.1.0" }}
{{- $page := $old }}
{{/* we don't want to loop too much but should loop enough to find a .0 release */}}
{{- range (first 30 $anncs) }}
{{- if and (eq $page $old) (hasPrefix .File.Dir "announcements/plasma/") }}
{{- $patchVersion := index (split .File.TranslationBaseName ".") 2 }}
{{- if eq $patchVersion "0" }}
{{- $page = . }}
{{- end }}
{{- end }}
{{- end }}
{{- $latestVersion := $page.File.TranslationBaseName }}
{{- $major := index (split $latestVersion ".") 0 }}
{{- $minor := index (split $latestVersion ".") 1 }}
{{- return (slice $page $major $minor) }}
{{ define "main" }}
{{- $latest := partialCached "fn/latest_plasma" . "plasma" }}
{{- $latestPage := index $latest 0 }}
{{- $major := index $latest 1 }}
{{- $majMin := print $major "." (index $latest 2) }}
<main>
<section class="container">
<div class="text-center">
......@@ -6,7 +10,7 @@
<div class="laptop-with-overlay d-block mt-5 mb-3 mx-auto w-100" style="max-width: 1000px">
<img class="laptop img-fluid" src="/reusable-assets/laptop.svg" alt="">
<div class="laptop-overlay">
<img class="img-fluid" src="/announcements/plasma/5/5.24.0/fullscreen_with_apps.png" alt="{{ i18n "plasma" }} ">
<img class="img-fluid" src="/announcements/plasma/{{ $major }}/{{ $majMin }}.0/fullscreen_with_apps.png" alt="{{ i18n "plasma" }} ">
</div>
</div>
<p>
......@@ -23,7 +27,7 @@
<div class="breeze-window">
<div class="kwin-shadow">
<div class="headerbar">
{{ .Params.plasma_release }}
{{ partial "fn/i18n_args" (slice "plasma.release.bar" $majMin) }}
<img
alt=""
src="/content/plasma-desktop/window-minimize.svg"
......@@ -41,9 +45,9 @@
/>
</div>
<div class="view">
<h2>{{ .Params.plasma_release_title }}</h2>
<p>{{ .Params.plasma_release_desc }}</p>
<a href="/announcements/plasma/5/5.24.0" class="breeze-button">{{ .Params.see_announcements }}</a><br />
<h2>{{ partial "fn/i18n_args" (slice "plasma.release.title" $majMin) }}</h2>
<p>{{ $latestPage.Description }}</p>
<a href="{{ $latestPage.Permalink }}" class="breeze-button">{{ .Params.see_announcements }}</a><br />
</div>
</div>
</div>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment