-
Notifications
You must be signed in to change notification settings - Fork 0
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
42552fc
commit c234e33
Showing
37 changed files
with
1,013 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"version": 1, | ||
"isRoot": true, | ||
"tools": { | ||
"cake.tool": { | ||
"version": "1.3.0", | ||
"commands": [ | ||
"dotnet-cake" | ||
] | ||
} | ||
} | ||
} |
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 @@ | ||
*.png filter=lfs diff=lfs merge=lfs -text |
Validating CODEOWNERS rules …
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,3 @@ | ||
# These owners will be the default owners for everything in the repo and | ||
# will be requested for review when someone opens a pull request. | ||
* @swissgrc/development |
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,6 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"extends": [ | ||
"github>swissgrc/renovate-presets:cake-recipe" | ||
] | ||
} |
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,66 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
- "release/**" | ||
- "hotfix/**" | ||
tags: | ||
- "*" | ||
paths-ignore: | ||
- "README.md" | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ windows-2022, ubuntu-22.04, macos-12 ] | ||
|
||
env: | ||
GITHUB_PAT: ${{ secrets.GH_TOKEN }} | ||
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | ||
NUGET_SOURCE: "https://api.nuget.org/v3/index.json" | ||
|
||
steps: | ||
- name: Checkout the repository | ||
uses: actions/[email protected] | ||
- name: Fetch all tags and branches | ||
run: git fetch --prune --unshallow | ||
- uses: actions/[email protected] | ||
with: | ||
# GitVersion needs 5.0 | ||
dotnet-version: | | ||
5.0 | ||
6.0 | ||
7.0 | ||
8.0 | ||
- name: Cache Tools | ||
uses: actions/[email protected] | ||
with: | ||
path: tools | ||
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }} | ||
- name: Build project | ||
uses: cake-build/[email protected] | ||
with: | ||
script-path: recipe.cake | ||
target: CI | ||
cake-version: 1.3.0 | ||
- name: Upload Issues | ||
uses: actions/[email protected] | ||
with: | ||
if-no-files-found: warn | ||
name: ${{ matrix.os }} Issues | ||
path: | | ||
BuildArtifacts/report.html | ||
BuildArtifacts/**/coverlet/*.xml | ||
- name: Upload Packages | ||
uses: actions/[email protected] | ||
if: runner.os == 'Windows' | ||
with: | ||
if-no-files-found: warn | ||
name: package | ||
path: BuildArtifacts/Packages/**/* |
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,3 @@ | ||
{ | ||
"dotnet.defaultSolution": "src\\Statiq.Alerts.sln" | ||
} |
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,2 +1,174 @@ | ||
# Statiq.Alerts | ||
📙 Extension for Statiq site generator to add annotations | ||
|
||
[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/swissgrc/Statiq.Alerts/blob/main/LICENSE) | ||
[![Build](https://img.shields.io/github/actions/workflow/status/swissgrc/Statiq.Alerts/build.yml?branch=develop&style=flat-square)](https://github.com/swissgrc/Statiq.Alerts/actions/workflows/build.yml) | ||
[![Downloads](https://img.shields.io/nuget/dt/Statiq.Alerts?style=flat-square)](https://www.nuget.org/packages/Statiq.Alerts) | ||
|
||
Extension for [Statiq site generator] to add alerts. | ||
|
||
## Table of Contents | ||
|
||
<!-- - [Security](#security) | ||
- [Background](#background) --> | ||
- [Install](#install) | ||
- [Usage](#usage) | ||
- [API](#api) | ||
- [Contributing](#contributing) | ||
- [License](#license) | ||
|
||
## Install | ||
|
||
1. Add the `Statiq.Alerts` NuGet package to the Statiq project | ||
2. Call `.AddAlertShortCodes()` on the bootstrapper | ||
|
||
### Requirements | ||
|
||
The extension requires that [Bootstrap] and [FontAwesome] are loaded by the Statiq theme. | ||
|
||
## Usage | ||
|
||
See [Using Shortcodes] for detailed instructions how to use shortcodes in Statiq. | ||
|
||
### Tip | ||
|
||
```markdown | ||
<?# Tip ?> | ||
This is a tip | ||
<?#/ Tip ?> | ||
``` | ||
|
||
Shows a tip alert: | ||
|
||
![Tip alert](docs/tip.png) | ||
|
||
### Info | ||
|
||
```markdown | ||
<?# Info ?> | ||
This is an info message | ||
<?#/ Info ?> | ||
``` | ||
|
||
Shows an info message: | ||
|
||
![Info alert](docs/info.png) | ||
|
||
### Note | ||
|
||
```markdown | ||
<?# Note ?> | ||
This is a note | ||
<?#/ Note ?> | ||
``` | ||
|
||
Shows a note: | ||
|
||
![Note alert](docs/note.png) | ||
|
||
### Warning | ||
|
||
```markdown | ||
<?# Warning ?> | ||
This is a warning | ||
<?#/ Warning ?> | ||
``` | ||
|
||
Shows a warning: | ||
|
||
![Warning alert](docs/warning.png) | ||
|
||
### Important | ||
|
||
```markdown | ||
<?# Important ?> | ||
This is an important message | ||
<?#/ Important ?> | ||
``` | ||
|
||
Shows an important message: | ||
|
||
![Important alert](docs/important.png) | ||
|
||
## API | ||
|
||
### Custom Shortcuts | ||
|
||
Additional custom shortcuts can be implemented by inheriting from the `AlertShortcode` class and | ||
define the `DefaultAlertClass`, `DefaultAlertIcon` and `DefaultAlertTitle` properties. | ||
See [Parameters](#Parameters) for documentation about possible values. | ||
|
||
### Parameters | ||
|
||
The following parameters are available on all shortcuts and allow to override the default styling. | ||
|
||
#### Class | ||
|
||
The `Class` parameter allows to override the CSS class of the alert `div` element: | ||
|
||
```markdown | ||
<?# Note Class="alert-secondary"?> | ||
This is a note rendered in the secondary color | ||
<?#/ Note ?> | ||
``` | ||
|
||
The `alert` class will always be set. | ||
|
||
#### Icon | ||
|
||
##### Changing the icon | ||
|
||
The `Icon` parameters allows to override the icon of the alert: | ||
|
||
```markdown | ||
<?# Note Title="fa-check"?> | ||
This is a note with a different icon | ||
<?#/ Note ?> | ||
``` | ||
|
||
Any [Fontawesome] icon can be used. | ||
The `fa-solid` class will always be set. | ||
|
||
##### Removing the icon | ||
|
||
To remove the icon the `Icon` parameter can be set to an empty string: | ||
|
||
```markdown | ||
<?# Note Iocn=""?> | ||
This is a note without an icon | ||
<?#/ Note ?> | ||
``` | ||
|
||
#### Title | ||
|
||
##### Changing the title | ||
|
||
The `Title` parameters allows to override the title of the alert: | ||
|
||
```markdown | ||
<?# Note Title="Custom Title"?> | ||
This is a note with a custom title | ||
<?#/ Note ?> | ||
``` | ||
|
||
##### Removing the title | ||
|
||
To remove the title the `Title` parameter can be set to an empty string: | ||
|
||
```markdown | ||
<?# Note Title=""?> | ||
This is a note without a title | ||
<?#/ Note ?> | ||
``` | ||
|
||
## Contributing | ||
|
||
We accept Pull Requests | ||
|
||
## License | ||
|
||
[MIT © Swiss GRC AG](LICENSE) | ||
|
||
[Statiq site generator]: https://www.statiq.dev/ | ||
[Bootstrap]: https://getbootstrap.com/ | ||
[FontAwesome]: https://fontawesome.com/ | ||
[Using Shortcodes]: https://www.statiq.dev/guide/content-and-data/shortcodes#using-shortcodes |
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,13 @@ | ||
$SCRIPT_NAME = "recipe.cake" | ||
|
||
Write-Host "Restoring .NET Core tools" | ||
dotnet tool restore | ||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | ||
|
||
Write-Host "Bootstrapping Cake" | ||
dotnet cake $SCRIPT_NAME --bootstrap | ||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | ||
|
||
Write-Host "Running Build" | ||
dotnet cake $SCRIPT_NAME @args | ||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } |
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,11 @@ | ||
#!/bin/bash | ||
SCRIPT_NAME="recipe.cake" | ||
|
||
echo "Restoring .NET Core tools" | ||
dotnet tool restore | ||
|
||
echo "Bootstrapping Cake" | ||
dotnet cake $SCRIPT_NAME --bootstrap | ||
|
||
echo "Running Build" | ||
dotnet cake $SCRIPT_NAME "$@" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,7 @@ | ||
{ | ||
"sdk": { | ||
"allowPrerelease": true, | ||
"version": "8.0.100", | ||
"rollForward": "latestFeature" | ||
} | ||
} |
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,22 @@ | ||
#load nuget:?package=Cake.Recipe&version=3.1.1 | ||
|
||
Environment.SetVariableNames(); | ||
|
||
BuildParameters.SetParameters( | ||
context: Context, | ||
buildSystem: BuildSystem, | ||
sourceDirectoryPath: "./src", | ||
title: "Statiq.Alerts", | ||
masterBranchName: "main", | ||
repositoryOwner: "swissgrc", | ||
repositoryName: "Statiq.Alerts", | ||
shouldRunDotNetCorePack: true, | ||
shouldUseDeterministicBuilds: true, | ||
preferredBuildProviderType: BuildProviderType.GitHubActions, | ||
preferredBuildAgentOperatingSystem: PlatformFamily.Linux); | ||
|
||
BuildParameters.PrintParameters(Context); | ||
|
||
ToolSettings.SetToolSettings(context: Context); | ||
|
||
Build.RunDotNetCore(); |
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,5 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<LangVersion>latest</LangVersion> | ||
</PropertyGroup> | ||
</Project> |
Oops, something went wrong.