-
Notifications
You must be signed in to change notification settings - Fork 92
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
Running paperbits on arbitrary subpath #211
Comments
This is very similar to my issue #208 |
@joshua-mng, for the first issue, which is indeed similar to what @msrshahrukh100 mentioned, we'll expose respective settings to override hardcoded values this week. For the rest two issues, let me get back to you (also this week). |
Thank you for your quick response. And this is indeed very similar to issue #208, but there is a subtle difference. In my case, subpath to run the website and designer is actually not a fixed sub path known at build time compared to using webpack's output.publicPath which is a path known at build time. What would be so helpful in my case is if I can inject these subpath information to paperbits in the index.html or page.html file via attributes. Like,
reason for this is that, I can compute the subpath at runtime. And also entry point html files are so small so it's very efficient to add html attributes to it. It needs to be computed at runtime, so it needs to be passed to paperbits designer or publisher rather than webpack. When designing, For publisher, I think we can pass this basePath info via settingsProvider or via html attributes like above. Overriding settingsProvider data via command line arguments would be super great for this purpose, but that's another issue i guess. As for the last 2 issues that you said you would look into, It is because of the As FYI, here are the constant string values that I think needs to be configurable (I am replacing them in index.html, page.html, paperbits.js files) /styles/theme.css Above values are all written as constant strings, so unable to change them. Any other solution would be appreciated, thank you. |
Hi @joshua-mng, wow, you've got pretty deep into the code, amazing! :). I remember we had a question like this and we suggested a router below. It's a bit outdated, but should still work. Let me know if you still have an issue. Also, I have exposed some settings (see design.config.json) in version 0.1.534. Let me check the rest resources you suggested a bit later. Here's the router:
|
I finally got everything working now.
Im using the provided extensibility points as much as possible, and also using some hackish ways to workaround some issues (mentioned in my previous comment, bunch of magic strings). So it would be great if all those magic strings would be set in configuration file OR even better, just in some helper file where we can set them directly (setAssetConfig etc ..). Thank you very much for the support. |
Great to hear that! Agree on magic strings, we'll get rid of them. Closing the issue since questions resolved. Please feel free to reopen shall you need further assistance. |
Im trying to use this wonderful library in my project. Basically my app is running on following url.
https://mydomain.com/
I want to do following 2 things
I replaced default PermalinkResolver and MediaPermalinkResolver to prepend /mysite1 in front of urls during publishing so now published site works partially on sub path /mysite1
I'm serving designer assets on https://mydomain.com/sites/mysite1/designer which works partially
I can replace, permalink resolver, blob storage, object storage to use my custom backend.
But problem is:
So the question is what is the best way to achieve this? (Running published website and designer or arbitrary dynamic subpath)
Thank you
The text was updated successfully, but these errors were encountered: