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

Add navbar-var-length config parameter #1011

Merged
merged 2 commits into from
Jul 21, 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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Unreleased version

- Fixed the navigation menu so that it would be the same length as the longest sub-menu (#765)
- Added `navbar-var-length` config setting that allows the navigation menu to be the same length as the longest sub-menu, so that long words in the submenu are not cut off (#765)
- Added `post_search` config setting that creates a Search button in the navbar (older websites need to set `post_search: true` to enable this feature) (#770)
- Added `edit_page_button` config setting that adds a "Edit page" button to the footer (to edit the current page on GitHub) (#1004)
- BREAKING CHANGE: More control over RSS feed sharing: previously, an RSS feed was *always* generated, and if the config setting `rss-description` was set then there was an RSS icon in the footer. Now, an RSS feed is only generated when the config setting `rss-description` exists, and an RSS footer icon is only shown if `rss: true` is set in the `social-network-links` config settings
Expand Down
5 changes: 5 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ post_search: true
# Add a button in the footer to edit the current page. Only works if your website is hosted on GitHub
edit_page_button: true

# Allow sub-menu items (second-level navigation menu items) to be longer than the top-level menu
# If this setting is off, then long sub-menu words might get cut off
# See https:/daattali/beautiful-jekyll/issues/765 to understand the issue this setting can solve
navbar-var-length: false

# The keywords to associate with your website, for SEO purposes
#keywords: "my,list,of,keywords"

Expand Down
11 changes: 10 additions & 1 deletion assets/css/beautifuljekyll.css
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,14 @@ img {
margin-top: 0;
font-size: 1em;
border: 0;
min-width: 100%;
padding: 0;
{% if site.navbar-var-length %}
min-width: 100%;
{% else %}
min-width: 0;
width: 100%;
word-break: break-word;
{% endif %}
}

.navbar-custom .nav-item.dropdown .dropdown-menu .dropdown-item {
Expand All @@ -260,6 +266,9 @@ img {
text-decoration: none !important;
font-weight: normal;
color: {{ site.navbar-text-col | default: "#404040" }};
{% unless site.navbar-var-length %}
white-space: normal;
{% endunless %}
}

@media (min-width: 1200px) {
Expand Down