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

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

Open
tiller1010 opened this issue Jan 9, 2024 · 1 comment
Open

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

tiller1010 opened this issue Jan 9, 2024 · 1 comment
Labels
bug Something isn't working has-pr Has a pull-request for it

Comments

@tiller1010
Copy link

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.

@williamdes williamdes added the bug Something isn't working label Jan 9, 2024
@williamdes
Copy link
Member

Hello @tiller1010
This is quite an interesting one, I will keep this in my unread emails to try to process it asap
If you wish to open a PR to the v5.5.x branch go ahead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working has-pr Has a pull-request for it
Development

No branches or pull requests

2 participants