Extension:AutoSitemap

From mediawiki.org
Jump to navigation Jump to search
This page is a translated version of the page Extension:AutoSitemap and the translation is 100% complete.
Other languages:
Deutsch • ‎English • ‎Türkçe • ‎français • ‎português do Brasil • ‎中文 • ‎日本語
MediaWiki manüel uzantıları
OOjs UI icon advanced.svg
AutoSitemap
Sürüm durumu: kararlı
Uygulama Vikim , Sayfa işlemi
Açıklama Herhangi bir sitenin sayfası değişirken otomatik olarak bir Site Haritası dosyası oluşturur ve günceller.
Yazar(lar) Dolfinus, François Boutines-Vignard, Jehy, Thomas
En son sürüm 1.4.1 (1.3 for MW 1.33 and lower) (2020-08-24)
MediaWiki 1.25+
Veritabanı değişiklikleri Hayır
Lisans GNU Genel Kamu Lisansı 3.0 veya üstü
İndir
README
Örnek Generated sitemap
$wgAutoSitemap
Kullanım ve sürüm matrisini kontrol edin.

The AutoSitemap extension automatically builds a "sitemap.xml" file at every page create/edit/delete event. Sitemap file helps search engines to observe your site’s pages. This extension is based on the precursing extension called "ManualSitemap".

Gerekçe

I do not have the possibility to update my sitemap via cron because of the hosting provider, and I also do not want to update it manually.

So I edited an existing extension to update the sitemap by itself at any page edit, create, delete, rename, upload, etc events.

Yükle

  • Dosyaları İndir ve extensions/ klasörünüzdeki AutoSitemap adlı dizine yerleştirin.
  • LocalSettings.php dosyanızın altına aşağıdaki kodu ekleyin:
    wfLoadExtension( 'AutoSitemap' );
    
  • Yes Yapıldı – Uzantının başarıyla yüklendiğini doğrulamak için vikinizde Special:Version seçeneğine gidin.

Yapılandır

There are some optional parameters that change the sitemap generation. You can set them in your LocalSettings.php.

Dosya adı

You can set filename of sitemap by setting:

$wgAutoSitemap["filename"] = "sitemap.xml"; //default value

Temel URL'yi ayarlama

By default all URLs in sitemap use $wgCanonicalServer (or $wgServer, if it doesn’t set) as domain prefix. If you want to set it to another one, you can change it manually by setting:

$wgAutoSitemap["server"] = "https://your-site.com";

Arama motorları bildirimi

You can notify web sites you want about the update of sitemap. Just write all notify URLs as array:

$wgAutoSitemap["notify"] = [
    'https://www.google.com/webmasters/sitemaps/ping?sitemap=https://your-site.com/sitemap.xml',
    'https://www.bing.com/webmaster/ping.aspx?sitemap=https://your-site.com/sitemap.xml'
];

Sometimes web hoster does not allow the fopen command to call URLs (allow_url_fopen=false). If you can’t or doesn’t want to use notification, set this to empty array by deleting all lines between brackets (= [];).

Site haritasından sayfa türlerini hariç tutun

You can exclude namespaces or exact pages from including them to sitemap:

$wgAutoSitemap["exclude_namespaces"] = [
    NS_TALK,
    NS_USER,   
    NS_USER_TALK,
    NS_PROJECT_TALK,
    NS_IMAGE_TALK,
    NS_MEDIAWIKI,   
    NS_MEDIAWIKI_TALK,
    NS_TEMPLATE,
    NS_TEMPLATE_TALK,
    NS_HELP,   
    NS_HELP_TALK,
    NS_CATEGORY_TALK
]; //default values

$wgAutoSitemap["exclude_pages"] = ['page title to exclude', 'other one'];

Sayfa güncelleme sıklığını ayarla

You can manually specify the recommended frequency with which all addresses will be checked by search engine:

$wgAutoSitemap["freq"] = "daily"; //default

Available values are:

hourly
daily
weekly
monthly
yearly
adjust - for automatic determination of frequency based on page edits count

Sayfa önceliğini ayarla

You can manually specify priority for certain pages or namespaces:

$wgAutoSitemap["priority"] = 0.7;

or

$wgAutoSitemap["priority"][NS_MAIN] = 1;
$wgAutoSitemap["priority"][NS_CATEGORY] = 0.8;

or

$wgAutoSitemap["priority"]['Main page'] = 1;
$wgAutoSitemap["priority"]['Other page'] = 0.8;

Kullanım

İzinler

Your MediaWiki folder should be permitted for write operations (chmod +w with chown apache or chown nginx).

Htaccess, Nginx

If you want to see a human-readable sitemap, allow read access for sitemap.xsl file in your site config (.htaccess file or other).

Ayrıca bakınız