[GH-ISSUE #27] [Update] Legal Pages plugin fix (fully working) #27

Closed
opened 2026-05-07 00:17:11 +02:00 by BreizhHardware · 1 comment

Originally created by @noriwanne on GitHub (Dec 20, 2025).
Original GitHub issue: https://github.com/pelican-dev/plugins/issues/27

Edit:

enum LegalPageType: string implements HasLabel
{
    case Imprint = Imprint::class;                 # HERE
    case TermsOfService = TermsOfService::class;   # HERE
    case PrivacyPolicy = PrivacyPolicy::class;     # HERE

    public function getId(): string
    {
        return Str::snake($this->name);
    }

    public function getLabel(): string
    {
        return trans('legal-pages::strings.' . $this->getId());
    }

    public function getUrl(): string
    {
        return '/' . Str::slug($this->name);
    }

    /** @return class-string */
    public function getClass(): string
    {
        return $this->value;
    }
}

to

enum LegalPageType: string implements HasLabel
{
    case Imprint = 'imprint';                      # HERE
    case TermsOfService = 'terms_of_service';      # HERE
    case PrivacyPolicy = 'privacy_policy';         # HERE

    public function getId(): string
    {
        return $this->value;
    }

    public function getLabel(): string
    {
        return trans('legal-pages::strings.' . $this->getId());
    }

    public function getUrl(): string
    {
        return '/' . Str::slug($this->value);
    }

    /** @return class-string */
    public function getClass(): string
    {
        return match ($this) {
            self::Imprint => Imprint::class,
            self::TermsOfService => TermsOfService::class,
            self::PrivacyPolicy => PrivacyPolicy::class,
        };
    }
}

Then the Legal Pages plugin fully works (tested and approved by me)

Originally created by @noriwanne on GitHub (Dec 20, 2025). Original GitHub issue: https://github.com/pelican-dev/plugins/issues/27 Edit: ``` enum LegalPageType: string implements HasLabel { case Imprint = Imprint::class; # HERE case TermsOfService = TermsOfService::class; # HERE case PrivacyPolicy = PrivacyPolicy::class; # HERE public function getId(): string { return Str::snake($this->name); } public function getLabel(): string { return trans('legal-pages::strings.' . $this->getId()); } public function getUrl(): string { return '/' . Str::slug($this->name); } /** @return class-string */ public function getClass(): string { return $this->value; } } ``` to ``` enum LegalPageType: string implements HasLabel { case Imprint = 'imprint'; # HERE case TermsOfService = 'terms_of_service'; # HERE case PrivacyPolicy = 'privacy_policy'; # HERE public function getId(): string { return $this->value; } public function getLabel(): string { return trans('legal-pages::strings.' . $this->getId()); } public function getUrl(): string { return '/' . Str::slug($this->value); } /** @return class-string */ public function getClass(): string { return match ($this) { self::Imprint => Imprint::class, self::TermsOfService => TermsOfService::class, self::PrivacyPolicy => PrivacyPolicy::class, }; } } ``` Then the Legal Pages plugin fully works **(tested and approved by me)**
Author
Owner

@coderabbitai[bot] commented on GitHub (Dec 20, 2025):

📝 CodeRabbit Plan Mode

Generate an implementation plan and prompts that you can use with your favorite coding agent.

  • Create Plan
Examples


🧪 Issue enrichment is currently in open beta.

You can configure auto-planning by selecting labels in the issue_enrichment configuration.

To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

issue_enrichment:
  auto_enrich:
    enabled: false

💬 Have feedback or questions? Drop into our discord or schedule a call!

<!-- gh-comment-id:3678087803 --> @coderabbitai[bot] commented on GitHub (Dec 20, 2025): <!-- This is an auto-generated issue plan by CodeRabbit --> ### 📝 CodeRabbit Plan Mode Generate an implementation plan and prompts that you can use with your favorite coding agent. - [ ] <!-- {"checkboxId": "8d4f2b9c-3e1a-4f7c-a9b2-d5e8f1c4a7b9"} --> Create Plan <details> <summary>Examples</summary> - [Example 1](https://github.com/coderabbitai/git-worktree-runner/issues/29#issuecomment-3589134556) - [Example 2](https://github.com/coderabbitai/git-worktree-runner/issues/12#issuecomment-3606665167) </details> --- --- <details> <summary> 🧪 Issue enrichment is currently in open beta.</summary> You can configure auto-planning by selecting labels in the issue_enrichment configuration. To disable automatic issue enrichment, add the following to your `.coderabbit.yaml`: ```yaml issue_enrichment: auto_enrich: enabled: false ``` </details> 💬 Have feedback or questions? Drop into our [discord](https://discord.gg/coderabbit) or [schedule a call](https://calendly.com/parth-coderabbit/issues-feedback)!
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/plugins#27
No description provided.