Skip to content
This repository has been archived by the owner on Nov 7, 2022. It is now read-only.

Load config and plugins from project host #14

Closed
rofe opened this issue Jun 14, 2021 · 3 comments · Fixed by #25
Closed

Load config and plugins from project host #14

rofe opened this issue Jun 14, 2021 · 3 comments · Fixed by #25
Labels
enhancement New feature or request released

Comments

@rofe
Copy link
Contributor

rofe commented Jun 14, 2021

The sidekick config is currently stored in the author's bookmarklet URL. When an update to the config is required, e.g. to make use of a new feature, authors are asked to update their bookmarklets (i.e. replace it with a new one). Even though the sidekick redirects them to the right URL to get the fresh bookmarklet, it is still a manual task.

The sidekick also makes a request to the project host to see if there are any custom plugins to load.

In order to avoid manual bookmarklet updates in the future, both the sidekick config and plugins could be loaded from a single config file located on the project host.

@rofe rofe added the enhancement New feature or request label Jun 14, 2021
@tripodsan
Copy link
Contributor

file located on the project host.

i.e. github delivered through helix? eg: https://main--repo-owner.hlx.page/helix-sidekick.json ?

@rofe
Copy link
Contributor Author

rofe commented Jun 23, 2021

I was thinking more of a JS file e.g. https://main--repo-owner.hlx.page/tools/sidekick/config.js so customers can specify listeners for custom buttons.

Example:

// window.hlx.initSidekick(config) is provided by the sidekick app.js loaded prior to this file
window.hlx.initSidekick({
  project: 'Test Project',
  host: 'www.foo.bar',
  hlx3: true,
  byocdn: true,
  plugins: [
    {
      id: 'test',
      button: {
        text: 'Test',
        action: (evt) => {
          console.log('test');
        },
      },
    },
  ],
});

@trieloff
Copy link

trieloff commented Jul 6, 2021

🎉 This issue has been resolved in version 3.3.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants