Star Citizen Wiki Modul:SEO
Wir laden dich herzlich auf den Star Citizen Wiki Discord Server ein! Du kannst uns auch auf unserem neuen YouTube-Chanel finden!

Modul:SEO

From Star Citizen Wiki

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

local SEO = {}


local function getLocaleFromCode( code )
    if code == 'de' then
        return 'de_DE'
    elseif code == 'en' then
        return 'en_EN'
    end

    return mw.getContentLanguage()
end


function SEO.set( section, url, title, title_mode, keywords, description, image, image_alt )
    section = section or nil
    url = url or nil
    title = title or mw.title.getCurrentTitle().text
    title_mode = title_mode or 'replace'
    keywords = keywords or nil
    description = description or nil
    image= image or nil
    image_alt = image_alt or nil

    if url ~= nil then
        url = tostring( mw.uri.fullUrl( url ) )
    end

    if type( keywords ) == 'table' then
        keywords = table.concat( keywords, ', ' )
    end

    mw.ext.seo.set{
        author = mw.getCurrentFrame():preprocess( '{{SERVER}}/Benutzer:{{urlencode:{{REVISIONUSER}}|WIKI}}' ),
        section = section,
        url = url,
        title = title,
        title_mode = title_mode,
        keywords = keywords,
        description = description,
        image= image,
        image_alt = image_alt,
        locale = getLocaleFromCode( require( 'Modul:Template translation' ).getCurrentLanguageSubpage() ),
        type = 'article',
    }
end


return SEO
Cookies help us deliver our services. By using our services, you agree to our use of cookies.