Explorar o código

add last changes page

Johann ELSASS %!s(int64=4) %!d(string=hai) anos
pai
achega
fcb9f2adf3

+ 6 - 6
web/config.toml

@@ -1,7 +1,11 @@
 baseURL = "https://lazpaint.github.io/"
 defaultContentLanguage = "en"
 title = "download_lazpaint"
-disableKinds = ["taxonomy", "taxonomyTerm"]
+disableKinds = ["taxonomyTerm"]
+
+[params]
+  repo = "https://github.com/bgrabitmap/lazpaint/releases/download/"
+  version = "7.1.6"
 
 [languages]
   [languages.de]
@@ -32,7 +36,7 @@ disableKinds = ["taxonomy", "taxonomyTerm"]
     weight = 1
   [[menu.main]]
     name = "last_changes"
-    url = "https://github.com/bgrabitmap/lazpaint/releases"
+    url = "/last/"
     weight = 2
    [[menu.main]]
     name = "documentation"
@@ -50,7 +54,3 @@ disableKinds = ["taxonomy", "taxonomyTerm"]
     name = "forum"
     url = "https://forum.lazarus.freepascal.org/index.php/board,46.0.html"
     weight = 6    
-    
-[params]
-  repo = "https://github.com/bgrabitmap/lazpaint/releases/download/"
-  version = "7.1.6"

+ 7 - 0
web/content/last.md

@@ -0,0 +1,7 @@
+---
+title: "Last"
+date: 2021-01-10T23:37:53+01:00
+draft: false
+type: "page"
+layout: "last"
+---

+ 2 - 52
web/layouts/_default/baseof.html

@@ -1,57 +1,7 @@
-<!doctype html>
-<html lang="{{ .Language.Lang }}">
-  <head>
-    <meta charset="utf-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
-    {{ hugo.Generator -}}
-    {{ range $.Page.AllTranslations }}
-    <link rel="alternate" href="{{ .Permalink }}" hreflang="{{ .Language }}" />
-    {{- end }}
-    
-    {{ $img := "img/apple-touch-icon.png" | relURL -}}
-    <link rel="apple-touch-icon" sizes="180x180" href="{{ $img }}"/>
-    {{ $img := "img/favicon-32x32.png" | relURL -}}
-    <link rel="icon" type="image/png" sizes="32x32" href="{{ $img }}">
-    {{ $img := "img/favicon-16x16.png" | relURL -}}
-    <link rel="icon" type="image/png" sizes="16x16" href="{{ $img }}">
-    {{ $manifest := "site.webmanifest" | relURL -}}
-    <link rel="manifest" href="{{ $manifest }}">
-    {{ $img := "img/safari-pinned-tab.svg" | relURL -}}
-    <link rel="mask-icon" href="{{ $img }}" color="#5bbad5">
-    <meta name="msapplication-TileColor" content="#2d89ef">
-    <meta name="theme-color" content="PaleTurquoise">
-
-    {{ $css := "css/bootstrap.min.css" | relURL -}}
-    <link rel="stylesheet" href="{{ $css }}">
-    {{ $css := "css/style.css" | relURL -}}
-    <link rel="stylesheet" href="{{ $css }}">
-    
-    <title>{{ i18n .Title }}</title>
-  </head>
-  <body>
-    <div class="float-right d-inline-block m-1">
-    {{- $this := . -}}
-    {{- range $.Site.Home.AllTranslations -}}
-        {{- if eq $this.Site.Language .Language }}
-        <span class="btn btn-success">{{ .Language }}</span>
-        {{- else }}
-        <a href="{{ .Permalink }}" class="btn btn-light">{{ .Language }}</a>
-        {{- end -}}
-    {{- end }}
-    </div>
-    <div class="jumbotron jumbotron-fluid">
-        <div class="container">
-            {{ $img := "img/lazpaint_icon.png" | relURL -}}
-            <img class="logo" src="{{ $img }}" width="128" height="128" style="float: left" alt="LazPaint logo">
-            <h1 class="display-4">LazPaint</h1>
-            <p class="lead" style="color: #e0e0e0;">{{ i18n "app_description" }}</p>
-{{ partial "nav.html" . }}
-        </div>
-    </div>
+{{ partial "header.html" . }}
     <main id="main">{{ block "main" . }}{{ end }}
     </main>
     <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
         integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
         crossorigin="anonymous"></script>{{ block "dynamic" . }}{{ end }}
-  </body>
-</html>
+{{ partial "footer.html" . }}

+ 16 - 0
web/layouts/page/last.html

@@ -0,0 +1,16 @@
+{{ partial "header.html" . }}
+{{ $url := "https://api.github.com/repos/bgrabitmap/lazpaint/releases/latest" -}}
+{{ $last := getJSON $url -}}
+{{ $text := printf "\n%s" $last.body -}}
+{{ $text := replace $text "  *" "-" -}}
+{{ $text := replace $text "\n-" "\n•" -}}
+{{ $text := trim $text "\n\r\t " -}}
+<main id="main">
+	<div class="text-center download">
+		<div class="card2">
+			<h1>{{ $last.name }}<br/><a class="btn btn-primary" href="https://github.com/bgrabitmap/lazpaint">GitHub</a></h1>
+			<div class="text-left" style="white-space: pre-line; display: inline-block; padding-bottom: 2em">{{ $text }}</div>
+		</div>
+	</div>
+</main>
+{{ partial "footer.html" . }}

+ 2 - 0
web/layouts/partials/footer.html

@@ -0,0 +1,2 @@
+  </body>
+</html>

+ 50 - 0
web/layouts/partials/header.html

@@ -0,0 +1,50 @@
+<!doctype html>
+<html lang="{{ .Language.Lang }}">
+  <head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+    {{ hugo.Generator -}}
+    {{ range $.Page.AllTranslations }}
+    <link rel="alternate" href="{{ .Permalink }}" hreflang="{{ .Language }}" />
+    {{- end }}
+    
+    {{ $img := "img/apple-touch-icon.png" | relURL -}}
+    <link rel="apple-touch-icon" sizes="180x180" href="{{ $img }}"/>
+    {{ $img := "img/favicon-32x32.png" | relURL -}}
+    <link rel="icon" type="image/png" sizes="32x32" href="{{ $img }}">
+    {{ $img := "img/favicon-16x16.png" | relURL -}}
+    <link rel="icon" type="image/png" sizes="16x16" href="{{ $img }}">
+    {{ $manifest := "site.webmanifest" | relURL -}}
+    <link rel="manifest" href="{{ $manifest }}">
+    {{ $img := "img/safari-pinned-tab.svg" | relURL -}}
+    <link rel="mask-icon" href="{{ $img }}" color="#5bbad5">
+    <meta name="msapplication-TileColor" content="#2d89ef">
+    <meta name="theme-color" content="PaleTurquoise">
+
+    {{ $css := "css/bootstrap.min.css" | relURL -}}
+    <link rel="stylesheet" href="{{ $css }}">
+    {{ $css := "css/style.css" | relURL -}}
+    <link rel="stylesheet" href="{{ $css }}">
+    
+    <title>{{ i18n .Title }}</title>
+  </head>
+  <body>
+    <div class="float-right d-inline-block m-1">
+    {{- $this := . -}}
+    {{- range $.Site.Home.AllTranslations -}}
+        {{- if eq $this.Site.Language .Language }}
+        <span class="btn btn-success">{{ .Language }}</span>
+        {{- else }}
+        <a href="{{ .Permalink }}" class="btn btn-light">{{ .Language }}</a>
+        {{- end -}}
+    {{- end }}
+    </div>
+    <div class="jumbotron jumbotron-fluid">
+        <div class="container">
+            {{ $img := "img/lazpaint_icon.png" | relURL -}}
+            <img class="logo" src="{{ $img }}" width="128" height="128" style="float: left" alt="LazPaint logo">
+            <h1 class="display-4">LazPaint</h1>
+            <p class="lead" style="color: #e0e0e0;">{{ i18n "app_description" }}</p>
+{{ partial "nav.html" . }}
+        </div>
+    </div>

+ 5 - 1
web/layouts/partials/nav.html

@@ -4,7 +4,11 @@
                 {{- range .Site.Menus.main -}}
                     {{- $item := newScratch -}}
                     {{- $item.Set "Text" (print .Name | safeHTML) -}}
-                    {{- $item.Set "URL" (relLangURL .URL) -}}
+                    {{- if ne .Name "last_changes" -}}
+                        {{- $item.Set "URL" (relLangURL .URL) -}}
+                    {{- else -}}
+                        {{- $item.Set "URL" (relURL .URL) -}}
+                    {{- end -}}
                     {{- if and (eq .Name "documentation") (ne $page.Language.Lang "en") -}}
                         {{- $item.Set "URL" (printf "%s/%s" ($item.Get "URL") $page.Language.Lang) -}}
                     {{- end -}}

+ 8 - 1
web/static/css/style.css

@@ -4,6 +4,7 @@
 
 body {
     background-color: black;
+    color: #f0f0f0;
 }
 
 .logo {
@@ -44,7 +45,13 @@ body {
 }
 
 .download .card {
-    background-color: rgba(0, 0, 0, 0.3);
+    background-color: rgba(0, 0, 0, 0.4);
+    min-height: 100vh;
+    box-shadow: inset 0 0 100px rgb(6, 44, 87);
+}
+
+.download .card2 {
+    background-color: rgba(0, 0, 0, 0.6);
     min-height: 100vh;
     box-shadow: inset 0 0 100px rgb(6, 44, 87);
 }