jekyll-alerts-plugin 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +100 -0
- data/lib/jekyll-alerts-plugin.rb +164 -0
- data/styles.scss +118 -0
- metadata +72 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 3235aec0292542b5a6af0c457cf0a2e1eb6ba6e328ee65ec860362fbd4980638
|
|
4
|
+
data.tar.gz: ed7628d757e71911ad39d9f73eb3279c80e6f90eff0590423559587ea016b166
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 50049d5c1eb5043a65fcbd158a0019fb0f51ad3fdaad4449c6c3cff65d4df5d5f2626d676b88a7a4768f8d85c3adb663a66ed633642687f498015bc01ed96349
|
|
7
|
+
data.tar.gz: add775adc16f5a026e3114c5a6b7b5303299d732ba5916dea0c7feacf930c3e100717c3339f858a5e724781fe49c2923acdee7d09bdbf129379eb69008c0d4e0
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Adam Hassan
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# jekyll-alerts-plugin
|
|
2
|
+
|
|
3
|
+
GitHub-style alerts / callouts for Jekyll. **Markdown works inside the body**
|
|
4
|
+
and **the CSS is injected automatically** - add the plugin and you're done, no
|
|
5
|
+
stylesheet to import.
|
|
6
|
+
|
|
7
|
+
Blog write-up [here](https://hackback.zip/2024/03/10/Jekyll-GitHub-Alerts-Liquid.html).
|
|
8
|
+
|
|
9
|
+
## Syntax
|
|
10
|
+
|
|
11
|
+
### GitHub blockquote (recommended)
|
|
12
|
+
|
|
13
|
+
Exactly like GitHub. The body is parsed as Markdown:
|
|
14
|
+
|
|
15
|
+
```markdown
|
|
16
|
+
> [!NOTE]
|
|
17
|
+
> Highlights information that users should take into account, even when skimming.
|
|
18
|
+
|
|
19
|
+
> [!TIP]
|
|
20
|
+
> Optional information to help a user be more successful.
|
|
21
|
+
|
|
22
|
+
> [!IMPORTANT]
|
|
23
|
+
> Crucial information necessary for users to succeed.
|
|
24
|
+
|
|
25
|
+
> [!WARNING]
|
|
26
|
+
> Critical content demanding immediate user attention due to potential risks.
|
|
27
|
+
|
|
28
|
+
> [!CAUTION]
|
|
29
|
+
> Negative potential consequences of an action.
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Liquid block
|
|
33
|
+
|
|
34
|
+
```liquid
|
|
35
|
+
{% alert note %}
|
|
36
|
+
A note with a [markdown link](https://example.com), **bold**, and `code`.
|
|
37
|
+
|
|
38
|
+
- lists work too
|
|
39
|
+
- across multiple lines
|
|
40
|
+
{% endalert %}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Install
|
|
44
|
+
|
|
45
|
+
> [!NOTE]
|
|
46
|
+
> Custom plugins (gem or `_plugins/`) run on any Jekyll build **except**
|
|
47
|
+
> GitHub Pages' native build. Use GitHub Actions, Netlify, or a local build.
|
|
48
|
+
|
|
49
|
+
### As a gem (from GitHub Packages)
|
|
50
|
+
|
|
51
|
+
1. Tell Bundler where to find the package, then add the gem. In your `Gemfile`:
|
|
52
|
+
|
|
53
|
+
```ruby
|
|
54
|
+
source "https://rubygems.pkg.github.com/Adamkadaban" do
|
|
55
|
+
gem "jekyll-alerts-plugin"
|
|
56
|
+
end
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
2. Authenticate to GitHub Packages once (a token with `read:packages`):
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
bundle config https://rubygems.pkg.github.com/Adamkadaban USERNAME:TOKEN
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
3. Add it to `_config.yml`:
|
|
66
|
+
|
|
67
|
+
```yaml
|
|
68
|
+
plugins:
|
|
69
|
+
- jekyll-alerts-plugin
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
That's it - alerts render and the stylesheet is injected automatically.
|
|
73
|
+
|
|
74
|
+
### Drop-in (no gem)
|
|
75
|
+
|
|
76
|
+
Copy `lib/jekyll-alerts-plugin.rb` into your site's `_plugins/` directory. It is
|
|
77
|
+
self-contained, so it works the same way (including auto-injected CSS).
|
|
78
|
+
|
|
79
|
+
## Styling
|
|
80
|
+
|
|
81
|
+
The default GitHub palette is injected automatically. The alert background uses
|
|
82
|
+
`var(--bg-secondary, #f6f8fa)`, so it adopts your theme's `--bg-secondary` if you
|
|
83
|
+
have one and falls back to a light surface otherwise.
|
|
84
|
+
|
|
85
|
+
To supply your own CSS instead, disable the injection and add the rules from
|
|
86
|
+
`styles.scss` (which use CSS variables you can theme for light/dark):
|
|
87
|
+
|
|
88
|
+
```yaml
|
|
89
|
+
jekyll_alerts:
|
|
90
|
+
inject_css: false
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## How it works
|
|
94
|
+
|
|
95
|
+
- A Liquid block tag (`{% alert %}`) renders the body through the site's Markdown
|
|
96
|
+
converter, then wraps it in GitHub-style markup with an Octicon.
|
|
97
|
+
- A `pre_render` hook rewrites `> [!TYPE]` blockquotes into that tag before Liquid
|
|
98
|
+
runs, skipping fenced code blocks. Ordinary blockquotes are left untouched.
|
|
99
|
+
- A `post_render` hook injects the stylesheet once into any page that contains an
|
|
100
|
+
alert (unless `inject_css: false`).
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# jekyll-alerts-plugin
|
|
4
|
+
#
|
|
5
|
+
# GitHub-style alerts / callouts for Jekyll, with Markdown parsed inside the
|
|
6
|
+
# body and the CSS injected automatically (no manual stylesheet import).
|
|
7
|
+
#
|
|
8
|
+
# Two authoring syntaxes, both parse Markdown inside:
|
|
9
|
+
#
|
|
10
|
+
# > [!NOTE]
|
|
11
|
+
# > A note with a [markdown link](https://example.com) and **bold**.
|
|
12
|
+
#
|
|
13
|
+
# {% alert note %}
|
|
14
|
+
# A note with a [markdown link](https://example.com) and **bold**.
|
|
15
|
+
# {% endalert %}
|
|
16
|
+
#
|
|
17
|
+
# This single file works both as a gem (require "jekyll-alerts-plugin") and as a
|
|
18
|
+
# drop-in `_plugins/` script - it has no internal requires.
|
|
19
|
+
|
|
20
|
+
require "jekyll"
|
|
21
|
+
|
|
22
|
+
module JekyllAlertsPlugin
|
|
23
|
+
VERSION = "1.1.1"
|
|
24
|
+
|
|
25
|
+
TYPES = %w[note tip important warning caution].freeze
|
|
26
|
+
|
|
27
|
+
LABELS = {
|
|
28
|
+
"note" => "Note", "tip" => "Tip", "important" => "Important",
|
|
29
|
+
"warning" => "Warning", "caution" => "Caution"
|
|
30
|
+
}.freeze
|
|
31
|
+
|
|
32
|
+
ICONS = {
|
|
33
|
+
"note" => %q(<svg class="octicon octicon-info mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>),
|
|
34
|
+
"tip" => %q(<svg class="octicon octicon-tip mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z"></path></svg>),
|
|
35
|
+
"important" => %q(<svg class="octicon octicon-important mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>),
|
|
36
|
+
"warning" => %q(<svg class="octicon octicon-warning mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>),
|
|
37
|
+
"caution" => %q(<svg class="octicon octicon-caution mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>)
|
|
38
|
+
}.freeze
|
|
39
|
+
|
|
40
|
+
# Default styles, injected automatically. The background falls back to a light
|
|
41
|
+
# GitHub-ish surface but honors a --bg-secondary theme variable if the site
|
|
42
|
+
# defines one, so it looks right in both standalone and themed sites.
|
|
43
|
+
CSS = <<~CSS
|
|
44
|
+
.markdown-alert{margin-bottom:16px;color:inherit;background-color:var(--bg-secondary,#f6f8fa);border-left:.3rem solid;border-radius:.3rem;padding:.5em}
|
|
45
|
+
.markdown-alert-body{margin-left:.75em;margin-top:-2px}
|
|
46
|
+
.markdown-alert-body>:first-child{margin-top:0}
|
|
47
|
+
.markdown-alert-body>:last-child{margin-bottom:0}
|
|
48
|
+
.markdown-alert>:first-child{margin-top:0}
|
|
49
|
+
.markdown-alert>:last-child{margin-bottom:0}
|
|
50
|
+
.markdown-alert .markdown-alert-title{display:flex;font-weight:bold;align-items:center;line-height:1;margin-bottom:0}
|
|
51
|
+
.markdown-alert.markdown-alert-note{border-left-color:#539bf5}
|
|
52
|
+
.markdown-alert.markdown-alert-note .markdown-alert-title{color:#539bf5}
|
|
53
|
+
.markdown-alert.markdown-alert-important{border-left-color:#986ee2}
|
|
54
|
+
.markdown-alert.markdown-alert-important .markdown-alert-title{color:#986ee2}
|
|
55
|
+
.markdown-alert.markdown-alert-warning{border-left-color:#c69026}
|
|
56
|
+
.markdown-alert.markdown-alert-warning .markdown-alert-title{color:#c69026}
|
|
57
|
+
.markdown-alert.markdown-alert-tip{border-left-color:#57ab5a}
|
|
58
|
+
.markdown-alert.markdown-alert-tip .markdown-alert-title{color:#57ab5a}
|
|
59
|
+
.markdown-alert.markdown-alert-caution{border-left-color:#e5534b}
|
|
60
|
+
.markdown-alert.markdown-alert-caution .markdown-alert-title{color:#e5534b}
|
|
61
|
+
.markdown-alert .octicon{color:inherit;padding:.75em;transform:scale(1.1);overflow:visible}
|
|
62
|
+
.markdown-alert .octicon-info{filter:invert(55%) sepia(55%) saturate(2060%) hue-rotate(191deg) brightness(99%) contrast(93%)}
|
|
63
|
+
.markdown-alert .octicon-tip{filter:invert(58%) sepia(64%) saturate(351%) hue-rotate(73deg) brightness(89%) contrast(90%)}
|
|
64
|
+
.markdown-alert .octicon-important{filter:invert(67%) sepia(41%) saturate(6791%) hue-rotate(225deg) brightness(92%) contrast(92%)}
|
|
65
|
+
.markdown-alert .octicon-caution{filter:invert(45%) sepia(68%) saturate(2586%) hue-rotate(333deg) brightness(95%) contrast(88%)}
|
|
66
|
+
.markdown-alert .octicon-warning{filter:invert(78%) sepia(17%) saturate(5107%) hue-rotate(350deg) brightness(85%) contrast(78%)}
|
|
67
|
+
CSS
|
|
68
|
+
|
|
69
|
+
def self.wrap(type, body_html)
|
|
70
|
+
%Q(<div class="markdown-alert markdown-alert-#{type}" dir="auto"><p class="markdown-alert-title" dir="auto">#{ICONS[type]}#{LABELS[type]}</p><div class="markdown-alert-body">#{body_html}</div></div>)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Rewrite `> [!TYPE]` blockquotes into `{% alert type %} ... {% endalert %}`,
|
|
74
|
+
# skipping fenced code blocks so a `>` inside code is never mistaken for one.
|
|
75
|
+
def self.rewrite_blockquotes(content)
|
|
76
|
+
return content unless content&.include?("[!")
|
|
77
|
+
|
|
78
|
+
lines = content.split("\n", -1)
|
|
79
|
+
out = []
|
|
80
|
+
fence = nil
|
|
81
|
+
i = 0
|
|
82
|
+
while i < lines.length
|
|
83
|
+
line = lines[i]
|
|
84
|
+
|
|
85
|
+
if fence
|
|
86
|
+
out << line
|
|
87
|
+
fence = nil if line.strip.start_with?(fence)
|
|
88
|
+
i += 1
|
|
89
|
+
next
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if (m = line.match(/^\s*(```+|~~~+)/))
|
|
93
|
+
fence = m[1]
|
|
94
|
+
out << line
|
|
95
|
+
i += 1
|
|
96
|
+
next
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if (m = line.match(/^(\s*)>\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*$/i))
|
|
100
|
+
type = m[2].downcase
|
|
101
|
+
body = []
|
|
102
|
+
i += 1
|
|
103
|
+
while i < lines.length && lines[i].match?(/^\s*>/)
|
|
104
|
+
body << lines[i].sub(/^\s*>\s?/, "")
|
|
105
|
+
i += 1
|
|
106
|
+
end
|
|
107
|
+
out << "{% alert #{type} %}"
|
|
108
|
+
out.concat(body)
|
|
109
|
+
out << "{% endalert %}"
|
|
110
|
+
next
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
out << line
|
|
114
|
+
i += 1
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
out.join("\n")
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
def self.inject_css?(site)
|
|
121
|
+
cfg = site.config["jekyll_alerts"] || site.config["alerts"]
|
|
122
|
+
return true unless cfg.is_a?(Hash) && cfg.key?("inject_css")
|
|
123
|
+
cfg["inject_css"] != false
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
class Tag < Liquid::Block
|
|
127
|
+
def initialize(tag_name, alert_type, tokens)
|
|
128
|
+
super
|
|
129
|
+
@alert_type = alert_type.strip.downcase
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
def render(context)
|
|
133
|
+
raw = super
|
|
134
|
+
return "" unless JekyllAlertsPlugin::TYPES.include?(@alert_type)
|
|
135
|
+
|
|
136
|
+
converter = context.registers[:site]
|
|
137
|
+
.find_converter_instance(::Jekyll::Converters::Markdown)
|
|
138
|
+
body_html = converter.convert(raw).strip
|
|
139
|
+
JekyllAlertsPlugin.wrap(@alert_type, body_html)
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
Liquid::Template.register_tag("alert", JekyllAlertsPlugin::Tag)
|
|
145
|
+
|
|
146
|
+
# Blockquote sugar: rewrite `> [!TYPE]` before Liquid runs.
|
|
147
|
+
Jekyll::Hooks.register([:documents, :pages], :pre_render) do |item|
|
|
148
|
+
next unless item.respond_to?(:content) && item.content
|
|
149
|
+
item.content = JekyllAlertsPlugin.rewrite_blockquotes(item.content)
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Auto-inject the CSS once per rendered page that actually uses an alert, so
|
|
153
|
+
# users never have to import a stylesheet. Disable with:
|
|
154
|
+
# jekyll_alerts:
|
|
155
|
+
# inject_css: false
|
|
156
|
+
Jekyll::Hooks.register([:documents, :pages], :post_render) do |item|
|
|
157
|
+
next unless JekyllAlertsPlugin.inject_css?(item.site)
|
|
158
|
+
out = item.output
|
|
159
|
+
next unless out.is_a?(String)
|
|
160
|
+
next unless out.include?("markdown-alert") && out.include?("</head>")
|
|
161
|
+
next if out.include?('id="jekyll-alerts-css"')
|
|
162
|
+
style = %(<style id="jekyll-alerts-css">#{JekyllAlertsPlugin::CSS}</style>)
|
|
163
|
+
item.output = out.sub("</head>", "#{style}</head>")
|
|
164
|
+
end
|
data/styles.scss
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
|
|
2
|
+
// -------------------------------------------- //
|
|
3
|
+
|
|
4
|
+
// copied from view-source:https://github.com/orgs/community/discussions/16925
|
|
5
|
+
|
|
6
|
+
.markdown-alert {
|
|
7
|
+
margin-bottom: 16px;
|
|
8
|
+
color: inherit;
|
|
9
|
+
// modify to a secondary background color or comment out
|
|
10
|
+
background-color: var(--bg-secondary);
|
|
11
|
+
border-left: 0.3rem solid;
|
|
12
|
+
border-radius: 0.3rem;
|
|
13
|
+
padding: 0.5em;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.markdown-alert-body {
|
|
17
|
+
margin-left: 0.75em;
|
|
18
|
+
/* Reproduces the original tight spacing under the title. */
|
|
19
|
+
margin-top: -2px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.markdown-alert-body>:first-child {
|
|
23
|
+
margin-top: 0
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.markdown-alert-body>:last-child {
|
|
27
|
+
margin-bottom: 0
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.markdown-alert>:first-child {
|
|
31
|
+
margin-top: 0
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.markdown-alert>:last-child {
|
|
35
|
+
margin-bottom: 0
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.markdown-alert .markdown-alert-title {
|
|
39
|
+
display: flex;
|
|
40
|
+
font-weight: bold;
|
|
41
|
+
align-items: center;
|
|
42
|
+
line-height: 1;
|
|
43
|
+
margin-bottom: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.markdown-alert.markdown-alert-note {
|
|
47
|
+
border-left-color: #539bf5
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.markdown-alert.markdown-alert-note .markdown-alert-title {
|
|
51
|
+
color: #539bf5
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.markdown-alert.markdown-alert-important {
|
|
55
|
+
border-left-color: #986ee2;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.markdown-alert.markdown-alert-important .markdown-alert-title {
|
|
59
|
+
color: #986ee2;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.markdown-alert.markdown-alert-warning {
|
|
63
|
+
border-left-color: #c69026;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.markdown-alert.markdown-alert-warning .markdown-alert-title {
|
|
67
|
+
color: #c69026;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.markdown-alert.markdown-alert-tip {
|
|
71
|
+
border-left-color: #57ab5a;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.markdown-alert.markdown-alert-tip .markdown-alert-title {
|
|
75
|
+
color: #57ab5a;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.markdown-alert.markdown-alert-caution {
|
|
79
|
+
border-left-color: #e5534b;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.markdown-alert.markdown-alert-caution .markdown-alert-title {
|
|
83
|
+
color: #e5534b;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// octicon colors
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
.markdown-alert .octicon {
|
|
90
|
+
color: inherit;
|
|
91
|
+
padding: 0.75em;
|
|
92
|
+
transform: scale(1.1);
|
|
93
|
+
overflow: visible
|
|
94
|
+
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// generated with https://codepen.io/sosuke/pen/Pjoqqp
|
|
98
|
+
// colors taken from https://github.com/orgs/community/discussions/16925
|
|
99
|
+
|
|
100
|
+
.markdown-alert .octicon-info {
|
|
101
|
+
filter: invert(55%) sepia(55%) saturate(2060%) hue-rotate(191deg) brightness(99%) contrast(93%);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.markdown-alert .octicon-tip {
|
|
105
|
+
filter: invert(58%) sepia(64%) saturate(351%) hue-rotate(73deg) brightness(89%) contrast(90%);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.markdown-alert .octicon-important {
|
|
109
|
+
filter: invert(67%) sepia(41%) saturate(6791%) hue-rotate(225deg) brightness(92%) contrast(92%);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.markdown-alert .octicon-caution {
|
|
113
|
+
filter: invert(45%) sepia(68%) saturate(2586%) hue-rotate(333deg) brightness(95%) contrast(88%);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.markdown-alert .octicon-warning {
|
|
117
|
+
filter: invert(78%) sepia(17%) saturate(5107%) hue-rotate(350deg) brightness(85%) contrast(78%);
|
|
118
|
+
}
|
metadata
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: jekyll-alerts-plugin
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.1.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Adam Hassan
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-08-26 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: jekyll
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '3.7'
|
|
20
|
+
- - "<"
|
|
21
|
+
- !ruby/object:Gem::Version
|
|
22
|
+
version: '5.0'
|
|
23
|
+
type: :runtime
|
|
24
|
+
prerelease: false
|
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
26
|
+
requirements:
|
|
27
|
+
- - ">="
|
|
28
|
+
- !ruby/object:Gem::Version
|
|
29
|
+
version: '3.7'
|
|
30
|
+
- - "<"
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '5.0'
|
|
33
|
+
description: Adds GitHub-style alerts to Jekyll via `> [!NOTE]` blockquotes or a {%
|
|
34
|
+
alert %} tag. Markdown is parsed inside the body and the stylesheet is injected
|
|
35
|
+
automatically - no CSS import needed.
|
|
36
|
+
email:
|
|
37
|
+
executables: []
|
|
38
|
+
extensions: []
|
|
39
|
+
extra_rdoc_files: []
|
|
40
|
+
files:
|
|
41
|
+
- LICENSE
|
|
42
|
+
- README.md
|
|
43
|
+
- lib/jekyll-alerts-plugin.rb
|
|
44
|
+
- styles.scss
|
|
45
|
+
homepage: https://github.com/Adamkadaban/jekyll-alerts-plugin
|
|
46
|
+
licenses:
|
|
47
|
+
- MIT
|
|
48
|
+
metadata:
|
|
49
|
+
source_code_uri: https://github.com/Adamkadaban/jekyll-alerts-plugin
|
|
50
|
+
bug_tracker_uri: https://github.com/Adamkadaban/jekyll-alerts-plugin/issues
|
|
51
|
+
github_repo: ssh://github.com/Adamkadaban/jekyll-alerts-plugin
|
|
52
|
+
post_install_message:
|
|
53
|
+
rdoc_options: []
|
|
54
|
+
require_paths:
|
|
55
|
+
- lib
|
|
56
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - ">="
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: '2.7'
|
|
61
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
62
|
+
requirements:
|
|
63
|
+
- - ">="
|
|
64
|
+
- !ruby/object:Gem::Version
|
|
65
|
+
version: '0'
|
|
66
|
+
requirements: []
|
|
67
|
+
rubygems_version: 3.5.22
|
|
68
|
+
signing_key:
|
|
69
|
+
specification_version: 4
|
|
70
|
+
summary: GitHub-style alerts/callouts for Jekyll, with Markdown inside and auto-injected
|
|
71
|
+
CSS.
|
|
72
|
+
test_files: []
|