Skip to content

Commit 8b00f15

Browse files
authored
Merge pull request #36 from k-wall/issue-31
Fix #31: Enable anchor links for kroxylicious.io
2 parents 73b8256 + abc70d2 commit 8b00f15

File tree

13 files changed

+85
-12
lines changed

13 files changed

+85
-12
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ group :jekyll_plugins do
1313
gem "jekyll-feed", "~> 0.12"
1414
gem "jekyll-sass-converter"
1515
gem "jekyll-seo-tag"
16+
gem "jekyll-toc"
1617
end
1718

1819
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem

Gemfile.lock

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ GEM
3939
sass-embedded (~> 1.54)
4040
jekyll-seo-tag (2.8.0)
4141
jekyll (>= 3.8, < 5.0)
42+
jekyll-toc (0.18.0)
43+
jekyll (>= 3.9)
44+
nokogiri (~> 1.12)
4245
jekyll-watch (2.2.1)
4346
listen (~> 3.0)
4447
kramdown (2.4.0)
@@ -50,9 +53,15 @@ GEM
5053
rb-fsevent (~> 0.10, >= 0.10.3)
5154
rb-inotify (~> 0.9, >= 0.9.10)
5255
mercenary (0.4.0)
56+
mini_portile2 (2.8.5)
57+
nokogiri (1.16.0)
58+
mini_portile2 (~> 2.8.2)
59+
racc (~> 1.4)
5360
pathutil (0.16.2)
5461
forwardable-extended (~> 2.6)
5562
public_suffix (5.0.3)
63+
racc (1.7.3)
64+
racc (1.7.3-java)
5665
rake (13.1.0)
5766
rb-fsevent (0.11.2)
5867
rb-inotify (0.10.1)
@@ -94,6 +103,7 @@ DEPENDENCIES
94103
jekyll-feed (~> 0.12)
95104
jekyll-sass-converter
96105
jekyll-seo-tag
106+
jekyll-toc
97107
tzinfo (>= 1, < 3)
98108
tzinfo-data
99109
wdm (~> 0.1.1)

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ plugins:
3131
- jekyll-feed
3232
- jekyll-sass-converter
3333
- jekyll-seo-tag
34+
- jekyll-toc
3435

3536
# Exclude from processing.
3637
# The following items will not be processed, by default.

_layouts/default.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.2/js/bootstrap.bundle.min.js" integrity="sha512-X/YkDZyjTf4wyc2Vy16YGCPHwAY8rZJY+POgokZjQB2mhIRFJCckEGc6YyX9eNsPfn0PzThEuNs+uaomE5CO6A==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
1111
{% seo %}
1212
</head>
13-
<body class="d-flex flex-column vh-100" data-bs-theme="light">
13+
<body class="d-flex flex-column" data-bs-theme="light">
1414
{% include nav.html %}
15-
<div class="container-fluid px-0" data-bs-theme="light">
15+
<div class="container-fluid px-0 krx-content" data-bs-theme="light">
1616
{{ content }}
1717
</div>
1818
{% include footer.html %}

_layouts/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ <h1 class="fw-bold text-body-emphasis lh-1 mb-3">Kroxylicious transparently inje
3636
</div>
3737
</div>
3838
</div>
39-
</div>
39+
</div>

_layouts/overview.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
---
22
layout: default
3+
toc: true
34
---
45
<div class="row justify-content-center">
56
<div class="col-11 col-lg-8 card shadow gx-5 gy-5 m-lg-5">
67
<div class="row g-0">
78
<div class="col-auto">
89
<div class="card-body">
910
<div class="card-text m-2">
10-
{{ content | markdownify }}
11+
{{ content | markdownify | inject_anchors }}
1112
</div>
1213
</div>
1314
</div>
1415
</div>
1516
</div>
16-
</div>
17+
</div>

_layouts/use-cases.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
layout: default
3+
toc: true
34
---
45

56
<div class="row justify-content-center">
@@ -9,8 +10,7 @@
910
<div class="row g-0">
1011
<div class="col-auto">
1112
{% for use_case in site.use_cases %}
12-
<h2 class="card-subtitle">{{ use_case.name }}</h2>
13-
<p class="card-text">{{ use_case.content | markdownify }}</p>
13+
<div class="card-text">{{ use_case.content | markdownify | inject_anchors}}</div>
1414
{% endfor %}
1515
</div>
1616
</div>

_sass/kroxylicious.scss

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ $navbar-dark-disabled-color: rgba($white, 0.45);
3333
// Custom bootstrap variables must be set or imported *before* bootstrap.
3434
@import "./bootstrap/scss/bootstrap";
3535

36+
body {
37+
height: fit-content!important;
38+
}
39+
40+
.krx-content * {
41+
scroll-margin-top: 5rem!important;
42+
}
43+
3644
.list-group-item:hover {
3745
background-color: tint-color($primary, 50%);
3846
}
@@ -110,6 +118,8 @@ $navbar-dark-disabled-color: rgba($white, 0.45);
110118
}
111119
}
112120

121+
// Rouge highlighter non-theme formatting
122+
// (AKA any formatting for Rouge that isn't part of the generated theme)
113123

114124
.highlighter-rouge {
115125
background-color: #f8f8f8!important;
@@ -130,3 +140,31 @@ div.highlighter-rouge {
130140
}
131141
}
132142

143+
// Anchor Links
144+
145+
h2>a.anchor, h3>a.anchor, h4>a.anchor, h5>a.anchor, h6>a.anchor {
146+
font-family: bootstrap-icons!important;
147+
color: rgba($primary, 0);
148+
display: block;
149+
margin-left: -1.5ex;
150+
position: absolute;
151+
text-decoration: none !important;
152+
visibility: hidden;
153+
z-index: 2;
154+
transition:
155+
visibility 1ms linear,
156+
color 200ms ease-in-out;
157+
}
158+
159+
h2>a.anchor::before, h3>a.anchor::before, h4>a.anchor::before, h5>a.anchor::before, h6>a.anchor::before {
160+
content: "\f470";
161+
}
162+
163+
h2:hover>a.anchor, h3:hover>a.anchor, h4:hover>a.anchor, h5:hover>a.anchor, h6:hover>a.anchor {
164+
visibility: visible;
165+
color: rgba($primary, 1);
166+
}
167+
168+
h2:hover>a.anchor:hover, h3:hover>a.anchor:hover, h4:hover>a.anchor:hover, h5:hover>a.anchor:hover, h6:hover>a.anchor:hover {
169+
color: rgba($secondary, 1);
170+
}

_use_cases/encryption-at-rest.markdown

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
name: Encryption At Rest
33
---
44

5-
## Why
5+
### Encryption At Rest
6+
7+
#### Why
68

79
Apache Kafka&#174; does not directly support any form of encryption for data stored within a broker. This means that the contents
810
of records sent to Apache Kafka are stored in the clear on the broker's disks. Anyone with sufficient access, such as a Kafka Administrator
@@ -20,7 +22,7 @@ data is now residing in the clear on the file systems of the service provider.
2022
|:-----------------------------------------------------------------:|
2123
| *Problem: Plain text records readable by the Kafka Admins* |
2224

23-
### Isn't TLS sufficient?
25+
##### Isn't TLS sufficient?
2426

2527
TLS encrypts the content _in transit_. It means that someone using a network sniffer cannot intercept what is being
2628
sent over the wire between the application and the Kafka Broker. However, once the network packets arrive at the broker,
@@ -29,7 +31,7 @@ of the broker and in the clear when the data is written to the file system.
2931

3032
TLS does not change the problem.
3133

32-
### Isn't storage volume encryption an answer?
34+
##### Isn't storage volume encryption an answer?
3335

3436
With storage volume encryption, the contents of the volume are encrypted with a single key. This approach provides some mitigations.
3537
If the storage device is stolen or the storage device hijacked and attached to an attacker's computer, the attacker won't have
@@ -41,7 +43,7 @@ to be able to read the data, including the Kafka confidential records.
4143

4244
Storage volume encryption doesn't really solve the problem.
4345

44-
### Can't the applications encrypt/decrypt the data?
46+
##### Can't the applications encrypt/decrypt the data?
4547

4648
It is possible for producing applications to encrypt data before sending it to Kafka, and for consuming applications to decrypt it
4749
again. With this approach the brokers never possess the records in the clear and as they don't have encryption keys, they cannot
@@ -64,7 +66,7 @@ of a design flaw or bug are significant (confidentiality breach).
6466
Having the applications encrypt/decrypt data themselves, whilst technically feasible, is not really a tenable solution
6567
at the scale required for most enterprises.
6668

67-
# Kroxylicious Topic Encryption
69+
#### Kroxylicious Topic Encryption
6870

6971
The Kroxylicious Topic Encryption feature offers a solution to the problem. The proxy takes the responsibility
7072
to encrypt and decrypt the messages. In this way, the Kafka Brokers never see the plain text content of

css/code.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
/*
2+
* This file is a generated Rouge code highlighter theme, and can be
3+
* re-generated with the `rougify` command. More info about this can be found
4+
* at https://rouge.jneen.net/ or https://github.com/rouge-ruby/rouge
5+
*
6+
* NOTE: Manual adjustments to the code highlighting colors and fonts in this
7+
* file will persist as it is not re-generated at runtime.
8+
* However, any formatting that is not part of the Rouge theme should NOT be
9+
* put in this file, and should instead go in _sass/kroxylicious.scss as it
10+
* will be overwritten if this file is ever re-generated.
11+
*/
12+
113
.highlight table td { padding: 5px; }
214
.highlight table pre { margin: 0; }
315
.highlight .c, .highlight .ch, .highlight .cd, .highlight .cm, .highlight .cpf, .highlight .c1 {

0 commit comments

Comments
 (0)