- {{ escapeTitle(title, url, config.dangerouslyDisableAutoEscaping, config.showTitleAsUrl) }}
+ {% if config.showAsList %}
+
+ {% if (config.showSourceTitle and sourceTitle) or config.showPublishDate %}
+
+ {% if sourceTitle and config.showSourceTitle %}
+ {{ escapeText(sourceTitle, config.dangerouslyDisableAutoEscaping) }}{% if config.showPublishDate %},{% else %}:{% endif %}
+ {% endif %}
+ {% if config.showPublishDate %}{{ publishDate }}:{% endif %}
- {% endif %}
-{% elseif empty %}
-
{{ "NEWSFEED_NO_ITEMS" | translate | safe }}
-{% elseif error %}
-
- {{ "MODULE_CONFIG_ERROR" | translate({MODULE_NAME: "Newsfeed", ERROR: error}) | safe }}
+ {% endif %}
+
{{ escapeTitle(title, url, config.dangerouslyDisableAutoEscaping, config.showTitleAsUrl) }}
+ {% if config.showDescription %}
+
+ {% if config.truncDescription %}
+ {{ escapeText(description | truncate(config.lengthDescription) , config.dangerouslyDisableAutoEscaping) }}
+ {% else %}
+ {{ escapeText(description, config.dangerouslyDisableAutoEscaping) }}
+ {% endif %}
+
+ {% endif %}
+ {% endif %}
+ {% elseif empty %}
+
{{ "NEWSFEED_NO_ITEMS" | translate | safe }}
+ {% elseif error %}
+
{{ "MODULE_CONFIG_ERROR" | translate({MODULE_NAME: "Newsfeed", ERROR: error}) | safe }}
{% else %}
-
{{ "LOADING" | translate | safe }}
+
{{ "LOADING" | translate | safe }}
{% endif %}
diff --git a/modules/default/newsfeed/oldconfig.njk b/modules/default/newsfeed/oldconfig.njk
index 0e3b9b5d..d8317ca2 100644
--- a/modules/default/newsfeed/oldconfig.njk
+++ b/modules/default/newsfeed/oldconfig.njk
@@ -1,3 +1 @@
-
- {{ "MODULE_CONFIG_CHANGED" | translate({MODULE_NAME: "Newsfeed"}) | safe }}
-
+
{{ "MODULE_CONFIG_CHANGED" | translate({MODULE_NAME: "Newsfeed"}) | safe }}
diff --git a/modules/default/updatenotification/updatenotification.njk b/modules/default/updatenotification/updatenotification.njk
index fbc43f22..b08346f3 100644
--- a/modules/default/updatenotification/updatenotification.njk
+++ b/modules/default/updatenotification/updatenotification.njk
@@ -1,41 +1,41 @@
{% if not suspended %}
- {% if needRestart %}
-
-
-
- {% set restartTextLabel = "UPDATE_NOTIFICATION_NEED-RESTART" %}
- {{ restartTextLabel | translate() | safe }}
-
-
- {% endif %}
- {% for name, status in moduleList %}
-
-
-
- {% set mainTextLabel = "UPDATE_NOTIFICATION" if name === "MagicMirror" else "UPDATE_NOTIFICATION_MODULE" %}
- {{ mainTextLabel | translate({MODULE_NAME: name}) }}
-
-
-
- {% set subTextLabel = "UPDATE_INFO_SINGLE" if status.behind === 1 else "UPDATE_INFO_MULTIPLE" %}
- {{ subTextLabel | translate({COMMIT_COUNT: status.behind, BRANCH_NAME: status.current}) | diffLink(status) | safe }}
-
- {% endfor %}
- {% for name, status in updatesList %}
-
- {% if status.done %}
-
-
- {% set updateTextLabel = "UPDATE_NOTIFICATION_DONE" %}
- {{ updateTextLabel | translate({MODULE_NAME: name}) | safe }}
-
- {% else %}
-
-
- {% set updateTextLabel = "UPDATE_NOTIFICATION_ERROR" %}
- {{ updateTextLabel | translate({MODULE_NAME: name}) | safe }}
-
- {% endif %}
-
- {% endfor %}
+ {% if needRestart %}
+
+
+
+ {% set restartTextLabel = "UPDATE_NOTIFICATION_NEED-RESTART" %}
+ {{ restartTextLabel | translate() | safe }}
+
+
+ {% endif %}
+ {% for name, status in moduleList %}
+
+
+
+ {% set mainTextLabel = "UPDATE_NOTIFICATION" if name === "MagicMirror" else "UPDATE_NOTIFICATION_MODULE" %}
+ {{ mainTextLabel | translate({MODULE_NAME: name}) }}
+
+
+
+ {% set subTextLabel = "UPDATE_INFO_SINGLE" if status.behind === 1 else "UPDATE_INFO_MULTIPLE" %}
+ {{ subTextLabel | translate({COMMIT_COUNT: status.behind, BRANCH_NAME: status.current}) | diffLink(status) | safe }}
+
+ {% endfor %}
+ {% for name, status in updatesList %}
+
+ {% if status.done %}
+
+
+ {% set updateTextLabel = "UPDATE_NOTIFICATION_DONE" %}
+ {{ updateTextLabel | translate({MODULE_NAME: name}) | safe }}
+
+ {% else %}
+
+
+ {% set updateTextLabel = "UPDATE_NOTIFICATION_ERROR" %}
+ {{ updateTextLabel | translate({MODULE_NAME: name}) | safe }}
+
+ {% endif %}
+
+ {% endfor %}
{% endif %}
diff --git a/modules/default/weather/current.njk b/modules/default/weather/current.njk
index d1984895..0de73f8e 100644
--- a/modules/default/weather/current.njk
+++ b/modules/default/weather/current.njk
@@ -1,101 +1,95 @@
{% macro humidity() %}
- {% if current.humidity %}
-
{{ current.humidity | decimalSymbol }}
- {% endif %}
+ {% if current.humidity %}
+
{{ current.humidity | decimalSymbol }}
+ {% endif %}
{% endmacro %}
{% if current %}
- {% if not config.onlyTemp %}
-
-
-
- {{ current.windSpeed | unit("wind") | round }}
- {% if config.showWindDirection %}
-
- {% if config.showWindDirectionAsArrow %}
-
- {% else %}
- {{ current.cardinalWindDirection() | translate }}
- {% endif %}
-
-
- {% endif %}
-
- {% if config.showHumidity === "wind" %}
- {{ humidity() }}
+ {% if not config.onlyTemp %}
+
+
+
+ {{ current.windSpeed | unit("wind") | round }}
+ {% if config.showWindDirection %}
+
+ {% if config.showWindDirectionAsArrow %}
+
+ {% else %}
+ {{ current.cardinalWindDirection() | translate }}
{% endif %}
- {% if config.showSun %}
-
-
- {% if current.nextSunAction() === "sunset" %}
- {{ current.sunset | formatTime }}
- {% else %}
- {{ current.sunrise | formatTime }}
- {% endif %}
-
- {% endif %}
- {% if config.showUVIndex %}
-
-
- {{ current.uv_index }}
- |
- {% endif %}
-
- {% endif %}
-
- {% if config.showIndoorTemperature and indoor.temperature or config.showIndoorHumidity and indoor.humidity %}
-
-
- {% if config.showIndoorTemperature and indoor.temperature %}
-
-
- {{ indoor.temperature | roundValue | unit("temperature") | decimalSymbol }}
-
-
- {% endif %}
- {% if config.showIndoorHumidity and indoor.humidity %}
-
-
- {{ indoor.humidity | roundValue | unit("humidity") | decimalSymbol }}
-
-
- {% endif %}
-
- {% endif %}
-
-
{{ current.temperature | roundValue | unit("temperature") | decimalSymbol }}
- {% if config.showHumidity === "temp" %}
-
{{ humidity() }}
+
+
{% endif %}
+
+ {% if config.showHumidity === "wind" %}
+ {{ humidity() }}
+ {% endif %}
+ {% if config.showSun %}
+
+
+ {% if current.nextSunAction() === "sunset" %}
+ {{ current.sunset | formatTime }}
+ {% else %}
+ {{ current.sunrise | formatTime }}
+ {% endif %}
+
+ {% endif %}
+ {% if config.showUVIndex %}
+
+
+ {{ current.uv_index }}
+ |
+ {% endif %}
- {% if (config.showFeelsLike or config.showPrecipitationAmount or config.showPrecipitationProbability) and not config.onlyTemp %}
-
- {% if config.showFeelsLike %}
-
- {% if config.showHumidity === "feelslike" %}
- {{ humidity() }}
- {% endif %}
- {{ "FEELS" | translate({DEGREE: current.feelsLike() | roundValue | unit("temperature") | decimalSymbol }) }}
-
-
- {% endif %}
- {% if config.showPrecipitationAmount and current.precipitationAmount %}
-
- {{ "PRECIP_AMOUNT" | translate }} {{ current.precipitationAmount | unit("precip", current.precipitationUnits) }}
-
-
- {% endif %}
- {% if config.showPrecipitationProbability and current.precipitationProbability %}
-
- {{ "PRECIP_POP" | translate }} {{ current.precipitationProbability }}%
-
- {% endif %}
-
+ {% endif %}
+
+ {% if config.showIndoorTemperature and indoor.temperature or config.showIndoorHumidity and indoor.humidity %}
+
+
+ {% if config.showIndoorTemperature and indoor.temperature %}
+
+ {{ indoor.temperature | roundValue | unit("temperature") | decimalSymbol }}
+
+ {% endif %}
+ {% if config.showIndoorHumidity and indoor.humidity %}
+
+ {{ indoor.humidity | roundValue | unit("humidity") | decimalSymbol }}
+
+ {% endif %}
+
{% endif %}
- {% if config.showHumidity === "below" %}
- {{ humidity() }}
+
+ {{ current.temperature | roundValue | unit("temperature") | decimalSymbol }}
+ {% if config.showHumidity === "temp" %}
+ {{ humidity() }}
{% endif %}
+
+ {% if (config.showFeelsLike or config.showPrecipitationAmount or config.showPrecipitationProbability) and not config.onlyTemp %}
+
+ {% if config.showFeelsLike %}
+
+ {% if config.showHumidity === "feelslike" %}
+ {{ humidity() }}
+ {% endif %}
+ {{ "FEELS" | translate({DEGREE: current.feelsLike() | roundValue | unit("temperature") | decimalSymbol }) }}
+
+
+ {% endif %}
+ {% if config.showPrecipitationAmount and current.precipitationAmount %}
+ {{ "PRECIP_AMOUNT" | translate }} {{ current.precipitationAmount | unit("precip", current.precipitationUnits) }}
+
+ {% endif %}
+ {% if config.showPrecipitationProbability and current.precipitationProbability %}
+ {{ "PRECIP_POP" | translate }} {{ current.precipitationProbability }}%
+ {% endif %}
+
+ {% endif %}
+ {% if config.showHumidity === "below" %}
+
{{ humidity() }}
+ {% endif %}
{% else %}
-
{{ "LOADING" | translate }}
+
{{ "LOADING" | translate }}
{% endif %}
-
+
diff --git a/modules/default/weather/forecast.njk b/modules/default/weather/forecast.njk
index 85570fbb..91fef6ab 100644
--- a/modules/default/weather/forecast.njk
+++ b/modules/default/weather/forecast.njk
@@ -1,52 +1,46 @@
{% if forecast %}
- {% set numSteps = forecast | calcNumSteps %}
- {% set currentStep = 0 %}
-
- {% if config.ignoreToday %}
- {% set forecast = forecast.splice(1) %}
+ {% set numSteps = forecast | calcNumSteps %}
+ {% set currentStep = 0 %}
+
+ {% if config.ignoreToday %}
+ {% set forecast = forecast.splice(1) %}
+ {% endif %}
+ {% set forecast = forecast.slice(0, numSteps) %}
+ {% for f in forecast %}
+
+ {% if (currentStep == 0) and config.ignoreToday == false and config.absoluteDates == false %}
+ {{ "TODAY" | translate }} |
+ {% elif (currentStep == 1) and config.ignoreToday == false and config.absoluteDates == false %}
+ {{ "TOMORROW" | translate }} |
+ {% else %}
+ {{ f.date.format("ddd") }} |
{% endif %}
- {% set forecast = forecast.slice(0, numSteps) %}
- {% for f in forecast %}
-
- {% if (currentStep == 0) and config.ignoreToday == false and config.absoluteDates == false %}
- {{ "TODAY" | translate }} |
- {% elif (currentStep == 1) and config.ignoreToday == false and config.absoluteDates == false %}
- {{ "TOMORROW" | translate }} |
- {% else %}
- {{ f.date.format("ddd") }} |
- {% endif %}
-
-
- |
-
- {{ f.maxTemperature | roundValue | unit("temperature") | decimalSymbol }}
- |
-
- {{ f.minTemperature | roundValue | unit("temperature") | decimalSymbol }}
- |
- {% if config.showPrecipitationAmount %}
-
- {{ f.precipitationAmount | unit("precip", f.precipitationUnits) }}
- |
- {% endif %}
- {% if config.showPrecipitationProbability %}
-
- {{ f.precipitationProbability | unit('precip', '%') }}
- |
- {% endif %}
- {% if config.showUVIndex %}
-
- {{ f.uv_index }}
-
- |
- {% endif %}
-
- {% set currentStep = currentStep + 1 %}
- {% endfor %}
-
+
+
+ |
+ {{ f.maxTemperature | roundValue | unit("temperature") | decimalSymbol }} |
+ {{ f.minTemperature | roundValue | unit("temperature") | decimalSymbol }} |
+ {% if config.showPrecipitationAmount %}
+ {{ f.precipitationAmount | unit("precip", f.precipitationUnits) }} |
+ {% endif %}
+ {% if config.showPrecipitationProbability %}
+ {{ f.precipitationProbability | unit('precip', '%') }} |
+ {% endif %}
+ {% if config.showUVIndex %}
+
+ {{ f.uv_index }}
+
+ |
+ {% endif %}
+
+ {% set currentStep = currentStep + 1 %}
+ {% endfor %}
+
{% else %}
-
{{ "LOADING" | translate }}
+
{{ "LOADING" | translate }}
{% endif %}
-
+
diff --git a/modules/default/weather/hourly.njk b/modules/default/weather/hourly.njk
index 4223390b..05416de7 100644
--- a/modules/default/weather/hourly.njk
+++ b/modules/default/weather/hourly.njk
@@ -1,52 +1,48 @@
{% if hourly %}
- {% set numSteps = hourly | calcNumEntries %}
- {% set currentStep = 0 %}
-
- {% set hours = hourly.slice(0, numSteps) %}
- {% for hour in hours %}
-
- {{ hour.date | formatTime }} |
-
-
- |
-
- {{ hour.temperature | roundValue | unit("temperature") }}
- |
- {% if config.showUVIndex %}
-
- {% if hour.uv_index!=0 %}
- {{ hour.uv_index }}
-
- {% endif %}
- |
- {% endif %}
- {% if config.showHumidity != "none" %}
-
- {{ hour.humidity }}
-
- |
- {% endif %}
- {% if config.showPrecipitationAmount %}
- {% if (not config.hideZeroes or hour.precipitationAmount>0) %}
-
- {{ hour.precipitationAmount | unit("precip", hour.precipitationUnits) }}
- |
- {% endif %}
- {% endif %}
- {% if config.showPrecipitationProbability %}
- {% if (not config.hideZeroes or hour.precipitationAmount>0) %}
-
- {{ hour.precipitationProbability | unit('precip', '%') }}
- |
- {% endif %}
- {% endif %}
-
- {% set currentStep = currentStep + 1 %}
- {% endfor %}
-
+ {% set numSteps = hourly | calcNumEntries %}
+ {% set currentStep = 0 %}
+
+ {% set hours = hourly.slice(0, numSteps) %}
+ {% for hour in hours %}
+
+ {{ hour.date | formatTime }} |
+
+
+ |
+ {{ hour.temperature | roundValue | unit("temperature") }} |
+ {% if config.showUVIndex %}
+
+ {% if hour.uv_index!=0 %}
+ {{ hour.uv_index }}
+
+ {% endif %}
+ |
+ {% endif %}
+ {% if config.showHumidity != "none" %}
+
+ {{ hour.humidity }}
+
+ |
+ {% endif %}
+ {% if config.showPrecipitationAmount %}
+ {% if (not config.hideZeroes or hour.precipitationAmount>0) %}
+ {{ hour.precipitationAmount | unit("precip", hour.precipitationUnits) }} |
+ {% endif %}
+ {% endif %}
+ {% if config.showPrecipitationProbability %}
+ {% if (not config.hideZeroes or hour.precipitationAmount>0) %}
+ {{ hour.precipitationProbability | unit('precip', '%') }} |
+ {% endif %}
+ {% endif %}
+
+ {% set currentStep = currentStep + 1 %}
+ {% endfor %}
+
{% else %}
-
{{ "LOADING" | translate }}
+
{{ "LOADING" | translate }}
{% endif %}
-
+
diff --git a/package-lock.json b/package-lock.json
index d0774712..dc460bc2 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -52,6 +52,7 @@
"markdownlint-cli2": "^0.18.1",
"playwright": "^1.55.0",
"prettier": "^3.6.2",
+ "prettier-plugin-jinja-template": "^2.1.0",
"stylelint": "^16.24.0",
"stylelint-config-standard": "^39.0.0",
"stylelint-prettier": "^5.0.3"
@@ -11763,6 +11764,16 @@
"node": ">=6.0.0"
}
},
+ "node_modules/prettier-plugin-jinja-template": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/prettier-plugin-jinja-template/-/prettier-plugin-jinja-template-2.1.0.tgz",
+ "integrity": "sha512-mzoCp2Oy9BDSug80fw3B3J4n4KQj1hRvoQOL1akqcDKBb5nvYxrik9zUEDs4AEJ6nK7QDTGoH0y9rx7AlnQ78Q==",
+ "dev": true,
+ "license": "MIT",
+ "peerDependencies": {
+ "prettier": "^3.0.0"
+ }
+ },
"node_modules/pretty-format": {
"version": "30.0.5",
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-30.0.5.tgz",
diff --git a/package.json b/package.json
index 81389b4f..9d47abf0 100644
--- a/package.json
+++ b/package.json
@@ -111,6 +111,7 @@
"markdownlint-cli2": "^0.18.1",
"playwright": "^1.55.0",
"prettier": "^3.6.2",
+ "prettier-plugin-jinja-template": "^2.1.0",
"stylelint": "^16.24.0",
"stylelint-config-standard": "^39.0.0",
"stylelint-prettier": "^5.0.3"
diff --git a/prettier.config.mjs b/prettier.config.mjs
index 7ec216b4..4a626332 100644
--- a/prettier.config.mjs
+++ b/prettier.config.mjs
@@ -1,10 +1,17 @@
const config = {
+ plugins: ["prettier-plugin-jinja-template"],
overrides: [
{
files: "*.md",
options: {
parser: "markdown"
}
+ },
+ {
+ files: ["*.njk"],
+ options: {
+ parser: "jinja-template"
+ }
}
],
trailingComma: "none"