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

Feature/Hide GitHub-Related Buttons and Views Based on Configuration #122

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

afalfallaj
Copy link

Summary
This pull request introduces a new feature that allows hiding GitHub-related buttons and views in the Pages CMS based on a configuration setting. The objective is to simplify the user interface for content writers who may not use GitHub or prefer a cleaner, more focused interface.

Details

  • New Configuration in .pages.yml:

    github: false

    When the github option is set to false, all GitHub-related buttons and views will be hidden.

  • Why This Feature?

    • The CMS is often used by content writers who do not need access to GitHub functionalities.
    • Hiding GitHub elements reduces UI clutter and provides a streamlined experience for non-technical users.
    • This is especially useful for content teams who focus solely on content management without touching the underlying GitHub repository.

What Was Changed

  • UI Elements Hidden:

    • Buttons and links that redirect to GitHub, such as "View on GitHub" or "Edit on GitHub".
    • Any GitHub-related icons or action menus that appear in the content editing interface.
  • How It Works:

    • If github: false is set in the .pages.yml configuration, the GitHub buttons are hidden.
    • If github is not set or set to true, the buttons remain visible.

Code Changes

  • Added checks throughout the UI components to conditionally display GitHub-related elements based on the configuration.
  • Updated the relevant Vue components to read the github flag from the configuration.
  • Example usage:
                <li v-if="props.config?.github !== false">
                  <a :href="`https://github.com/${props.owner}/${props.repo}/blob/${props.branch}/${props.path}`" target="_blank" class="link">
                    <div>See file on GitHub</div>
                    <Icon name="ExternalLink" class="h-4 w-4 stroke-2 shrink-0 ml-auto text-neutral-400 dark:text-neutral-500"/>
                  </a>
                </li>

Testing

  • Manually tested the UI with the following configurations:
    • github: false → Confirmed that all GitHub-related elements are hidden.
    • github: true or not set → Confirmed that all GitHub-related elements are visible.
  • Verified that the feature is fully backward-compatible.

Notes

  • This change is fully backward-compatible. If github is not set, the default behavior (showing GitHub buttons) is maintained.
  • The feature aims to make the CMS more user-friendly for content teams who focus solely on managing content.

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.

1 participant