Skip to content

Conversation

@ShukantPal
Copy link
Member

No description provided.

@ShukantPal ShukantPal merged commit f28cac5 into master Feb 7, 2021
@ShukantPal ShukantPal deleted the feature/deploy branch February 7, 2021 15:28
Comment on lines +43 to +53
/* eslint-disable max-len */
const xml =
`<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
${this.urls.map((url) =>
` <url>
<loc>${this.domain + path.join(this.root, path.relative(this.dir, url))}</loc>
</url>`).join("\n")}
</urlset>`;
/* eslint-enable max-len */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to make another template file instead of hardcoding generation?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what you mean by hardcoding generation. The template package can still exclude sitemap generation by simply not adding this pipeline element.

Using a pipeline element instead of a template means you don't have to worry about collecting the URLs that were generated. (Documents are the only generated URL - tutorial, class index, package READMEs are all generated)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant this exact part of code could be stored in separated file instead of defining it right in the code. (So you could change XML template with ease.)

@ShukantPal
Copy link
Member Author

ShukantPal commented Feb 8, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants