OwnTube-tv/web-client

Per-site feature toggles

Closed this issue · 2 comments

[
  {
    "name": "XR Tube",
    "description": "The PeerTube platform of Extinction Rebellion.",
    "url": "tube.rebellion.global",
    "logoUrl": "https://joinpeertube.org/img/content-selection-thumbnails/extinction-rebellion.jpg",
    "customizations": {
      // Override default page title
      pageTitle: "XR Tube @ OwnTube.tv",
      // Home page customizations
      homeLatestPublishedVideoCount: 12,
      homeRecentlyWatchedVideoCount: 4,
      homeHideChannelsOverview: false,
      homeHideCategoriesOverview: false,
      homeHidePlaylistsOverview: true,
    }
  },
  // ...
  {
    "name": "Svensk Webbtelevision",
    "description": "Svensk /.../ politiska och andra makthavare.",
    "url": "swebbtv.se",
    // Logo to display when listing things by logo
    "logoUrl": "https://nyheter.swebbtv.se/wp-content/uploads/2022/10/logoblack_narduvillveta_portrait.png",
    // Icon to use in the top-left corner of the site, for example
    "iconUrl": "https://swebbtv.se/client/assets/images/logo.svg",
    "customizations": {
      // Override default page title
      pageTitle: "Swebbtv @ OwnTube.tv",
      // Override default theme
      pageDefaultTheme: "dark",
      // Toggle menu items
      menuHideHistoryButton: false,
      menuHideChannelsButton: true,
      menuHidePlaylistsButton: false,
      menuHideCategoriesButton: true,
      menuHideLeaveButton: true,
      // Playlists to hide in on the Playlists page
      playlistsHidden: [
        "6781",
        "15549",
        "6783",
        "6558",
        "6787",
        "13568",
        "6790",
        "13497",
        "6845",
        "6566",
        "6773",
        "6794",
        "10857",
        "10562",
        "6793",
        "6567",
        "5419",
        "5420",
        "5421",
        "5153",
        "279",
        "675",
        "277",
        "4537",
        "4538",
        "281",
        "4535",
        "4536",
        "253",
      ],
      // On the Playlists page, show a button to show all playlists (even hidden ones)
      playlistsShowHiddenButton: true,
      // Home page customizations
      homeLatestPublishedVideoCount: 21,
      homeRecentlyWatchedVideoCount: 4,
      homeHideChannelsOverview: true,
      homeHideCategoriesOverview: true,
      homeHidePlaylistsOverview: false,
    }
  }
]

Let's start with these customizations to the featured sites. The "// ..." commented-out configurations can be left as-is.

Non-functional requirements:

  1. Change file format for the featured-sites.json to JSON5 to support comments and such
  2. Validate & transform the featured-sites.json5 into a cache-busting featured-sites.json upon building/deploying/developing
  3. Comment on compatibility and typing, test automation for preventing un-techy contributors from submitting PRs that break our builds

@mblomdahl suggestion: add menu or home customizations to separate fields in the json like here:
"customizations": { "menu": { "hideHistoryButton": true, } }
what do you think?

@mblomdahl suggestion: add menu or home customizations to separate fields in the json like here: "customizations": { "menu": { "hideHistoryButton": true, } } what do you think?

I think we should wait with making it nested until we have a idea of the full picture, with respect to site-specific customizations.