As I've mentioned in my previous blog post, while I was developing the Optimizely version of my blog, I tried to look for a library that could accommodate my RSS feeds needs with the CMS. I've found one made by another fellow OMVP peer, but unfortunately it wasn't quite covering my own requirements and I thought why not developing it from scratch altogether.
Some might thing it's overkill, but it doesn't matter, I had fun designing & building it. 😄
This NuGet package integrates seamlessly into your Optimizely project and uses Azure Blob Storage for hosting your feeds. Whether you're building a single feed or managing multiple content streams, this tool is ready to meet your needs, and even better, its extensible!
I know there is probably stuff that has been totally overlooked, but any contribution will be greatly welcomed. If you'd like to, simply contact me via LinkedIn and I'll give you the required access to my git repository.
First, install the required NuGet packages:
dotnet add package DavidHome.RssFeed.Optimizely
dotnet add package DavidHome.RssFeed.Storage.AzureBlob
Then configure the plugin in your Startup.cs
:
Configure Azure Blob Storage (inside ConfigureServices
)
services.AddDavidHomeRssFeed(configuration)
.AddOptimizelyFeedIntegration(configuration)
.AddDefaultOptimizelyProcessors()
.AddContentPageFeed<MyContainer, MyItem>()
.AddAzureBlobStorage(_configuration.GetSection("ConnectionStrings").GetSection("EPiServerAzureBlobs"));
Configure
)app.UseAzureBlobRssFeed();
Heads up:
The plugin follows a configuration-less design, meaning you're good to go with just the defaults. But for those who want to tweak things, you can use appsettings.json
to configure your feeds:
{
"DavidHome": {
"RssFeed": {
"ContentMaxLength": 25000000,
"MyCustomContainerPageTypeName": {
"ContentMaxLength": 15000000,
"ContentAreaPropertyName": "MainContentArea",
"FeedTitlePropertyName": "HeadTitle"
}
}
}
}
For Optimizely specific options, the following are available:
@Html.SyndicationLink()
in your layout page.You can personalize every feed, and yes, you can have multiple feeds targeting different sections of your CMS tree!
To integrate with Optimizely’s data structure, you'll need to apply these marker interfaces to your content types:
IRssFeedContainer<TFeedItem>
for container types.IRssFeedItem<TFeedContainer>
for feed items.Pro Tip: Add the IgnoreAttribute
to unsupported properties.
Azure Blob Storage powers the backend for your RSS feeds. It stores generated feeds over there so that when it's being requested, it doesn't go back to the database and try to build it again on the fly. This allows a fast and seamless delivery of the file and avoids to use your precious CPU/database computing resources. A scheduled job is automatically running in the background to generate and store the file representing the syndication feed of your content. It's scheduled by default to run each hours, but can be easily customized under the Optimizely CMS administrative interface.
The library is built with extensibility in mind. While Azure Blob Storage is the default (and required for now), you're welcome to dive into the source code and add your own flair. Whether that's another storage provider or custom processors, the door is wide open for contributions.
Ready to get started? Check out the source code here and give it a try.