Docs

Fanray is a blog built on .NET Core. It’s extensible, easy to setup and simple to use.

Getting Started

Prerequisite

Fanray v1.1 runs on .NET Core 3.1 and SQL Server. Any of the free SQL Server editions, LocalDB, Express, Developer will be sufficient.

Launch

Clone the repo then run from either VS2019 or command line.

  • VS2019: open Fanray.sln, make sure Fan.WebApp is the startup project, Ctrl + F5
  • Command line: do the following, then go to http://localhost:5001
cd <sln folder>
dotnet restore
cd src/Core/Fan.WebApp
dotnet run

Database is created for you on app initial launch. Below is the default connection string, to adjust it go to appsettings.json

"ConnectionStrings": {
  "DefaultConnection": "Server=(localdb)\\MSSQLLocalDB;Database=Fanray;Trusted_Connection=True;MultipleActiveResultSets=true"
},

⚠️ The 404 page is only displayed in Production when an invalid URL is accessed, in Development the developer exception page is shown.

Site Setup

Create your blog

Upon initial launch of the app, you will see the following form asking for some basic site info as well as info to create an administrator user.

Blog Setup

Disqus

Currently Disqus is the only way to do comments, simply copy your Disqus Shortname and save it to your Admin > Settings under Blog settings.

To find your Disqus Shortname, go to Disqus Admin Settings, then choose your site, and your shortname will be listed under the Shortname section.

Disqus Shortname

Google Analytics

To enable Google Analytics, copy the Google Analytics Tracking ID and save it to your Admin > Settings under Site settings. You can find more instructions on GA’s docs page.

Preferred Domain: www or non-www

The preferred domain is the one that you would liked used to index your site’s pages (sometimes this is referred to as the canonical domain), this Google document Set your preferred domain (www or non-www) explains it very well.

Basically it’s your preference on whether you want your domain to start with www or without it. Since this particular requirement is so common, Fanray provides a simple option in the appsettings.json to turn it on or off.

Out of box you’d find the following in appsettings.Production.json

"AppSettings": {
    // The preferred domain to use: "auto" (default), "www" or "nonwww". https://support.google.com/webmasters/answer/44231?hl=en
    // - "auto" will use whatever the url is given, will not do forward
    // - "www" will forward root domain to www subdomain, e.g. fanray.com -> www.fanray.com
    // - "nonwww" will forward www subdomain to root domain, e.g. www.fanray.com -> fanray.com
    "PreferredDomain": "www",
    ...
}

Deploy to Azure