Random question: does anyone use underscores in th...
# kobweb
d
Random question: does anyone use underscores in their page filenames on purpose for that to show up in the final route?
For example:
About_Us.kt
-->
/about_us
?
The reason I'm asking is because I'm thinking about converting underscores to hyphens (since by default the Kobweb algorithm's intention was to find words in your file name and separate them by hyphens, since hyphens are the recommended SEO separator)
In other words, moving forward I'm thinking
About_Us.kt
-->
/about-us
Definitely looking for feedback / real use-cases first, though!
r
No. But I use them in my markdown files.
d
Interesting @Ryan Scott. And you want to keep the underscores in the final route in that case? Or would hyphens be OK?
r
It doesn't really matter. I would prefer to not have to go back and fix the relative links. But it's not a big deal to me.
Others who have more blog posts and links may feel differently
👍 1
d
Do you link to them directly? You can link to the markdown files (directly to the .md path) from other markdown files
If you use the build script to generate the links (
markdown.process
), that should also migrate automatically
r
Sure. Is there a feature to make that easy, or should I just do a string replacement?
d
Make what easy exactly? Updating links?
r
I think we're talking past eachother here a bit.
I'm linking between pages relatively. I'll give a contrived example. If I want to link from
article_a.md
to
article_b.md
, my present process is to do this:
Copy code
[See article B](article_b)
It sounds like you're saying that there is an easier way to do this via the
markdown.process
block in the build.gradle file.
But it's not clear to me what that is.
d
[See article B](article_b.md)
should work
markdown.process { ... }
is useful for creating listing pages
r
Ah. Okay. I already do something very similar to this. This is not the kind of link I'm talking about. Rather, it's a link within the text of the markdown file itself rather than a link within the generated page.
d
Right. In that case, my example above (
[see article B](artible_b.md)
) is what to use then linking within one markdown file to another (link to the file path directly and Kobweb will replace it with the right route)