mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-25 22:33:44 +00:00
corrected sitemap.xml format
This commit is contained in:
parent
9f947e5b8b
commit
e5a3acacad
2 changed files with 4 additions and 4 deletions
|
|
@ -7,8 +7,8 @@ describe('sitemap', function(){
|
||||||
var map = new SiteMap([]);
|
var map = new SiteMap([]);
|
||||||
expect(map.render()).toEqual([
|
expect(map.render()).toEqual([
|
||||||
'<?xml version="1.0" encoding="UTF-8"?>',
|
'<?xml version="1.0" encoding="UTF-8"?>',
|
||||||
'<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">',
|
'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">',
|
||||||
'</sitemapindex>', ''].join('\n'));
|
'</urlset>', ''].join('\n'));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render ngdoc url', function(){
|
it('should render ngdoc url', function(){
|
||||||
|
|
|
||||||
|
|
@ -10,12 +10,12 @@ function SiteMap(docs){
|
||||||
this.render = function(){
|
this.render = function(){
|
||||||
var map = [];
|
var map = [];
|
||||||
map.push('<?xml version="1.0" encoding="UTF-8"?>');
|
map.push('<?xml version="1.0" encoding="UTF-8"?>');
|
||||||
map.push('<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">');
|
map.push('<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">');
|
||||||
docs.forEach(function(doc){
|
docs.forEach(function(doc){
|
||||||
map.push(' <url><loc>http://docs.angularjs.org/#!' +
|
map.push(' <url><loc>http://docs.angularjs.org/#!' +
|
||||||
encode(doc.name) + '</loc><changefreq>weekly</changefreq></url>');
|
encode(doc.name) + '</loc><changefreq>weekly</changefreq></url>');
|
||||||
});
|
});
|
||||||
map.push('</sitemapindex>');
|
map.push('</urlset>');
|
||||||
map.push('');
|
map.push('');
|
||||||
return map.join('\n');
|
return map.join('\n');
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue