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

Make package listing suffix configurable and the URL configurable #29

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Happyrobot33
Copy link

This allows adding a suffix to the package listing, and allows setting the listing url directly instead of it being generated from the repository name, which allows for custom domains to be used

PackageBuilder/Build.cs Outdated Show resolved Hide resolved
Comment on lines +56 to +64
private string _currentListingUrl;
[Parameter("Path to existing index.json file, typically https://{owner}.github.io/{repo}/index.json")]
string CurrentListingUrl =>
$"https://{GitHubActions.RepositoryOwner}.github.io/{GitHubActions.Repository.Split('/')[1]}/{PackageListingPublishFilename}";
public string CurrentListingUrl
{
get => _currentListingUrl ??
$"https://{GitHubActions.RepositoryOwner}.github.io/{GitHubActions.Repository.Split('/')[1]}/{PackageListingPublishFilename}";

set => _currentListingUrl = value;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just meant to be used by passing parameters to the nuke Target call directly, right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, I would actually like to switch it back to being determined entirely at runtime, but I cant seem to find a way currently to get the actual domain setup of the user

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about just keeping it simple and grabbing the location in the javascript and tacking index.json to the end?

const packageUrl = `${window.location.host}${window.locationpathname}/index.json`;

not the most elegant but would probably get the job done

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nevermind, i see the listing url is needed at build time after the first deployment now

@Happyrobot33
Copy link
Author

ive been using this in prod for like, over a year now

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.

3 participants