From 6fdc2990d1fd5cb7d1751d9d03145b3b78ea507e Mon Sep 17 00:00:00 2001 From: Harry Chen Date: Sat, 19 Sep 2020 00:39:54 +0800 Subject: [PATCH] Add force_show_help_mirrors Signed-off-by: Harry Chen --- _data/options.yml | 5 ++++- static/js/help.es6 | 3 +++ static/js/index.es6 | 2 +- static/njs/legacy_index.njs | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/_data/options.yml b/_data/options.yml index 0f59fb1..b201b08 100644 --- a/_data/options.yml +++ b/_data/options.yml @@ -466,7 +466,7 @@ unlisted_mirrors: url: '/github-release/conda-forge/miniforge/' -force_help_mirrors: +force_redirect_help_mirrors: - AOSP - lineageOS - homebrew @@ -490,6 +490,9 @@ force_help_mirrors: - flutter-sdk.git - julia-general.git +force_show_help_mirrors: + - hugging-face-models + label_map: unknown: label-default syncing: label-info diff --git a/static/js/help.es6 b/static/js/help.es6 index c684201..e83ff48 100644 --- a/static/js/help.es6 +++ b/static/js/help.es6 @@ -45,6 +45,9 @@ $(document).ready(() => { globalOptions.unlisted_mirrors.forEach(elem => { availableMirrorIds.add(elem.name) }); + globalOptions.force_show_help_mirrors.forEach(elem => { + availableMirrorIds.add(elem) + }); console.log(window.mirrorId); if (!availableMirrorIds.has(window.mirrorId)) { location.href = "/404-help-hidden.html"; // this will break 404 issue submission diff --git a/static/js/index.es6 b/static/js/index.es6 index 7852c51..84b6b0c 100644 --- a/static/js/index.es6 +++ b/static/js/index.es6 @@ -11,7 +11,7 @@ var new_mirrors = {}; global_options.options.new_mirrors.forEach((m) => new_mirrors[m] = true); var unlisted = global_options.options.unlisted_mirrors; var options = {}; -global_options.options.force_help_mirrors.forEach((m) => options[m] = {'url': "/help/" + m + "/"}) +global_options.options.force_redirect_help_mirrors.forEach((m) => options[m] = {'url': "/help/" + m + "/"}) var descriptions = {}; global_options.options.mirror_desc.forEach((m) => descriptions[m.name] = m.desc); diff --git a/static/njs/legacy_index.njs b/static/njs/legacy_index.njs index 7b23bc5..62b0de4 100644 --- a/static/njs/legacy_index.njs +++ b/static/njs/legacy_index.njs @@ -47,7 +47,7 @@ function legacyIndexRender(r){ global_options.options.new_mirrors.forEach((m) => new_mirrors[m] = true); var unlisted = global_options.options.unlisted_mirrors; var force_help = {} - global_options.options.force_help_mirrors.forEach((m) => force_help[m] = true); + global_options.options.force_redirect_help_mirrors.forEach((m) => force_help[m] = true); var descriptions = {}; global_options.options.mirror_desc.forEach((m) => descriptions[m.name] = m.desc); r.subrequest('/static/tunasync.json', {