Skip to content

Commit 1ff5135

Browse files
committed
feat: add a way to discover the script
1 parent b1f58d7 commit 1ff5135

File tree

4 files changed

+32
-1
lines changed

4 files changed

+32
-1
lines changed

README.md

+26-1
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@ title: "README In Static Site (RISS)"
44
date: 2021-08-21T08:15:54
55
description: "💎 Insert your github readme in your static site."
66
---
7+
<!-- Powered by https://cj.rs/riss -->
78
{{< github_badge >}}
89
{{< rawhtml >}}
910
<div class="badges">
1011
{{< /rawhtml >}}
1112
end_insert -->
13+
1214
<!-- remove -->
1315
# 💎 README In Static Site (RISS)
1416
<!-- end_remove -->
1517

16-
[![CI](https://github.com/cljoly/readme-in-static-site/actions/workflows/checks.yml/badge.svg?branch=main)](https://github.com/cljoly/readme-in-static-site/actions/workflows/checks.yml) [![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/cljoly/readme-in-static-site)](https://github.com/cljoly/readme-in-static-site/blob/main/riss.awk)
18+
[![](https://img.shields.io/badge/powered%20by-riss-lightgrey)](https://cj.rs/riss) [![CI](https://github.com/cljoly/readme-in-static-site/actions/workflows/checks.yml/badge.svg?branch=main)](https://github.com/cljoly/readme-in-static-site/actions/workflows/checks.yml) [![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/cljoly/readme-in-static-site)](https://github.com/cljoly/readme-in-static-site/blob/main/riss.awk)
1719

1820
<!-- insert
1921
{{< rawhtml >}}
@@ -57,6 +59,7 @@ In you .md file on GitHub, put:
5759
title: "README In Static Site (RISS)"
5860
date: 2021-08-21T10:15:54
5961
---
62+
<!-- Powered by https://cj.rs/riss -->
6063
end_insert -->
6164
<!-- remove -->
6265

@@ -69,6 +72,7 @@ The output of the script will be:
6972
title: "README In Static Site (RISS)"
7073
date: 2021-08-21T10:15:54
7174
---
75+
<!-- Powered by https://cj.rs/riss -->
7276

7377
and this piece of yaml will be hidden on GitHub!
7478

@@ -107,6 +111,24 @@ Have you used this script to transform some markdown (or other) and insert it on
107111

108112
The transformations are driven by HTML comments, so that you can have different results when comments are ignored (e.g. in your GitHub README) and after executing the script on your markdown file.
109113

114+
### Spread the Word
115+
116+
If you find this script useful, please consider inserting the following in your readme:
117+
```html
118+
<!-- Powered by https://cj.rs/riss -->
119+
```
120+
This will help other people find the script. The script will even thank you if this is present!
121+
122+
If you feel especially charitable, you could put this badge somewhere:
123+
124+
[![](https://img.shields.io/badge/powered%20by-riss-lightgrey)](https://cj.rs/riss)
125+
126+
with for instance this code:
127+
```markdown
128+
[![](https://img.shields.io/badge/powered%20by-riss-lightgrey)](https://cj.rs/riss)
129+
```
130+
131+
110132
### Escaping
111133

112134
**It is important that your comment starts at the beginning of the line:** spaces are used for escaping, meaning that if the comment has spaces at the beginning of the line, it is ignored.
@@ -195,11 +217,14 @@ readme-update:
195217

196218
Feel free to [open an issue][issue] to discuss something or to send a PR.
197219

220+
See also the [Spread the Word][stw] section if you would like to make more folks aware of this script.
221+
198222
![GitHub](https://img.shields.io/github/license/cljoly/readme-in-static-site)
199223

200224
[hugo]: https://gohugo.io/
201225
[zola]: https://www.getzola.org/
202226
[hugo_ascii]: https://cj.rs/gohugo-asciinema/
203227
[issue]: https://github.com/cljoly/readme-in-static-site/issues/new
204228
[fast]: #benchmark
229+
[stw]: #spread-the-word
205230
[script]: https://cj.rs/riss.awk

riss.awk

+4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ BEGIN {
1919
inserting = 0 # Sequence to insert the content of the comment started
2020
}
2121

22+
/<!-+- Powered by https?:\/\/cj.rs\/riss -+->/ {
23+
print("Thanks for spreading the word!") > "/dev/stderr"
24+
}
25+
2226
/^<!--+ remove -+->$/ {
2327
removing = 1
2428
next

test.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!-- Powered by https://cj.rs/riss -->
12
<!-- insert
23
---
34
title: "My Page Title"

test_output.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!-- Powered by https://cj.rs/riss -->
12
---
23
title: "My Page Title"
34
date: "2222-11-11"

0 commit comments

Comments
 (0)