diff --git a/BTCPayServer/Components/RobotsMetaViewComponent.cs b/BTCPayServer/Components/RobotsMetaViewComponent.cs new file mode 100644 index 000000000..b44310646 --- /dev/null +++ b/BTCPayServer/Components/RobotsMetaViewComponent.cs @@ -0,0 +1,29 @@ +using System.Threading.Tasks; +using BTCPayServer.Models; +using BTCPayServer.Services; +using Microsoft.AspNetCore.Mvc; + +namespace BTCPayServer.Components +{ + public class RobotsMetaViewComponent : ViewComponent + { + private readonly SettingsRepository _SettingsRepository; + + public RobotsMetaViewComponent(SettingsRepository settingsRepository) + { + _SettingsRepository = settingsRepository; + } + + public async Task InvokeAsync() + { + var policies = await _SettingsRepository.GetSettingAsync(); + + return View(new RobotsMetaViewModel() + { + DiscourageSearchEngines = policies.DiscourageSearchEngines + }); + } + } + + +} diff --git a/BTCPayServer/Hosting/Startup.cs b/BTCPayServer/Hosting/Startup.cs index 23e04db8e..8f7cf3f30 100644 --- a/BTCPayServer/Hosting/Startup.cs +++ b/BTCPayServer/Hosting/Startup.cs @@ -37,7 +37,6 @@ using BTCPayServer.PaymentRequest; using Meziantou.AspNetCore.BundleTagHelpers; using BTCPayServer.Security; using BTCPayServer.Services.Apps; -using Robotify.AspNetCore; namespace BTCPayServer.Hosting { diff --git a/BTCPayServer/Models/RobotsMetaViewModel.cs b/BTCPayServer/Models/RobotsMetaViewModel.cs new file mode 100644 index 000000000..609c18c4f --- /dev/null +++ b/BTCPayServer/Models/RobotsMetaViewModel.cs @@ -0,0 +1,7 @@ +namespace BTCPayServer.Models +{ + public class RobotsMetaViewModel + { + public bool DiscourageSearchEngines { get; set; } + } +} \ No newline at end of file diff --git a/BTCPayServer/Views/Shared/Components/RobotsMeta/Default.cshtml b/BTCPayServer/Views/Shared/Components/RobotsMeta/Default.cshtml new file mode 100644 index 000000000..62c824110 --- /dev/null +++ b/BTCPayServer/Views/Shared/Components/RobotsMeta/Default.cshtml @@ -0,0 +1,5 @@ +@model BTCPayServer.Models.RobotsMetaViewModel +@if (Model.DiscourageSearchEngines) +{ + +} diff --git a/BTCPayServer/Views/Shared/_Layout.cshtml b/BTCPayServer/Views/Shared/_Layout.cshtml index 2f2a54e04..d16a920ba 100644 --- a/BTCPayServer/Views/Shared/_Layout.cshtml +++ b/BTCPayServer/Views/Shared/_Layout.cshtml @@ -15,6 +15,9 @@ + + @await Component.InvokeAsync("RobotsMeta", new { }) + BTCPay Server