OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.36k stars 2.37k forks source link

Ads.txt support #5671

Open JoshTango opened 4 years ago

JoshTango commented 4 years ago

Google AdSense requires me to have ads.txt file in my root folder. How do I do this with Orchard Core?

deanmarcussen commented 4 years ago

You would put the ads.txt in your main startup projects wwwroot folder and as long as you have .UseStaticFiles() called in your main startup it will be available

JoshTango commented 4 years ago

yes for developers, but what about for non developers. I am a developer but I need non developers to be able to do this.

deanmarcussen commented 4 years ago

You should write some code to serve the content you want then.

Here's an example of how I manage robots.txt via the admin. https://github.com/ThisNetWorks/ThisNetWorks.OrchardCore.Seo/tree/develop/src/ThisNetWorks.OrchardCore.Seo.Robots

JoshTango commented 4 years ago

yes i know i can do this, maybe I should have said "feature request" in the title. I want this functionality out of the box in Orchard Core

sebastienros commented 4 years ago

A solution is also covered by this issue: https://github.com/OrchardCMS/OrchardCore/issues/5610

Another solution is to have a custom Ads.txt feature part of an SEO module that would provide a custom UI to manage it.

JoshTango commented 4 years ago

you might as well add a AdSense module. You take the Google Analytics module and copy and paste it or clone it whatever. Then modify it to put the AdSense JavaScript into the head script section. However eventually you will need to give path support because people wont want ads on every single page.