Skip to content

Commit 11e7468

Browse files
committed
Roles labels refinement (#220)
Fixes a few issues in the initial implementation of #211: - adds `cluster` and `dynamic` labels - fixes padding in admonitions
1 parent 2522fc6 commit 11e7468

File tree

5 files changed

+32
-7
lines changed

5 files changed

+32
-7
lines changed

preview-src/docs-roles.adoc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ Flags sections as Not Available on Aura, Aura DB Enterprise, Enterprise Edition,
1818

1919
Blocks with the appropriate roles have labels added.
2020

21+
[discrete]
22+
[role="label--new-5.17 label--enterprise-edition"]
23+
=== (Discrete) H3 AuraDB Enterprise AND Not on Aura
24+
25+
Lorem ipsum dolor sit
26+
2127

2228
[role=label--aura-db-enterprise label--not-on-aura]
2329
=== H3 AuraDB Enterprise AND Not on Aura
@@ -26,7 +32,7 @@ Lorem ipsum dolor sit
2632

2733
Open blocks can be used to mark multiple paragraphs within a section.
2834

29-
[role=label--new-5.17]
35+
[role=label--dynamic-5.17]
3036
--
3137
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
3238
Mauris eget leo nunc, nec tempus mi? Curabitur id nisl mi, ut vulputate urna.

src/css/labels.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
flex-wrap: wrap;
1111
}
1212

13+
.admonitionblock > div.labels {
14+
padding: 1rem 1rem 0.75rem;
15+
}
16+
1317
.header-label-container > div.labels {
1418
display: flex;
1519
align-self: center;
@@ -25,6 +29,7 @@
2529

2630
.header-label-container > div.labels.wrapped {
2731
margin-left: 0;
32+
margin-top: 0.5rem;
2833
}
2934

3035
.doc > .sect-header > h1.page:first-child:has(> .labels) {

src/js/60-docs-roles.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ document.addEventListener('DOMContentLoaded', function () {
4444
}
4545

4646
// get version number for version labels
47-
if (rolesData[label].labelCategory === 'version' && labelParts[1]) {
47+
if ((rolesData[label].labelCategory === 'version' || rolesData[label].versionText) && labelParts[1]) {
4848
labelDetails.data.version = labelParts[1]
49-
labelDetails.text += ' in ' + labelDetails.data.version
49+
const joinText = rolesData[label].versionText ? rolesData[label].versionText : 'in'
50+
labelDetails.text = [labelDetails.text, joinText, labelDetails.data.version].join(' ')
5051
}
5152

5253
return labelDetails

src/js/data/rolesData.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@
8686
"labelCategory": "version",
8787
"displayText": "Discontinued"
8888
},
89+
"dynamic":{
90+
"labelCategory": "function",
91+
"displayText": "Dynamic",
92+
"versionText": "since"
93+
},
8994
"alpha":{
9095
"labelCategory": "version",
9196
"displayText": "Alpha"
@@ -184,6 +189,10 @@
184189
"labelCategory": "environment",
185190
"displayText": "Windows"
186191
},
192+
"cluster":{
193+
"labelCategory": "function",
194+
"displayText": "Cluster"
195+
},
187196
"cluster-member-core":{
188197
"labelCategory": "function",
189198
"displayText": "CORE"

src/partials/header-content.hbs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,26 @@
2222
Labs
2323
</a>
2424
{{else if (eq page.attributes.theme "kb")}}
25-
<img class="navbar-logo" src="https://dist.neo4j.com/wp-content/uploads/20230926084108/Logo_FullColor_RGB_TransBG.svg" alt="{{ site.title }}" />
25+
<img class="navbar-logo" src="https://dist.neo4j.com/wp-content/uploads/20231023102534/neo4j-logo.svg" alt="{{ site.title }}" />
26+
{{!-- <img class="navbar-logo" src="https://dist.neo4j.com/wp-content/uploads/20230926084108/Logo_FullColor_RGB_TransBG.svg" alt="{{ site.title }}" /> --}}
2627
<a href="/developer/kb/" class="navbar-item no-left-padding page-name-white" aria-label="Knowledge Base">
2728
Knowledge Base
2829
</a>
2930
{{else if (eq page.attributes.theme "training")}}
30-
<img class="navbar-logo" src="https://dist.neo4j.com/wp-content/uploads/20230926084108/Logo_FullColor_RGB_TransBG.svg" alt="{{ site.title }}" />
31+
<img class="navbar-logo" src="https://dist.neo4j.com/wp-content/uploads/20231023102534/neo4j-logo.svg" alt="{{ site.title }}" />
32+
{{!-- <img class="navbar-logo" src="https://dist.neo4j.com/wp-content/uploads/20230926084108/Logo_FullColor_RGB_TransBG.svg" alt="{{ site.title }}" /> --}}
3133
<a href="/graphacademy/online-training/" class="navbar-item no-left-padding page-name-white" aria-label="GraphAcademy">
3234
GraphAcademy
3335
</a>
3436
{{else if (eq page.attributes.theme "graphgists")}}
35-
<img class="navbar-logo" src="https://dist.neo4j.com/wp-content/uploads/20230926084108/Logo_FullColor_RGB_TransBG.svg" alt="{{ site.title }}" />
37+
<img class="navbar-logo" src="https://dist.neo4j.com/wp-content/uploads/20231023102534/neo4j-logo.svg" alt="{{ site.title }}" />
38+
{{!-- <img class="navbar-logo" src="https://dist.neo4j.com/wp-content/uploads/20230926084108/Logo_FullColor_RGB_TransBG.svg" alt="{{ site.title }}" /> --}}
3639
<a href="/graphgists/" class="navbar-item no-left-padding page-name-white" aria-label="GraphGists">
3740
GraphGists
3841
</a>
3942
{{else}}
40-
<img class="navbar-logo" src="https://dist.neo4j.com/wp-content/uploads/20230926084108/Logo_FullColor_RGB_TransBG.svg" alt="{{ site.title }}" />
43+
<img class="navbar-logo" src="https://dist.neo4j.com/wp-content/uploads/20231023102534/neo4j-logo.svg" alt="{{ site.title }}" />
44+
{{!-- <img class="navbar-logo" src="https://dist.neo4j.com/wp-content/uploads/20230926084108/Logo_FullColor_RGB_TransBG.svg" alt="{{ site.title }}" /> --}}
4145
<a href="/developer/" class="navbar-item no-left-padding page-name-white" aria-label="Developer Guides">
4246
Developer
4347
</a>

0 commit comments

Comments
 (0)