Giter VIP home page Giter VIP logo

googlesitemap's Introduction

GoogleSiteMap

Version: 2.1.x First Relesed: Feb 8, 2018 Author: YJ Tso @sepiariver, Garry Nutting @garryn

  • Added cachemanager plugin OnSiteRefresh
  • Complete rewrite based on Garry's blazing fast sitemap code
  • Added cachemanager
  • Efforts were made to make it backwards compatible using runSnippet to call the legacy snippet if legacy features are required.

Examples:

[[!GoogleSiteMap]] // Will output a sitemap many times faster than the legacy Snippet
[[!GoogleSiteMap? &itemTpl=`gItem`]] // &itemTpl is a legacy feature, so the legacy Snippet will be called. No performance benefit, except new caching mechanism.

This project is managed at: https://github.com/modxcms/GoogleSiteMap.

Read or contribute to the documentation here: https://rtfm.modx.com/extras/revo/googlesitemap.

googlesitemap's People

Contributors

bezumkin avatar jako avatar jasonabird avatar jpdevries avatar ncrossland avatar sepiariver avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

googlesitemap's Issues

Default parameter values and caching

The snippet seems to have issues with default parameter values and caching. I have to use explicit

&context=`[[*context_key]]` &published=`1`

Otherwise some cached values from another context are used.

Change to site_url context setting is not picked up

  1. View sitemap
  2. change site_url in web context setting
  3. Clear cache
  4. View sitemap again
    NOTICE - sitemap.xml does not have the updated site_url

To fix this we temporarily commented the link in the snippet which checks the cache and re-enabled it once sitemap regenerated.
$output = $modx->cacheManager->get($cacheKey, $options); <--- Commented this line
if ($output !== null) return $output;

GoogleSiteMap

MODX Revolution 2.4.0-pl not working sitemap.xml pls help ....

Resources from different contexts

in case of resources from different contexts it outputs all the resources of the first context in the list and just the home of others

Add more plugin events to ensure cache clearing

Events: OnDocFormSave, OnDocFormDelete, OnDocPublished, OnDocUnpublished.

Note to self:

// Clean cache
//$modx->cacheManager->clean($options);
$cacheManager = $modx->getCacheManager();
$cacheManager->refresh(array(
    'googlesitemap' => array(),
));

Not perfect by any means.

Unable to add new urls to sitemap

Hello,

one of my clients uses modx in combination with your plugin to display his xml sitemap.

He has german, english and chinese urls. The german and english urls are being displayed in the sitemap but the chinese urls are not listed.

I already tried several things to find out why

  • compared alot of listed documents vs the not listed documents options to find out differences between them (did not find any)
  • searched within the php code to find out if the chinese urls get filtered out (is not the case)
  • had a look at when the plugin has been downloaded and installed (about two years ago, but the last plugin update was in april)

The very last thing I can think about right now is, that the plugin generates the xml sitemap once the plugin is installed. So, when I have new urls I want to show in the sitemap as well, I might need to reinstall the plugin?

Would be really glad for a short response because I really do not see why certain urls are shown in the sitemap and others are not.

Thank you!

Best regards
Thomas

[ Feature ] Add hreflang support

Feature Request

If you build multilingual websites with MODX and want to publish a sitemap, you only have 1 option - which is to generate a sitemap for each language context and then configure the language using Google Webmaster tools, which is not the preferred solution.

Googles recommendation is to use hreflang inside your sitemap. Like so;

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
  xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <url>
    <loc>http://www.example.com/english/</loc>
    <xhtml:link 
                 rel="alternate"
                 hreflang="de"
                 href="http://www.example.com/deutsch/"
                 />
    <xhtml:link 
                 rel="alternate"
                 hreflang="de-ch"
                 href="http://www.example.com/schweiz-deutsch/"
                 />
    <xhtml:link 
                 rel="alternate"
                 hreflang="en"
                 href="http://www.example.com/english/"
                 />
  </url>
  
  <url>
    <loc>http://www.example.com/deutsch/</loc>
    <xhtml:link 
                 rel="alternate"
                 hreflang="en"
                 href="http://www.example.com/english/"
                 />
     <xhtml:link 
                 rel="alternate"
                 hreflang="de-ch"
                 href="http://www.example.com/schweiz-deutsch/"
                 />
     <xhtml:link 
                 rel="alternate"
                 hreflang="de"
                 href="http://www.example.com/deutsch/"
                 />
  </url>
  
  <url>
    <loc>http://www.example.com/schweiz-deutsch/</loc>
     <xhtml:link 
                 rel="alternate"
                 hreflang="de"
                 href="http://www.example.com/deutsch/"
                 />
     <xhtml:link 
                 rel="alternate"
                 hreflang="en"
                 href="http://www.example.com/english/"
                 />
<xhtml:link 
                 rel="alternate"
                 hreflang="de-ch"
                 href="http://www.example.com/schweiz-deutsch/"
                 />
  </url>
  
</urlset>

More info:
https://support.google.com/webmasters/answer/2620865?hl=en&ref_topic=2370587

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.