Skip to content

Commit

Permalink
Roles labels refinement (#220)
Browse files Browse the repository at this point in the history
Fixes a few issues in the initial implementation of #211:

- adds `cluster` and `dynamic` labels
- fixes padding in admonitions
  • Loading branch information
recrwplay committed Jun 3, 2024
1 parent 2522fc6 commit 11e7468
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 7 deletions.
8 changes: 7 additions & 1 deletion preview-src/docs-roles.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ Flags sections as Not Available on Aura, Aura DB Enterprise, Enterprise Edition,

Blocks with the appropriate roles have labels added.

[discrete]
[role="label--new-5.17 label--enterprise-edition"]
=== (Discrete) H3 AuraDB Enterprise AND Not on Aura

Lorem ipsum dolor sit


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

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

[role=label--new-5.17]
[role=label--dynamic-5.17]
--
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Mauris eget leo nunc, nec tempus mi? Curabitur id nisl mi, ut vulputate urna.
Expand Down
5 changes: 5 additions & 0 deletions src/css/labels.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
flex-wrap: wrap;
}

.admonitionblock > div.labels {
padding: 1rem 1rem 0.75rem;
}

.header-label-container > div.labels {
display: flex;
align-self: center;
Expand All @@ -25,6 +29,7 @@

.header-label-container > div.labels.wrapped {
margin-left: 0;
margin-top: 0.5rem;
}

.doc > .sect-header > h1.page:first-child:has(> .labels) {
Expand Down
5 changes: 3 additions & 2 deletions src/js/60-docs-roles.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ document.addEventListener('DOMContentLoaded', function () {
}

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

return labelDetails
Expand Down
9 changes: 9 additions & 0 deletions src/js/data/rolesData.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@
"labelCategory": "version",
"displayText": "Discontinued"
},
"dynamic":{
"labelCategory": "function",
"displayText": "Dynamic",
"versionText": "since"
},
"alpha":{
"labelCategory": "version",
"displayText": "Alpha"
Expand Down Expand Up @@ -184,6 +189,10 @@
"labelCategory": "environment",
"displayText": "Windows"
},
"cluster":{
"labelCategory": "function",
"displayText": "Cluster"
},
"cluster-member-core":{
"labelCategory": "function",
"displayText": "CORE"
Expand Down
12 changes: 8 additions & 4 deletions src/partials/header-content.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,26 @@
Labs
</a>
{{else if (eq page.attributes.theme "kb")}}
<img class="navbar-logo" src="https://dist.neo4j.com/wp-content/uploads/20230926084108/Logo_FullColor_RGB_TransBG.svg" alt="{{ site.title }}" />
<img class="navbar-logo" src="https://dist.neo4j.com/wp-content/uploads/20231023102534/neo4j-logo.svg" alt="{{ site.title }}" />
{{!-- <img class="navbar-logo" src="https://dist.neo4j.com/wp-content/uploads/20230926084108/Logo_FullColor_RGB_TransBG.svg" alt="{{ site.title }}" /> --}}
<a href="/developer/kb/" class="navbar-item no-left-padding page-name-white" aria-label="Knowledge Base">
Knowledge Base
</a>
{{else if (eq page.attributes.theme "training")}}
<img class="navbar-logo" src="https://dist.neo4j.com/wp-content/uploads/20230926084108/Logo_FullColor_RGB_TransBG.svg" alt="{{ site.title }}" />
<img class="navbar-logo" src="https://dist.neo4j.com/wp-content/uploads/20231023102534/neo4j-logo.svg" alt="{{ site.title }}" />
{{!-- <img class="navbar-logo" src="https://dist.neo4j.com/wp-content/uploads/20230926084108/Logo_FullColor_RGB_TransBG.svg" alt="{{ site.title }}" /> --}}
<a href="/graphacademy/online-training/" class="navbar-item no-left-padding page-name-white" aria-label="GraphAcademy">
GraphAcademy
</a>
{{else if (eq page.attributes.theme "graphgists")}}
<img class="navbar-logo" src="https://dist.neo4j.com/wp-content/uploads/20230926084108/Logo_FullColor_RGB_TransBG.svg" alt="{{ site.title }}" />
<img class="navbar-logo" src="https://dist.neo4j.com/wp-content/uploads/20231023102534/neo4j-logo.svg" alt="{{ site.title }}" />
{{!-- <img class="navbar-logo" src="https://dist.neo4j.com/wp-content/uploads/20230926084108/Logo_FullColor_RGB_TransBG.svg" alt="{{ site.title }}" /> --}}
<a href="/graphgists/" class="navbar-item no-left-padding page-name-white" aria-label="GraphGists">
GraphGists
</a>
{{else}}
<img class="navbar-logo" src="https://dist.neo4j.com/wp-content/uploads/20230926084108/Logo_FullColor_RGB_TransBG.svg" alt="{{ site.title }}" />
<img class="navbar-logo" src="https://dist.neo4j.com/wp-content/uploads/20231023102534/neo4j-logo.svg" alt="{{ site.title }}" />
{{!-- <img class="navbar-logo" src="https://dist.neo4j.com/wp-content/uploads/20230926084108/Logo_FullColor_RGB_TransBG.svg" alt="{{ site.title }}" /> --}}
<a href="/developer/" class="navbar-item no-left-padding page-name-white" aria-label="Developer Guides">
Developer
</a>
Expand Down

0 comments on commit 11e7468

Please sign in to comment.