Skip to content

Allow author to prevent page overrides from users #107

Open
@BryceRussell

Description

@BryceRussell

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)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is neededquestionFurther information is requestedtodoGoal for next major release

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions