daux.io
daux.io copied to clipboard
force urls to lowercase
One thing, that irritates me the most... maybe i miss something, are URL's with uppercase letters and spaces in names...
As for catalog I can just _
and it will be migrated into space
when displaying name and its ok.
But If I have structure, where folder is only a container that rolls down, i have no control over its name, meaning that I have to name folder with uppercase letters to have them uppercase on menu... but that makes uppercase links... any way to force urls lowercase?
PS: And a way to remove łąćźś etc. :)
seems im too impatient... examples in docs could be extended... https://gist.github.com/seigieu/5cc599fbed512f607a73bcb84921b176
Haha, love the license in your gist :)
I'll see if it makes sense to include this by default in daux, probably yes :)
By the way, you're correct, there is no control over the urls for folders currently, other then the way you did it
@onigoetz This solution made me some problems... acually changed it to this:
public function manipulateTree(Root $root) {
$this->parseDirectory($root);
}
private function parseDirectory(\Todaymade\Daux\Tree\Directory $object) {
foreach($object->getEntries() as $tempname => $val) {
if($val instanceof \Todaymade\Daux\Tree\Directory) {
$name_path = $val->getPath().'/.name';
if(file_exists($name_path)) {
$newname = trim(file_get_contents($name_path));
echo "Name override detected ({$name_path}): '{$val->getTitle()}' -> '{$newname}'\r\n";
$val->setTitle($newname);
}
$this->parseDirectory($val);
}
}
}
Best one I came up so far with :) works like a charm, one from link became problematic when checking for references [link internakl](../Test/test.md)
etc. I'm not into symphony thing and no time to learn your code and structure atm, so only fast solutions for me.
Same license as file above :P
PS: my aim was acually to have control over folder names in menu, started from wrong side :)