GiscusBlazor 2.3.1
dotnet add package GiscusBlazor --version 2.3.1
NuGet\Install-Package GiscusBlazor -Version 2.3.1
<PackageReference Include="GiscusBlazor" Version="2.3.1" />
<PackageVersion Include="GiscusBlazor" Version="2.3.1" />
<PackageReference Include="GiscusBlazor" />
paket add GiscusBlazor --version 2.3.1
#r "nuget: GiscusBlazor, 2.3.1"
#:package GiscusBlazor@2.3.1
#addin nuget:?package=GiscusBlazor&version=2.3.1
#tool nuget:?package=GiscusBlazor&version=2.3.1
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:
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
- Add support for lazy-loading (see giscus official site).
- Removed TFM for .NET 5.0, which is now out of support.
Product | Versions 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. |
-
net6.0
- Microsoft.AspNetCore.Components.Web (>= 6.0.13)
-
net7.0
- Microsoft.AspNetCore.Components.Web (>= 7.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Add support for lazy-loading parameter