Modul:ArtikelDesTages: Unterschied zwischen den Versionen

Aus LASK Wiki
Zur Navigation springen Zur Suche springen
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Markierung: Zurückgesetzt
Zeile 17: Zeile 17:
     local titel = artikel[index]
     local titel = artikel[index]


     return "[[" .. titel .. "|" .. titel .. "]]"
     return "[[+" .. titel .. "|" .. titel .. "]]"
end
end


return p
return p

Version vom 3. September 2026, 10:26 Uhr

Die Dokumentation für dieses Modul kann unter Modul:ArtikelDesTages/Doku erstellt werden

local p = {}

local artikel = {
    "Saison 2019/20"
}

function p.main(frame)

    local tag = tonumber(frame:preprocess("{{CURRENTDAY}}"))
    local monat = tonumber(frame:preprocess("{{CURRENTMONTH}}"))
    local jahr = tonumber(frame:preprocess("{{CURRENTYEAR}}"))

    local wert = jahr * 10000 + monat * 100 + tag

    local index = (wert % #artikel) + 1

    local titel = artikel[index]

    return "[[+" .. titel .. "|" .. titel .. "]]"
end

return p