Skip to content

Commit

Permalink
Fix hugo.toml and add scss for the nav bar
Browse files Browse the repository at this point in the history
Signed-off-by: Kristiyan Gostev <[email protected]>
  • Loading branch information
k-gostev committed Mar 26, 2024
1 parent c7cd60e commit 8f659e0
Show file tree
Hide file tree
Showing 2 changed files with 233 additions and 64 deletions.
209 changes: 209 additions & 0 deletions web/site/assets/scss/_nav.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
//
// Main navbar
//
.td-navbar-cover {
@include media-breakpoint-up(md) {
background: transparent !important;
.nav-link {
text-shadow: 1px 1px 2px $dark;
}
}

&.navbar-bg-onscroll .nav-link {
text-shadow: none;
}
}

.navbar-bg-onscroll {
background: $primary !important;
opacity: inherit;
}

.td-navbar {
@extend .navbar;

background: $primary;
min-height: 4rem;
margin: 0;
z-index: 32;

.navbar-brand {
text-transform: none;
&__name {
font-weight: $font-weight-bold;
}

svg {
display: inline-block;
margin: 0 10px;
height: 30px;
}
}

.navbar-nav {
padding-top: $spacer * 0.5;
white-space: nowrap;
}

.nav-link {
text-transform: none;
font-weight: $font-weight-bold;
}

// For .td-search__input styling, see _search.scss

.dropdown {
min-width: 100px;
}

@include media-breakpoint-up(md) {
position: fixed;
top: 0;
width: 100%;

.nav-item {
padding-inline-end: $spacer * 0.5;
}

.navbar-nav {
padding-top: 0 !important;
}
}

@include media-breakpoint-down(lg) {
.td-navbar-nav-scroll {
max-width: 100%;
height: 2.5rem;
overflow: hidden;
font-size: 0.9rem;
}

.navbar-brand {
margin-right: 0;
}

.navbar-nav {
padding-bottom: 2rem;
overflow-x: auto;
}
}
}

// Icons
#main_navbar {
li i {
padding-right: 0.5em;

&:before {
display: inline-block;
text-align: center;
min-width: 1em;
}
}
.alert {
background-color: inherit;
padding: 0;
color: $secondary;
border: 0;
font-weight: inherit;

&:before {
display: inline-block;
font-style: normal;
font-variant: normal;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
font-family: $font-awesome-font-name;
font-weight: 900;
content: "\f0d9";
padding-left: 0.5em;
padding-right: 0.5em;
}
}
}

// Foldable sidebar menu
nav.foldable-nav {
&#td-section-nav {
position: relative;
}

&#td-section-nav label {
margin-bottom: 0;
width: 100%;
}

.td-sidebar-nav__section,
.with-child ul {
list-style: none;
padding: 0;
margin: 0;
}

.ul-1 > li {
padding-left: 1.5em;
}

ul.foldable {
display: none;
}

input:checked ~ ul.foldable {
display: block;
}

input[type="checkbox"] {
display: none;
}

.with-child,
.without-child {
position: relative;
padding-left: 1.5em;
}

.ul-1 .with-child > label:before {
display: inline-block;
font-style: normal;
font-variant: normal;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
font-family: $font-awesome-font-name;
font-weight: 900;
content: "\f0da";
position: absolute;
left: 0.1em;
padding-left: 0.4em;
padding-right: 0.4em;
font-size: 1em;
color: $gray-900;
transition: all 0.5s;
&:hover {
transform: rotate(90deg);
}
}

.ul-1 .with-child > input:checked ~ label:before {
color: $primary;
transform: rotate(90deg);
transition: transform 0.5s;
}

.with-child ul {
margin-top: 0.1em;
}
}

@media (hover: hover) and (pointer: fine) {
nav.foldable-nav {
.ul-1 .with-child > label:hover:before {
color: $primary;
transition: color 0.3s;
}

.ul-1 .with-child > input:checked ~ label:hover:before {
color: $primary;
transition: color 0.3s;
}
}
}
88 changes: 24 additions & 64 deletions web/site/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ pygmentsUseClasses = false
# Use the new Chroma Go highlighter in Hugo.
pygmentsUseClassic = false
#pygmentsOptions = "linenos=table"
# See https = //help.farbox.com/pygments.html
# See https://help.farbox.com/pygments.html
pygmentsStyle = "autumn"

# Configure how URLs look like per section.
[permalinks]
# blog = "/ = section/ = year/ = filename/"
# blog = "/:section/:year/:filename/"

## Configuration for BlackFriday markdown parser = https = //github.com/russross/blackfriday
## Configuration for BlackFriday markdown parser:https://github.com/russross/blackfriday
## [blackfriday]
## plainIDAnchors = true
## hrefTargetBlank = true
Expand All @@ -42,7 +42,7 @@ anchor = "Smart"
[markup.goldmark.renderer]
unsafe = true
[markup.highlight]
# See a complete list of available styles at https = //xyproto.github.io/splash/docs/all.html
# See a complete list of available styles at https://xyproto.github.io/splash/docs/all.html
style = "autumn"
# Uncomment if you want your chosen highlight style used for code blocks without a specified language
# guessSyntax = "true"
Expand All @@ -58,7 +58,7 @@ section = ["HTML", "print"]

[params]
copyright = "The Eclipse Kanto™ Project"
# privacy_policy = "https = //eclipse.org/legal/privacy.php"
# privacy_policy = "https://eclipse.org/legal/privacy.php"

# Menu title if your navbar has a versions selector to access old versions of your site.
# This menu appears only if you have at least one [params.versions] set.
Expand All @@ -76,13 +76,13 @@ archived_version = false

# A link to latest version of the docs. Used in the "version-banner" partial to
# point people to the main doc site.
# url_latest_version = "https = //example.com"
# url_latest_version = "https://example.com"

# Repository configuration (URLs for in-page links to opening issues and suggesting changes)
github_repo = "https = //github.com/eclipse-kanto/kanto"
github_repo = "https://github.com/eclipse-kanto/kanto"
github_subdir = "site"
# An optional link to a related project repo. For example, the sibling repository where your product code lives.
github_project_repo = "https = //github.com/eclipse-kanto"
github_project_repo = "https://github.com/eclipse-kanto"

# Specify a value here if your content directory is not in your repo's root directory
# github_subdir = ""
Expand Down Expand Up @@ -123,73 +123,73 @@ sidebar_menu_truncate = 80
# End user relevant links. These will show up on left side of footer and in the community page if you have one.
[[params.links.user]]
name = "Eclipse Kanto project"
url = "https = //projects.eclipse.org/projects/iot.kanto"
url = "https://projects.eclipse.org/projects/iot.kanto"
icon = "fas fa-external-link-alt"
desc = "Welcome to our Eclipse IoT home"
[[params.links.user]]
name = "Stack Overflow"
url = "https = //stackoverflow.com/questions/tagged/eclipse-kanto"
url = "https://stackoverflow.com/questions/tagged/eclipse-kanto"
icon = "fab fa-stack-overflow"
desc = "Ask practical questions for eclipse-kanto"
[[params.links.user]]
name = "YouTube"
url = "https = //www.youtube.com/watch?v=bMN_ZiUS3Bc"
url = "https://www.youtube.com/watch?v=bMN_ZiUS3Bc"
icon = "fab fa-youtube"
desc = "From \"Can't\" to \"Can\" with Kanto"
[[params.links.user]]
name = "Newsletter"
url = "https = //newsroom.eclipse.org/eclipse-newsletter/2022/february/five-ways-eclipse-kanto-accelerates-iot-edge-development"
url = "https://newsroom.eclipse.org/eclipse-newsletter/2022/february/five-ways-eclipse-kanto-accelerates-iot-edge-development"
icon = "fas fa-book-open"
desc = "Five Ways Eclipse Kanto Accelerates IoT Edge Development"
# Developer relevant links. These will show up on right side of footer and in the community page if you have one.
[[params.links.developer]]
name = "GitHub"
url = "https = //github.com/eclipse-kanto"
url = "https://github.com/eclipse-kanto"
icon = "fab fa-github"
desc = "Development takes place here!"
[[params.links.developer]]
name = "Releases"
url = "https = //github.com/eclipse-kanto/kanto/releases"
url = "https://github.com/eclipse-kanto/kanto/releases"
icon = "fas fa-rocket"
desc = "Try out the latest release!"
[[params.links.developer]]
name = "Task board"
url = "https = //github.com/orgs/eclipse-kanto/projects/1/views/1"
url = "https://github.com/orgs/eclipse-kanto/projects/1/views/1"
icon = "fas fa-clipboard-list"
desc = "Check out the roadmap and ongoing work"
[[params.links.developer]]
name = "Developer mailing list"
url = "https = //accounts.eclipse.org/mailing-list/kanto-dev"
url = "https://accounts.eclipse.org/mailing-list/kanto-dev"
icon = "fa fa-envelope"
desc = "Join developer discussions"

# Eclipse relevant links. These will show up at the bottom footer line.
[[params.links.eclipse]]
url = "https = //eclipse.org"
url = "https://eclipse.org"
name = "Eclipse Foundation"

[[params.links.eclipse]]
url = "https = //eclipse.org/legal/privacy.php"
url = "https://eclipse.org/legal/privacy.php"
name = "Privacy Policy"

[[params.links.eclipse]]
url = "https = //eclipse.org/legal/termsofuse.php"
url = "https://eclipse.org/legal/termsofuse.php"
name = "Terms of Use"

[[params.links.eclipse]]
url = "https = //eclipse.org/legal/copyright.php"
url = "https://eclipse.org/legal/copyright.php"
name = "Copyright Agent"

[[params.links.eclipse]]
url = "https = //eclipse.org/legal/"
url = "https://eclipse.org/legal/"
name = "Legal"

[[params.links.eclipse]]
url = "https = //github.com/eclipse-kanto/kanto/raw/main/LICENSE"
url = "https://github.com/eclipse-kanto/kanto/raw/main/LICENSE"
name = "License"

[[params.links.eclipse]]
url = "https = //eclipse.org/security/"
url = "https://eclipse.org/security/"
name = "Report a Vulnerability"

[taxonomies]
Expand All @@ -208,44 +208,4 @@ year = "year"
[[module.imports]]
path = "github.com/google/docsy/dependencies"
disable = false

# [[module.mounts]]
# # The following entry is the one we actually need, to be able to
# # refer to it in our own assets/scss files.
# source = "assets/scss"
# target = "assets/scss/docsy"
# # Unfortunately that means we need to redefine all of Docsy's
# # module mounts here...
# # https://github.com/google/docsy/commit/215f68033bbc7bddf8dbec2bbabf8749d1998a17 (lines 24f)
# #
# # I hope this use-case will be simplified one day.
# [[module.mounts]]
# source = "content"
# target = "content"
# [[module.mounts]]
# source = "static"
# target = "static"
# [[module.mounts]]
# source = "layouts"
# target = "layouts"
# [[module.mounts]]
# source = "data"
# target = "data"
# [[module.mounts]]
# source = "assets"
# target = "assets"
# [[module.mounts]]
# source = "i18n"
# target = "i18n"
# [[module.mounts]]
# source = "archetypes"
# target = "archetypes"
# [[module.mounts]]
# source = "node_modules/bootstrap"
# target = "assets/vendor/bootstrap"
# [[module.mounts]]
# source = "node_modules/@fortawesome/fontawesome-free"
# target = "assets/vendor/Font-Awesome"
# [[module.mounts]]
# source = "node_modules/@fortawesome/fontawesome-free/webfonts"
# target = "static/webfonts"

0 comments on commit 8f659e0

Please sign in to comment.