Skip to content

Commit

Permalink
Add navbar-var-length config parameter (daattali#1011)
Browse files Browse the repository at this point in the history
* add navbar-var-length config option

* fix endif -> endunless
  • Loading branch information
daattali authored Jul 21, 2022
1 parent 0859158 commit 685cf73
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
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://github.com/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

0 comments on commit 685cf73

Please sign in to comment.