Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proof of concept of SVG icons next to external header links #163

Merged
merged 2 commits into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes
4 changes: 4 additions & 0 deletions assets/theme-css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ svg.icon {
vertical-align: middle;
}

.navbar svg.icon {
width: 1.5rem;
}

/* Icon size slightly enlargened for footer */
#footer .social-media-icons {
font-size: 1.5em;
Expand Down
1 change: 1 addition & 0 deletions doc/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ params:
url: /getstarted/
- title: Features
url: /features/
is_external: true
- title: Shortcodes
url: /shortcodes/
keyfeatures:
Expand Down
6 changes: 5 additions & 1 deletion layouts/partials/navbar-clone.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</a>
{{- end}}


<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="cloned-navbar-menu">
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
Expand All @@ -28,12 +28,14 @@
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link">
{{ .title }}
{{ if .is_external }}{{ partial "svg-icon" "launch" }}{{ end }}
</a>

<div class="navbar-dropdown">
{{- range .sublinks }}
<a href="{{ .url }}" class="navbar-item">
{{ .title }}
{{ if .is_external }}{{ partial "svg-icon" "launch" }}{{ end }}
</a>
{{- end }}
</div>
Expand All @@ -42,11 +44,13 @@
<a href="{{ .url }}" class="navbar-item">
<span class="button signup-button rounded secondary-btn raised">
{{ .title }}
{{ if .is_external }}{{ partial "svg-icon" "launch" }}{{ end }}
</span>
</a>
{{- else }}
<a href="{{ .url }}" class="navbar-item is-secondary">
{{ .title }}
{{ if .is_external }}{{ partial "svg-icon" "launch" }}{{ end }}
</a>
{{- end }}
{{- end }}
Expand Down
4 changes: 4 additions & 0 deletions layouts/partials/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link">
{{ .title }}
{{ if .is_external }}{{ partial "svg-icon" "launch" }}{{ end }}
</a>

<div class="navbar-dropdown">
{{- range .sublinks }}
<a href="{{ .url }}" class="navbar-item">
{{ .title }}
{{ if .is_external }}{{ partial "svg-icon" "launch" }}{{ end }}
</a>
{{- end }}
</div>
Expand All @@ -42,11 +44,13 @@
<a href="{{ .url }}" class="navbar-item">
<span class="button signup-button rounded secondary-btn raised">
{{ .title }}
{{ if .is_external }}{{ partial "svg-icon" "launch" }}{{ end }}
</span>
</a>
{{- else }}
<a href="{{ .url }}" class="navbar-item is-secondary">
{{ .title }}
{{ if .is_external }}{{ partial "svg-icon" "launch" }}{{ end }}
</a>
{{- end }}
{{- end }}
Expand Down