forked from ProjectEvergreen/greenwood
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dynamic Sitemap - linting (ProjectEvergreen#1232)
- Loading branch information
Showing
5 changed files
with
32 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 9 additions & 11 deletions
20
packages/plugin-adapter-sitemap/test/cases/build.default/src/sitemap.xml.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
async function generateSitemap(compilation){ | ||
const urls = compilation.graph.map((page) => { | ||
return ` <url> | ||
<loc>http://www.example.com${page.route}</loc> | ||
async function generateSitemap(compilation) { | ||
const urls = compilation.graph.map((page) => { | ||
return ` <url> | ||
<loc>http://www.example.com${page.route}</loc> | ||
</url>`; | ||
}); | ||
return ` | ||
}); | ||
return ` | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> | ||
${urls.join('\n')} | ||
</urlset> | ||
`; | ||
} | ||
`; | ||
} | ||
|
||
|
||
|
||
export { generateSitemap }; | ||
export { generateSitemap }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 9 additions & 10 deletions
19
packages/plugin-adapter-sitemap/test/cases/develop.default/src/sitemap.xml.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
async function generateSitemap(compilation){ | ||
const urls = compilation.graph.map((page) => { | ||
return ` <url> | ||
<loc>http://www.example.com${page.route}</loc> | ||
async function generateSitemap(compilation) { | ||
const urls = compilation.graph.map((page) => { | ||
return ` <url> | ||
<loc>http://www.example.com${page.route}</loc> | ||
</url>`; | ||
}); | ||
return ` | ||
}); | ||
|
||
return ` | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> | ||
${urls.join('\n')} | ||
</urlset> | ||
`; | ||
} | ||
|
||
|
||
} | ||
|
||
export { generateSitemap }; | ||
export { generateSitemap }; |