Skip to content

Latest commit

 

History

History
139 lines (126 loc) · 15.1 KB

Configuration.md

File metadata and controls

139 lines (126 loc) · 15.1 KB

Configurations

appsettings.json

The appsettings.json file has a lot of options to customize the content of the blog. The following table shows which values are used when.

Browser spellchecking uses the <html lang="en"> value in src/LinkDotNet.Blog.Web/App.razor. Change en to your blog's language so the browser selects the correct dictionary.

{
  "BlogName": "My Blog",
  "BlogBrandUrl": null,
  "Social": {
    "GithubAccountUrl": "",
    "LinkedInAccountUrl": "",
    "TwitterAccountUrl": "",
    "YoutubeAccountUrl": "",
    "BlueSkyHandle": ""
  },
  "Introduction": {
    "Description": "A short introduction to your blog.",
    "BackgroundUrl": "assets/profile-background.webp",
    "ProfilePictureUrl": "assets/profile-picture.webp"
  },
  "PersistenceProvider": "Sqlite",
  "ConnectionString": "Data Source=blog.db",
  "DatabaseName": "",
  "Authentication": {
    "Provider": "Auth0",
    "Domain": "",
    "ClientId": "",
    "ClientSecret": ""
  },
  "BlogPostsPerPage": 10,
  "FirstPageCacheDurationInMinutes": 10,
  "ProfileInformation": {
    "Name": "Your Name",
    "Heading": "Your role",
    "ProfilePictureUrl": "assets/profile-picture.webp"
  },
  "ShowReadingIndicator": true,
  "ShowSimilarPosts": true,
  "ShowBuildInformation": true,
  "UseMultiAuthorMode": false,
  "EnableTagDiscoveryPanel": true,
  "EnableBrokenLinkChecker": true,
  "ShowCodeBlockLanguage": true,
  "EnableMarkdownForLlms": false,
  "ImageStorageProvider": "<Provider>",
  "ImageStorage": {
    "AuthenticationMode": "Default",
    "ConnectionString": "",
    "ServiceUrl": "",
    "ContainerName": "",
    "CdnEndpoint": ""
  }
}
Property Type Description
BlogName string Name of your blog. Is used in the navbar and is used as the title of the page. Will not be shown when BlogBrandUrl is set
BlogBrandUrl string The url to an image which is used as a brand image in the navigation bar. If not set or null the BlogName will be shown. See Styling.md for a visual example
Social node Represents all possible linked social accounts
GithubAccountUrl string Url to your github account. If not set it is not shown in the introduction card
LinkedInAccountUrl string Url to your LinkedIn account. If not set it is not shown in the introduction card
TwitterAccountUrl string Url to your Twitter account. If not set it is not shown in the introduction card
YoutubeAccountUrl string Url to your Youtube account. If not set it is not shown in the introduction card
BlueSkyHandle string Bluesky handle used to link to your profile. If not set, the Bluesky link is not shown.
Introduction Is used for the introduction part of the blog
Description MarkdownString Small introduction text for yourself. This is also used for <meta name="description"> tag. For this the markup will be converted to plain text
BackgroundUrl string Url or path to the background image. (Optional). See Styling.md for a visual example
ProfilePictureUrl string Url or path to your profile picture
PersistenceProvider string Declares the type of the storage provider (one of the following: SqlServer, Sqlite, RavenDb, MongoDB, MySql, PostgreSql). More in-depth explanation here
ConnectionString string Is used for connection to a database.
DatabaseName string Database name used by the RavenDB and MongoDB providers.
Authentication:Provider string Authentication provider configured for the app. See Authorization.
Authentication:Domain string Provider domain or tenant authority.
Authentication:ClientId string Application client ID.
Authentication:ClientSecret string Application client secret. Keep secrets outside committed configuration files.
Authentication:LogoutUri string Optional provider logout URL, when required by the provider.
BlogPostsPerPage int Gives the amount of blog posts loaded and display per page. For more the user has to use the navigation
FirstPageCacheDurationInMinutes int The duration in minutes the first page is cached.
ProfileInformation node Sets information for the About Me page. If omitted, the page is disabled.
Name string Name, which is displayed on top of the profile card
Heading string Displayed under the name. For example job title
ProfilePictureUrl string Displayed profile picture
Giscus node Enables the comment section via giscus. If left empty the comment section will not be shown.
Disqus node Enables the comment section via disqus. If left empty the comment section will not be shown.
ShowReadingIndicator boolean If set to true (default) a circle indicates the progress when a user reads a blog post (without comments).
ShowSimilarPosts boolean If set to true, similar blog posts are shown at the end of a blog post.
ShowBuildInformation boolean If set to true (default) the build information (target framework and build timestamp) is shown in the footer.
SupportMe node Donation sections configuration. If left empty no donation sections will not be shown.
ImageStorageProvider string Declares the image storage provider: Azure or Local. Any other value disables uploads.
ImageStorage node Configuration for the image storage provider.
ImageStorage:AuthenticationMode string The image storage authentication mode: Default or ConnectionString.
ImageStorage:ConnectionString string The Azure Storage connection string. Used only when AuthenticationMode is ConnectionString.
ImageStorage:ServiceUrl string The Azure Blob Storage service URL. Used with Default authentication.
ImageStorage:ContainerName string The Azure Storage container name.
ImageStorage:CdnEndpoint string Optional CDN endpoint returned for uploaded assets instead of the storage account URL.
UseMultiAuthorMode boolean The default value is false. If set to true then author name will be associated with blog posts at the time of creation. This author name will be fetched from the identity provider's name or nickname or preferred_username claim property.
EnableTagDiscoveryPanel boolean The default value is true. Enables the Tag Discovery Panel, which helps users discover topics by browsing popular tags.
EnableBrokenLinkChecker boolean The default value is true. Checks all external links of published blog posts once a day and lists broken ones on the "Broken links" admin page.
ShowCodeBlockLanguage boolean The default value is true. Shows the language of a fenced code block (e.g. csharp) in the header of the code block.
EnableMarkdownForLlms boolean The default value is false. Serves published blog posts as markdown to clients (like LLMs) that ask for text/markdown or append .md to the url, and serves /llms.txt. See Markdown for LLMs.

Markdown for LLMs

If EnableMarkdownForLlms is set to true, a blog post page (/blogPost/{id} or /blogPost/{id}/{slug}) can be requested as markdown instead of HTML. LLMs and agents then don't have to parse the HTML page. Only blog post pages support this; every other page always returns HTML.

curl -H "Accept: text/markdown" https://example.com/blogPost/38a0d0f4-e9ff-4947-a05c-527af68b6cd1

The response (Content-Type: text/markdown; charset=utf-8) contains YAML front matter, the title and the raw markdown content with all short codes expanded:

---
title: "My blog post"
description: "The short description"
updated: 2026-09-01
tags: ["dotnet", "csharp"]
canonical: "https://example.com/blogPost/38a0d0f4-e9ff-4947-a05c-527af68b6cd1/my-blog-post"
---

# My blog post

The content...
  • author is added when UseMultiAuthorMode is enabled and the blog post has an author; tags is omitted when the blog post has none.
  • Markdown is only served if text/markdown is weighted at least as high as HTML in the Accept header (text/html, text/* or */*), so text/markdown, text/html;q=0.9 returns markdown, while text/html, text/markdown;q=0.9 and a regular browser request return HTML.
  • Only published blog posts are served. Unpublished, scheduled and unknown blog posts return 404 with a markdown body.
  • Blog post responses carry Vary: Accept so caches and CDNs keep the HTML and markdown variants apart.
  • Appending .md to a blog post url (/blogPost/{id}.md or /blogPost/{id}/{slug}.md) returns markdown regardless of the Accept header, for agents that can't set headers.
  • HTML blog post pages advertise the markdown version via a Link: </blogPost/{id}/{slug}.md>; rel="alternate"; type="text/markdown" header and a <link rel="alternate" type="text/markdown"> tag.
  • /llms.txt (see llmstxt.org) lists the blog name, introduction and all published blog posts with links to their markdown version.
  • If the setting is false or missing, the Accept header is ignored and HTML is always returned, /blogPost/{id}/{slug}.md renders the HTML page (the slug is ignored) while /blogPost/{id}.md shows the not found page, no Link header or <link> tag is emitted and /llms.txt returns 404.