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 assets prefix functionality #462

Merged

Conversation

WordsofDefiance
Copy link
Contributor

Hi! I needed this functionality for a project, and after some thought I concluded that the best way to implement it would be to actually add the functionality directly to Scribe.

This allows you to customize the location of the public assets generated for laravel blade documents. By default, the assets are created in public/vendor/scribe. With this feature, if the user defines a laravel.asset_prefix value, the path becomes public/{{ asset_prefix }}/vendor/scribe.

I'm unclear how to best test this (my code currently passes all tests) so I'd be curious for ideas. Open to feedback.

@shalvah
Copy link
Contributor

shalvah commented Apr 24, 2022

Hmmm, I'm reluctant to add this in this form. The Laravel convention is to place vendor assets in that public/vendor. If you want to change that, I think I'd favour an approach of customising the assets directory (within public) entirely, not adding a prefix.

David added 2 commits April 26, 2022 11:25
@WordsofDefiance
Copy link
Contributor Author

I made that change you suggested. I renamed asset_prefix to assets_directory, and now the path itself is customizable (within the public directory).

@shalvah
Copy link
Contributor

shalvah commented Apr 27, 2022

Please send a PR to the docs repo as well, to update the config reference.

@shalvah
Copy link
Contributor

shalvah commented Apr 27, 2022

@WordsofDefiance
Copy link
Contributor Author

Here's the PR for documentation:
knuckleswtf/scribe-docs#14

@shalvah shalvah merged commit 89456b8 into knuckleswtf:master Apr 29, 2022
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.

2 participants