1
0
mirror of https://github.com/typemill/typemill.git synced 2025-07-25 00:02:28 +02:00

add autorefresh for navigation, demo to readmy, remove deprecation errors from reporting

This commit is contained in:
trendschau
2025-07-07 22:19:20 +02:00
parent 60f28fc43a
commit 2c8272b330
6 changed files with 35 additions and 3 deletions

3
cache/timer.yaml vendored
View File

@@ -1 +1,2 @@
licenseupdate: 1751571979
licenseupdate: 1751827655
refreshnavi: 1751919486

View File

@@ -0,0 +1,6 @@
meta:
modified: false
author: Sebastian
created: '2025-07-07'
time: 20-11-46
navtitle: new

View File

@@ -2,7 +2,7 @@
Typemill is an open-source flat-file CMS for creating websites and eBooks with markdown files. Its commonly used for informational websites such as user manuals, documentation, knowledge bases, wikis, and handbooks.
Learn more at [typemill.net](https://typemill.net) or get started with the [starter guide](https://docs.typemill.net/getting-started).
Learn more at [typemill.net](https://typemill.net), check the [demo installation](https://try.typemill.net), or get started with the [starter guide](https://docs.typemill.net/getting-started).
![Typemill Screenshot](/typemill.webp)

View File

@@ -8,6 +8,7 @@ use Slim\Routing\RouteContext;
use Typemill\Models\Navigation;
use Typemill\Models\Content;
use Typemill\Models\Meta;
use Typemill\Models\StorageWrapper;
use Typemill\Events\OnPagetreeLoaded;
use Typemill\Events\OnBreadcrumbLoaded;
use Typemill\Events\OnItemLoaded;
@@ -31,6 +32,21 @@ class ControllerWebFrontend extends Controller
# GET THE NAVIGATION
$navigation = new Navigation();
# CLEAR NAVIGATION IF MODE WITHOUT ADMIN
if(isset($this->settings['autorefresh']) && $this->settings['autorefresh'] == true)
{
$interval = (int) ($this->settings['refreshtimer'] ?? 10);
$interval = $interval * 60; # seconds
$storage = new StorageWrapper('\Typemill\Models\Storage');
$timeoutIsOver = $storage->timeoutIsOver('refreshnavi', $interval);
if($timeoutIsOver === true)
{
$navigation->clearNavigation();
}
}
$draftNavigation = $navigation->getFullDraftNavigation($urlinfo, $langattr);
$home = false;

View File

@@ -264,6 +264,15 @@ fieldsetdeveloper:
type: checkbox
label: "Twig cache"
checkboxlabel: "Activate the cache for twig templates"
autorefresh:
type: checkbox
label: "Auto-Refresh Navigation"
checkboxlabel: "Enable to refresh the navigation automatically at regular intervals"
refreshtimer:
type: number
label: "Refresh Interval (Minutes)"
placeholder: 10
description: "Define how often the navigation should be refreshed (in minutes)"
proxy:
type: checkbox
label: "Proxy"

View File

@@ -54,7 +54,7 @@ $display_errors = 0;
ini_set('display_errors', $display_errors);
ini_set('display_startup_errors', 0);
error_reporting(E_ALL);
error_reporting(E_ALL & ~E_DEPRECATED);
/****************************
* LOAD SETTINGS *