-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a5d902b
commit b9f1913
Showing
10 changed files
with
89 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,16 +34,17 @@ You might need to fix the version when publish your website. For example: | |
|
||
```html | ||
<!-- Use esm.sh, using bundled module --> | ||
<script type="module" src="https://cdn.esm.sh/giscus@1.0.5?bundle"></script> | ||
<script type="module" src="https://cdn.esm.sh/giscus@1.1.1?bundle"></script> | ||
|
||
<!-- or jsDelivr --> | ||
<script type="module" src="https://cdn.jsdelivr.net/npm/giscus@1.0.5/+esm"></script> | ||
<script type="module" src="https://cdn.jsdelivr.net/npm/giscus@1.1.1/+esm"></script> | ||
|
||
<!-- or Skypack, and get the pinned URL as in https://docs.skypack.dev/skypack-cdn/api-reference/pinned-urls-optimized --> | ||
<script type="module" src="https://cdn.skypack.dev/pin/[email protected]/mode=imports,min/optimized/giscus.js"></script> | ||
<script type="module" | ||
src="https://cdn.skypack.dev/pin/[email protected]/mode=imports,min/optimized/giscus.js"></script> | ||
|
||
<!-- or unpkg --> | ||
<script type="module" src="https://unpkg.com/giscus@1.0.5?module"></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. | ||
|
@@ -66,20 +67,27 @@ Then add this component to your `.razor` files where you want the comments to ap | |
InputPosition="InputPosition.Bottom" | ||
Theme="light" | ||
Lang="en" | ||
LazyLoading="true" /> | ||
Loading="Loading.Lazy" /> | ||
``` | ||
|
||
Or you can just add `@using GiscusBlazor` to `_Imports.razor`. | ||
|
||
Most values of the `string` parameters can be found from the [giscus official site](https://giscus.app/). | ||
For most of the `string`-typed parameters, you can use the values from the [giscus official site](https://giscus.app/) | ||
directly. | ||
|
||
## Samples | ||
|
||
You can get some sample apps from the [samples](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](https://giscus.app/)). | ||
- Removed TFM for .NET 5.0, which is now [out of support](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core#lifecycle). | ||
- Removed TFM for .NET 5.0, which is | ||
now [out of support](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core#lifecycle). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
<giscus-widget repo="@Repo" | ||
<giscus-widget host="@Host" | ||
repo="@Repo" | ||
repoid="@RepoId" | ||
category="@Category" | ||
categoryid="@CategoryId" | ||
mapping="@Mapping.ToMappingString()" | ||
strict="@(Strict ? "1" : "0")" | ||
term="@Term" | ||
reactionsenabled="@(ReactionsEnabled ? "1" : "0")" | ||
emitmetadata="@(EmitMetadata ? "1" : "0")" | ||
inputposition="@InputPosition" | ||
inputposition="@InputPosition.ToPositionString()" | ||
theme="@Theme" | ||
lang="@Lang" | ||
loading="@(LazyLoading ? "lazy" : "")"> | ||
loading="@Loading.ToLoadingString()"> | ||
</giscus-widget> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System; | ||
|
||
namespace GiscusBlazor | ||
{ | ||
public enum Loading | ||
{ | ||
Lazy, | ||
Eager | ||
} | ||
|
||
internal static class LoadingExtensions | ||
{ | ||
internal static string ToLoadingString(this Loading loading) => | ||
loading switch | ||
{ | ||
Loading.Eager => "eager", | ||
Loading.Lazy => "lazy", | ||
_ => throw new ArgumentOutOfRangeException(nameof(loading)) | ||
}; | ||
} | ||
} |