Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sitemaps plugin #2009

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add sitemaps plugin #2009

wants to merge 1 commit into from

Conversation

MarcinAman
Copy link
Contributor

No description provided.

@MarcinAman MarcinAman linked an issue Jul 8, 2021 that may be closed by this pull request

data class SitemapConfiguration(
var baseUrl: String? = defaultBaseUrl,
var relativeOutputLocation: String? = defaultRelativeOutputLocation
Copy link
Contributor

Choose a reason for hiding this comment

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

This can probably be non-null because of the default

private val maybeConfiguration = configuration<SitemapPlugin, SitemapConfiguration>(context)

override fun invoke(input: RootPageNode): RootPageNode {
val baseUrl: String = maybeConfiguration?.baseUrl ?: "".also {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can use maybeConfiguration?.baseUrl ?: run { warn(...) ; it.orEmpty() } which is IMHO a little cleaner, but doesn't really matter that much

locationResolver: DriResolver,
baseUrl: String
): Set<String> {
val baseUrlWithSlash = baseUrl.takeIf { it.endsWith("/") || it.isEmpty() } ?: "$baseUrl/"
Copy link
Contributor

Choose a reason for hiding this comment

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

Or just baseUrl.removeSuffix("/") + "/"

Bumps [korte-jvm](https://github.com/korlibs/korte) from 2.0.7 to 2.2.0.
- [Release notes](https://github.com/korlibs/korte/releases)
- [Commits](https://github.com/korlibs/korte/compare/v2.0.7...v2.2.0)

---
updated-dependencies:
- dependency-name: com.soywiz.korlibs.korte:korte-jvm
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.

Option to generate sitemaps for dokkaHtml generated websites.
2 participants