From 5d1f9f5195b429255dc0cc7487cd8a8f18a8fd51 Mon Sep 17 00:00:00 2001 From: Chris Josten Date: Mon, 25 Dec 2023 14:01:05 +0100 Subject: [PATCH] Update docs, show only updated apps In the previous commit, all updated packages were shown in the sidebar, instead of apps. This commit reverts that change, because apps are usually more relevant to users. It may make more sense to display recently updated packages on the page that showcase packages, but that can be done later. --- ARCHITECTURE.md | 3 +++ chumweb/static_site_gen.py | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index b7ff008..07a1528 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -28,6 +28,9 @@ sequenceDiagram #### [chumweb/\_\_main\_\_.py](chumweb/__main__.py) Contains the main function. +#### [chumweb/atom_feed.py](chumweb/atom_feed.py) +Contains functions for creating Atom feeds. + #### [chumweb/config.py](chumweb/config.py) Contains the definitions of all settings that can be set via environment variables or command line options. diff --git a/chumweb/static_site_gen.py b/chumweb/static_site_gen.py index 86ec547..3acd1b5 100644 --- a/chumweb/static_site_gen.py +++ b/chumweb/static_site_gen.py @@ -1,7 +1,6 @@ """ This module generates the static website """ -import dataclasses import json import os import random @@ -118,7 +117,7 @@ def render_template(template: Template, out_file: str | Path, **kwargs): kwargs["chum_installer"] = "sailfishos-chum-gui-installer" kwargs["config"] = CONFIG kwargs["repo_version"] = repo_info.version - kwargs["recently_updated_pkgs"] = recently_updated_pkgs[:CONFIG.updated_apps_count] + kwargs["recently_updated_pkgs"] = recently_updated_apps[:CONFIG.updated_apps_count] kwargs["feeds"] = feeds template.stream(**kwargs).dump(str(out_file)) @@ -268,7 +267,7 @@ def create_package_page(pkg: Package): render_template(pkg_template, str(out_file), pkg=pkg) - total_sitegen_steps = 5 + total_sitegen_steps = 6 step_progress(sitegen_step, "Creating directory structure", 1, total_sitegen_steps) recreate_directory_skeleton() copy_static_dirs() @@ -319,6 +318,7 @@ def create_package_page(pkg: Package): json.dump(search_documents, packages_file) # Write Atom feeds + step_progress(sitegen_step, "Generating atom feeds", 6, total_sitegen_steps) for feed in feeds: xml = create_package_atom_feed(feed.pkgs[:CONFIG.feed_updated_apps_count], feed.url, feed.title) with open(www_path.joinpath(feed.path), "w") as atom_file: