Skip to content

Branches with forward slashes in the name are not supported #63

Open
@tiller1010

Description

@tiller1010

If I use branches with forward slashes in the name, then the version dropdown includes a "%2F" for the slash in the option values.

This config...

<?php

use Doctum\Version\GitVersionCollection;

$versions = GitVersionCollection::create(__DIR__ . '/src')
    ->add('support/1.0.x', '1.0.x branch')
    ->add('support/2.3.x', '2.3.x branch')
    ->add('feature/psr-4', 'main branch');

return new Doctum\Doctum(__DIR__ . '/src', [
    'title' => 'Module',
    'build_dir' => __DIR__.'/doctum_build/%version%',
    'cache_dir' => __DIR__.'/doctum_cache/%version%',
    'versions' => $versions,
]);

Produces this dropdown

<select class="form-control" id="version-switcher" name="version">
    <option value="../support%2F1.0.x/index.html" data-version="support/1.0.x">1.0.x branch</option>
    <option value="../support%2F2.3.x/index.html" data-version="support/2.3.x" selected="">2.3.x branch</option>
    <option value="../feature%2Fpsr-4/index.html" data-version="feature/psr-4">main branch</option>
</select>

The sub-directories are created just fine though.

$ ls doctum_build/support/
1.0.x/  2.3.x/

The links also start from the wrong directory because of this. ../support%2F1.0.x/index.html should be ../../support/1.0.x/index.html.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghas-prHas a pull-request for it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions