mirror of
https://github.com/yawaflua/yaflay.ru.git
synced 2026-02-04 19:04:12 +02:00
add providers to oembed, add robots.txt
This commit is contained in:
27
Startup.cs
27
Startup.cs
@@ -1,5 +1,7 @@
|
||||
using Microsoft.Extensions.Options;
|
||||
using HeyRed.OEmbed;
|
||||
using HeyRed.OEmbed.Providers;
|
||||
|
||||
namespace yaflay.ru
|
||||
{
|
||||
public class Startup
|
||||
@@ -26,7 +28,30 @@ namespace yaflay.ru
|
||||
{
|
||||
options.EnableCache = true; // true by default
|
||||
options.EnsureNotNull();
|
||||
});
|
||||
})
|
||||
.ClearProviders()
|
||||
.AddProvider<YoutubeProvider>()
|
||||
.AddProvider<YandexMusicProvider>()
|
||||
.AddProvider<FlickrProvider>()
|
||||
.AddProvider<TwitterProvider>(options =>
|
||||
{
|
||||
options.Parameters = new Dictionary<string, string?>
|
||||
{
|
||||
["theme"] = "dark"
|
||||
};
|
||||
})
|
||||
.AddProvider<FacebookProvider>(options =>
|
||||
{
|
||||
options.Parameters = new Dictionary<string, string?>
|
||||
{
|
||||
["access_token"] = "app_id|token"
|
||||
};
|
||||
});
|
||||
services.AddMvc()
|
||||
.AddRazorPagesOptions(options =>
|
||||
{
|
||||
options.Conventions.AddPageRoute("/robotstxt", "/Robots.Txt");
|
||||
});
|
||||
//services.AddDirectoryBrowser();
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user