GiscusBlazor 2.3.1

dotnet add package GiscusBlazor --version 2.3.1
                    
NuGet\Install-Package GiscusBlazor -Version 2.3.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GiscusBlazor" Version="2.3.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GiscusBlazor" Version="2.3.1" />
                    
Directory.Packages.props
<PackageReference Include="GiscusBlazor" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add GiscusBlazor --version 2.3.1
                    
#r "nuget: GiscusBlazor, 2.3.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package GiscusBlazor@2.3.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=GiscusBlazor&version=2.3.1
                    
Install as a Cake Addin
#tool nuget:?package=GiscusBlazor&version=2.3.1
                    
Install as a Cake Tool

giscus-blazor

A Blazor component to embed giscus, a comments system powered by GitHub Discussions.

Supports both Blazor WebAssembly and Blazor Server.

Getting started

To start, install it from NuGet:

Nuget GiscusBlazor

dotnet add package GiscusBlazor

Then add either one of the following tag to your wwwroot/index.html (Blazor WebAssembly) or Pages/_Layout.cshtml (Blazor Server) as the last child of <head> element.


<script type="module" src="https://cdn.esm.sh/giscus?bundle"></script>


<script type="module" src="https://cdn.jsdelivr.net/npm/giscus/+esm"></script>


<script type="module" src="https://cdn.skypack.dev/giscus"></script>


<script type="module" src="https://unpkg.com/giscus?module"></script>

You might need to fix the version when publish your website. For example:


<script type="module" src="https://cdn.esm.sh/giscus@1.1.1?bundle"></script>


<script type="module" src="https://cdn.jsdelivr.net/npm/giscus@1.1.1/+esm"></script>


<script type="module"
        src="https://cdn.skypack.dev/pin/giscus@v1.1.1-pMHE0mo1rPPSOZMcMNip/mode=imports,min/optimized/giscus.js"></script>


<script type="module" src="https://unpkg.com/giscus@1.1.1?module"></script>

You can also install giscus in your wwwroot folder with npm or other Node.js package manager, and include it like above.

Then add this component to your .razor files where you want the comments to appear like this:


@using GiscusBlazor


<Giscus Repo="[ENTER REPO HERE]"
        RepoId="[ENTER REPO ID HERE]"
        Category="[ENTER CATEGORY NAME HERE]"
        CategoryId="[ENTER CATEGORY ID HERE]"
        Mapping="Mapping.Specific"
        Term="[ENTER TERM HERE]"
        ReactionsEnabled="true"
        EmitMetadata="false"
        InputPosition="InputPosition.Bottom"
        Theme="light"
        Lang="en"
        Loading="Loading.Lazy" />

Or you can just add @using GiscusBlazor to _Imports.razor.

For most of the string-typed parameters, you can use the values from the giscus official site directly.

Samples

You can get some sample apps from the samples directory, in both Blazor WebAssembly and Blazor Server.

Changelog

v2.3.0

  • Add host support.
  • Rearrange some parameters.

v2.2.1

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.3.1 1,042 2/14/2023
2.3.0 743 7/29/2022
2.2.1 557 5/15/2022
2.2.0 599 3/13/2022
2.1.0 489 3/3/2022
2.0.0 476 3/2/2022
1.2.1 499 3/1/2022
1.2.0 498 2/25/2022

Add support for lazy-loading parameter