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

Allow author to prevent page overrides from users #107

Open
BryceRussell opened this issue May 14, 2024 · 0 comments
Open

Allow author to prevent page overrides from users #107

BryceRussell opened this issue May 14, 2024 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested todo Goal for next major release

Comments

@BryceRussell
Copy link
Member

BryceRussell commented May 14, 2024

Currently, all pages inside a theme can be renamed or disabled by the user, for example:

package/
└── src/
    └── pages/
        ├── api/
        │   ├── login.astro
        │   └── logout.astro
        └── index.astro
// astro.config.mjs
import { defineConfig } from 'astro/config';
import myTheme from 'my-theme';

export default defineConfig({
  integrations: [
    myTheme({
      pages: {
		"/": "/home",
		"/logout": "/signout",
		"/login": false
      },
    }),
  ]
});

The purpose of this overriding it to prevent user's from being locked-in to the pages the theme creates. But in some cases, a theme may want to opt out of this overriding. ATP should provide a way to prevent users from overriding a page.

Things to consider:

  • This should be discouraged! Themes are meant to be overridable, this should only be used for advanced use-cases where an override could break a theme
  • Maybe the theme provider could allow overriding of .astro pages but not API route .js|.ts
  • Users have two options when overriding a page: renaming and disabling. Can this API support the ability to rename, but not disable (and vice versa)?
@BryceRussell BryceRussell added enhancement New feature or request help wanted Extra attention is needed question Further information is requested labels May 14, 2024
@BryceRussell BryceRussell added the todo Goal for next major release label May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested todo Goal for next major release
Projects
Development

No branches or pull requests

1 participant