From 5c406d2903f3687ae23b9f4126ae0d2719862dbf Mon Sep 17 00:00:00 2001 From: Yuri Sizov <11782833+YuriSizov@users.noreply.github.com> Date: Wed, 17 May 2023 20:36:53 +0200 Subject: [PATCH] Add a download page for preview builds (#640) - Make downloads data-driven, create a database of versions; - Add a custom plugin to generate download URLs; - Use the new plugin for the regular downloads page as well. --- .editorconfig | 5 + .gitignore | 26 + README.md | 32 +- _data/download_configs.yml | 53 ++ _data/download_platforms.yml | 80 +++ _data/versions.yml | 263 +++++++++- _includes/header.html | 2 +- _layouts/default.html | 2 +- _layouts/download-3.html | 186 ++++--- _layouts/download.html | 184 ++++--- _layouts/showcase-item.html | 18 +- _plugins/make_download.rb | 127 +++++ _plugins/outdated_article_threshold.rb | 23 +- assets/css/download.css | 56 ++- assets/css/main.css | 8 +- .../download/download-background-preview.jpg | Bin 0 -> 176094 bytes assets/icons/android.svg | 1 - assets/{ => icons}/arrow-flip.svg | 0 assets/{ => icons}/cross.svg | 0 assets/{ => icons}/hamburger.svg | 0 assets/icons/linux-server.svg | 1 - assets/icons/linux.svg | 121 ----- assets/icons/macos.svg | 1 - assets/icons/search.svg | 2 +- assets/icons/switch.svg | 114 ----- assets/icons/windows.svg | 1 - assets/images/platforms/android.svg | 1 + assets/{icons => images/platforms}/ios.svg | 0 assets/images/platforms/linux-server.svg | 1 + assets/images/platforms/linux.svg | 1 + assets/images/platforms/macos.svg | 1 + .../platforms}/playstation.svg | 0 assets/images/platforms/switch.svg | 1 + assets/images/platforms/templates.svg | 1 + .../html5.svg => images/platforms/web.svg} | 0 assets/images/platforms/windows.svg | 1 + assets/{icons => images/platforms}/xbox.svg | 0 collections/_download/android.md | 13 +- collections/_download/linux.md | 26 +- collections/_download/macos.md | 15 +- collections/_download/windows.md | 24 +- collections/_download_3/android.md | 13 +- collections/_download_3/linux.md | 26 +- collections/_download_3/macos.md | 13 +- collections/_download_3/server.md | 24 +- collections/_download_3/windows.md | 24 +- pages/download/preview.html | 454 ++++++++++++++++++ pages/features.html | 17 +- pages/home.html | 6 +- pages/showcase.html | 36 +- 50 files changed, 1403 insertions(+), 601 deletions(-) create mode 100644 _data/download_configs.yml create mode 100644 _data/download_platforms.yml create mode 100644 _plugins/make_download.rb create mode 100644 assets/download/download-background-preview.jpg delete mode 100644 assets/icons/android.svg rename assets/{ => icons}/arrow-flip.svg (100%) rename assets/{ => icons}/cross.svg (100%) rename assets/{ => icons}/hamburger.svg (100%) delete mode 100644 assets/icons/linux-server.svg delete mode 100644 assets/icons/linux.svg delete mode 100644 assets/icons/macos.svg delete mode 100644 assets/icons/switch.svg delete mode 100644 assets/icons/windows.svg create mode 100644 assets/images/platforms/android.svg rename assets/{icons => images/platforms}/ios.svg (100%) create mode 100644 assets/images/platforms/linux-server.svg create mode 100644 assets/images/platforms/linux.svg create mode 100644 assets/images/platforms/macos.svg rename assets/{icons => images/platforms}/playstation.svg (100%) create mode 100644 assets/images/platforms/switch.svg create mode 100644 assets/images/platforms/templates.svg rename assets/{icons/html5.svg => images/platforms/web.svg} (100%) create mode 100644 assets/images/platforms/windows.svg rename assets/{icons => images/platforms}/xbox.svg (100%) create mode 100644 pages/download/preview.html diff --git a/.editorconfig b/.editorconfig index 626854d068..e552c0886f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,3 +11,8 @@ trim_trailing_whitespace = true [*.{yml,yaml}] indent_style = space indent_size = 2 + +# Ruby scripts and plugins for Jekyll +[*.rb] +indent_style = space +indent_size = 2 diff --git a/.gitignore b/.gitignore index e25f7e5836..9fc5610776 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,29 @@ vendor/ asset-library/ mirrorlist/ qa/ + +# OS-specific files + +# Linux +*~ +.directory + +# macOS +.DS_Store +__MACOSX + +# Windows +# https://github.com/github/gitignore/blob/main/Global/Windows.gitignore +[Tt]humbs.db +[Tt]humbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db +*.stackdump +[Dd]esktop.ini +$RECYCLE.BIN/ +*.cab +*.msi +*.msix +*.msm +*.msp +*.lnk diff --git a/README.md b/README.md index cbb37c90f5..9021e31f53 100644 --- a/README.md +++ b/README.md @@ -152,18 +152,34 @@ locally, some configuration options may need to be different. To define those, ` ### Updating Godot download version -When a new stable build of the engine is released, you need to add its number and date to the `data/_versions.yml` -file. It has several lists, one for each maintained major version of Godot. Pick the correct one, and **at the top of the list** -add something similar to the following: +All download information on the website is data-driven. This means that to change the information about the current +stable version, or on-going version previews, you don't need to modify pages directly. Instead, data files must be +updated. + +The main file for keeping track of every official version is `data/_versions.yml`. It contains exactly one record +per each official release, including pre-releases. This file should be updated every time there is a new official +build available for download. + +To create a new version, add the following block to the file: ``` - - name: "4.0.1" - flavor: "stable" - release_date: "17 March 2023" +- name: "4.0.1" + flavor: "stable" + release_date: "20 March 2023" + release_notes: "/article/maintenance-release-godot-4-0-1/" ``` -After this change is merged and the website is built, everything referencing the engine version should be updated -automatically, including download links for every platform. +Make sure to order entries correctly, with the higher version number being closer to the top. Use the `flavor` field +to mark release as stable or as one of the pre-release builds. Make sure to always fill out the release date, and the release +notes link, if available. + +When a new build for an existing version is published, update its corresponding block, changing the flavor and the release +information. Make sure to update this information when publishing the release notes. + +There are two additional files providing data for download pages and links: `_data/download_configs.yml` and +`_data/download_platforms.yml`. These files don't normally require changes and are used as a static reference table. +They define descriptions, tags, and filename slugs for all downloadable builds, as well as order for downloads on +some pages. ## Resources diff --git a/_data/download_configs.yml b/_data/download_configs.yml new file mode 100644 index 0000000000..1fca931508 --- /dev/null +++ b/_data/download_configs.yml @@ -0,0 +1,53 @@ +defaults: + 4: + templates: export_templates.tpz + editor: + android.apk: android_editor.apk + linux.64: linux.x86_64.zip + linux.32: linux.x86_32.zip + macos.universal: macos.universal.zip + windows.64: win64.exe.zip + windows.32: win32.exe.zip + web: web_editor.zip + extras: + aar_library: template_release.aar + + mono: + templates: mono_export_templates.tpz + editor: + linux.64: mono_linux_x86_64.zip + linux.32: mono_linux_x86_32.zip + macos.universal: mono_macos.universal.zip + windows.64: mono_win64.zip + windows.32: mono_win32.zip + + 3: + templates: export_templates.tpz + editor: + android.apk: android_editor.apk + linux.64: x11.64.zip + linux.32: x11.32.zip + macos.universal: osx.universal.zip + windows.64: win64.exe.zip + windows.32: win32.exe.zip + linux_server.headless.64: linux_headless.64.zip + linux_server.64: linux_server.64.zip + web: web_editor.zip + extras: + aar_library: release.aar + + mono: + templates: mono_export_templates.tpz + editor: + linux.64: mono_x11_64.zip + linux.32: mono_x11_32.zip + macos.universal: mono_osx.universal.zip + windows.64: mono_win64.zip + windows.32: mono_win32.zip + linux_server.headless.64: mono_linux_headless_64.zip + linux_server.64: mono_linux_server_64.zip + extras: + aar_library: mono.release.aar + + 2: + 1: diff --git a/_data/download_platforms.yml b/_data/download_platforms.yml new file mode 100644 index 0000000000..a5494e8bf4 --- /dev/null +++ b/_data/download_platforms.yml @@ -0,0 +1,80 @@ +- name: "templates" + title: "Export templates" + caption: "" + tags: + - "Used to export your games to all supported platforms" + +- name: "aar_library" + title: "AAR library" + caption: "" + tags: + - Android plugins + - Java + - Kotlin + +- name: "android.apk" + title: "Android" + caption: "Universal APK (ARM64 + ARMv7 + x86_64 + x86)" + tags: + - APK download + - ARM64/v7 + - x86 (64 & 32 bit) + +- name: "android.playstore" + title: "Android" + caption: "Play Store Universal (ARM64 + ARMv7 + x86_64 + x86)" + tags: + - Play Store + - ARM64/v7 + - x86 (64 & 32 bit) + +- name: "linux.32" + title: "Linux" + caption: "Standard (x86)" + tags: + - 32 bit + +- name: "linux.64" + title: "Linux" + caption: "Standard (x86_64)" + tags: + - 64 bit + +- name: "linux_server.64" + title: "Linux Server" + caption: "Standard (x86_64)" + tags: + - 64 bit + +- name: "linux_server.headless.64" + title: "Linux Server" + caption: "Headless (x86_64)" + tags: + - 64 bit + - Headless + +- name: "macos.universal" + title: "macOS" + caption: "Universal (x86_64 + Apple Silicon)" + tags: + - Intel/Apple Silicon + - 64 bit + +- name: "web" + title: "Web editor" + caption: "" + tags: + - Self-hosted + - Cross-platform + +- name: "windows.32" + title: "Windows" + caption: "Standard (x86)" + tags: + - 32 bit + +- name: "windows.64" + title: "Windows" + caption: "Standard (x86_64)" + tags: + - 64 bit diff --git a/_data/versions.yml b/_data/versions.yml index 7144b3d68f..6906b7c093 100644 --- a/_data/versions.yml +++ b/_data/versions.yml @@ -1,17 +1,246 @@ -godot_3: - - name: "3.5.2" - flavor: "stable" - release_date: "7 March 2023" - - name: "3.5.1" - flavor: "stable" - release_date: "28 September 2022" -godot_4: - - name: "4.0.2" - flavor: "stable" - release_date: "4 April 2023" - - name: "4.0.1" - flavor: "stable" - release_date: "20 March 2023" - - name: "4.0" - flavor: "stable" - release_date: "1 March 2023" +- name: "4.1" + flavor: "dev2" + release_date: "10 May 2023" + release_notes: "/article/dev-snapshot-godot-4-1-dev-2/" + +- name: "4.0.3" + flavor: "rc2" + release_date: "12 May 2023" + release_notes: "/article/release-candidate-godot-4-0-3-rc-2/" + +- name: "4.0.2" + flavor: "stable" + release_date: "4 April 2023" + release_notes: "/article/maintenance-release-godot-4-0-2/" + featured: "4" + +- name: "4.0.1" + flavor: "stable" + release_date: "20 March 2023" + release_notes: "/article/maintenance-release-godot-4-0-1/" + +- name: "4.0" + flavor: "stable" + release_date: "1 March 2023" + release_notes: "/article/godot-4-0-sets-sail/" + +- name: "3.6" + flavor: "beta1" + release_date: "13 April 2023" + release_notes: "/article/dev-snapshot-godot-3-6-beta-1/" + +- name: "3.5.2" + flavor: "stable" + release_date: "7 March 2023" + release_notes: "/article/maintenance-release-godot-3-5-2/" + featured: "3" + +- name: "3.5.1" + flavor: "stable" + release_date: "28 September 2022" + release_notes: "/article/maintenance-release-godot-3-5-1/" + +- name: "3.5" + flavor: "stable" + release_date: "" + release_notes: "/article/godot-3-5-cant-stop-wont-stop/" + +- name: "3.4.5" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-3-4-5/" + +- name: "3.4.4" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-3-4-4/" + +- name: "3.4.3" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-3-4-3/" + +- name: "3.4.2" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-3-4-2/" + +- name: "3.4.1" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-3-4-1/" + +- name: "3.4" + flavor: "stable" + release_date: "" + release_notes: "/article/godot-3-4-is-released/" + +- name: "3.3.4" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-3-3-4/" + +- name: "3.3.3" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-3-3-3/" + +- name: "3.3.2" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-3-3-2/" + +- name: "3.3.1" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-3-3-1/" + +- name: "3.3" + flavor: "stable" + release_date: "" + release_notes: "/article/godot-3-3-has-arrived/" + +- name: "3.2.3" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-3-2-3/" + +- name: "3.2.2" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-3-2-2/" + +- name: "3.2.1" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-3-2-1/" + +- name: "3.2" + flavor: "stable" + release_date: "" + release_notes: "/article/here-comes-godot-3-2/" + +- name: "3.1.2" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-3-1-2/" + +- name: "3.1.1" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-3-1-1/" + +- name: "3.1" + flavor: "stable" + release_date: "" + release_notes: "/article/godot-3-1-released/" + +- name: "3.0.6" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-3-0-6/" + +- name: "3.0.5" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-3-0-5/" + +- name: "3.0.4" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-3-0-4/" + +- name: "3.0.3" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-3-0-3/" + +- name: "3.0.2" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-302/" + +- name: "3.0.1" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-3-0-1/" + +- name: "3.0" + flavor: "stable" + release_date: "" + release_notes: "/article/godot-3-0-released/" + +- name: "2.1.6" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-2-1-6/" + +- name: "2.1.5" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-2-1-5/" + +- name: "2.1.4" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-2-1-4/" + +- name: "2.1.3" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-2-1-3/" + +- name: "2.1.2" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-2-1-2/" + +- name: "2.1.1" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-2-1-1/" + +- name: "2.1" + flavor: "stable" + release_date: "" + release_notes: "/article/godot-reaches-2-1-stable/" + +- name: "2.0.4.1" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-2-0-4/" + +- name: "2.0.4" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-2-0-4/" + +- name: "2.0.3" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-2-0-3/" + +- name: "2.0.2" + flavor: "stable" + release_date: "" + release_notes: "/article/maintenance-release-godot-2-0-2/" + +- name: "2.0.1" + flavor: "stable" + release_date: "" + release_notes: "/article/updates-on-the-release-cycle-and-godot-2-0-1/" + +- name: "2.0" + flavor: "stable" + release_date: "" + release_notes: "/article/godot-engine-reaches-2-0-stable/" + +- name: "1.1" + flavor: "stable" + release_date: "" + release_notes: "/article/godot-1-1-out/" + +- name: "1.0" + flavor: "stable" + release_date: "" + release_notes: "/article/godot-engine-reaches-1-0/" diff --git a/_includes/header.html b/_includes/header.html index 3ed88bc13b..01c0df7de2 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -7,7 +7,7 @@ diff --git a/_layouts/default.html b/_layouts/default.html index 0a8b86f301..ae708c423a 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -21,7 +21,7 @@ - + diff --git a/_layouts/download-3.html b/_layouts/download-3.html index 8e1bcdfdd0..836abbeba4 100644 --- a/_layouts/download-3.html +++ b/_layouts/download-3.html @@ -18,7 +18,7 @@ layout: default } -{% assign stable_version = site.data.versions.godot_3 | find: "flavor", "stable" %} +{% assign stable_version = site.data.versions | find: "featured", "3" %}
@@ -28,26 +28,28 @@ layout: default {% assign featured_downloads = page.downloads | where: "featured", "true" %} {% for download in featured_downloads %} - {% capture download_url %} - {% if download.custom %} - {{download.custom}} - {% else %} - https://github.com/godotengine/godot/releases/download/{{stable_version.name}}-stable/Godot_v{{stable_version.name}}-stable_{{ download.slug }} - {% endif %} - {% endcapture %} + {% capture download_url %} + {% if download.custom %} + {{ download.custom }} + {% else %} + {{ stable_version | make_download: download.platform, download.mono }} + {% endif %} + {% endcapture %} -
- -
- ({{ page.platform }}) - Godot Engine{% if download.featured_flavor %} - {{ download.featured_flavor }}{% endif %} -
-
{{ stable_version.name }}
-
-

- {% for tag in download.tags %}{{ tag }} · {% endfor %}{{ stable_version.release_date }} -

-
+ {% assign platform_info = site.data.download_platforms | find: "name", download.platform %} + +
+ +
+ ({{ page.platform }}) + Godot Engine{% if download.featured_flavor %} - {{ download.featured_flavor }}{% endif %} +
+
{{ stable_version.name }}
+
+

+ {% for tag in platform_info.tags %}{{ tag }} · {% endfor %}{% if download.mono %}C# support · {% endif %}{{ stable_version.release_date }} +

+
{% endfor %} @@ -70,7 +72,7 @@ layout: default