adityatelange / adityatelange/hugo-PaperMod

[Enhancement]: add Hamburger Menu (Most of the code is done)

未關閉
#1,878 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
enhancement
主要語言
HTML
星號
13.9k
分支
3.4k
PR 合併指標
30 天內沒有已合併 PR

描述

### What you'd like to propose?

[github.com/Simon99de/hugo-PaperMod-hamburger-menu/](https://github.com/Simon99de/hugo-PaperMod-hamburger-menu/blob/master/layouts/_partials/header.html)

Finally, you should add the style and script elsewhere to optimize performance.
To use the hamburger menu, you need to enable a parameter; otherwise, the code won't even appear in the public section.

```
params:
hamBurgerMenu: true # default false
hamBurgerMaxWidth: 768px # default: 768px (optional; px or rem must be specified!)
```

***

The code can be used without citing sources, which is often requested. I created it because, with large menus, you eventually have to scroll sideways through the menu, so I think a hamburger menu is a good solution.

Since the request is for the code (the output) to remain simple,
I’ve packed everything into a single rule that must be explicitly enabled if you want to use it.

Unfortunately, I haven’t figured out yet where it’s best to store the JS and CSS and then generate them only when the feature is active. That’s why everything is in a single file.

### test / use
Create the folder `/layouts/_partials/` in the website's root directory (overwrite it in the theme) and copy the `header.html` file linked above into it. This will completely change the menu at the top!

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。