-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide initial implementation of cheatsheet concept
Signed-off-by: lucperkins <lucperkins@gmail.com>
- Loading branch information
1 parent
8b85669
commit 61210c2
Showing
8 changed files
with
64 additions
and
0 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,3 @@ | ||
- rule: forbid_something | ||
desc: This thing shouldn't happen | ||
condition: not thing in (allowed_thing, other_allowed_thing) |
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 @@ | ||
key: value |
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 @@ | ||
--- | ||
title: Falco Cheatsheet | ||
draft: true | ||
--- | ||
|
||
{{< cheatsheet >}} |
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,4 @@ | ||
forbidden-thing: | ||
title: Do a thing | ||
other-thing: | ||
title: Some other thing |
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,27 @@ | ||
.cheatsheet | ||
display: flex | ||
|
||
+desktop | ||
flex-flow: row nowrap | ||
+mobile | ||
flex-flow: column nowrap | ||
|
||
flex-flow: row nowrap | ||
justify-content: space-between | ||
|
||
.cheat | ||
padding: 1rem | ||
background-color: $light | ||
|
||
+desktop | ||
width: calc(50% - .25rem) | ||
+mobile | ||
width: 100% | ||
|
||
& + .cheat | ||
margin-top: 1rem | ||
|
||
&-title | ||
font-size: 1.25rem | ||
font-weight: 700 | ||
|
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,8 @@ | ||
{{ $key := .Get 0 }} | ||
{{ $cheat := index site.Data.cheatsheet $key }} | ||
{{ $title := $cheat.title }} | ||
{{ $file := printf "cheatsheet/%s.yaml" $key }} | ||
{{ $yaml := readFile $file }} | ||
<h2>{{ $title }}</h2> | ||
|
||
{{ highlight $yaml "yaml" "" }} |
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,14 @@ | ||
{{ $cheats := site.Data.cheatsheet }} | ||
<div class="cheatsheet"> | ||
{{ range $k, $v := $cheats }} | ||
{{ $yaml := readFile (printf "cheatsheet/%s.yaml" $k) }} | ||
{{ $title := $v.title | markdownify }} | ||
<div class="cheat"> | ||
<p class="cheat-title"> | ||
{{ $title }} | ||
</p> | ||
|
||
{{ highlight $yaml "yaml" "" }} | ||
</div> | ||
{{ end }} | ||
</div> |