Comments (3)
Is mobile-menu
supposed to support drop down menu?
I am trying to add this feature to my site as well. My current progress:
+++ b/layouts/partials/header.html
@@ -38,5 +38,18 @@
</li>
{{ end }}
+ {{ if gt (len .Site.Home.AllTranslations) 1 }}
+ <li class="menu-item">
+ <!-- drop down navigation MENU -->
+ <a class="menu-item-link menu-parent" href="{{ .URL | absLangURL | safeURL }}">{{ i18n "language" }}</a>
+ <ul class="submenu">
+ {{ range .Site.Home.AllTranslations }}
+ <li>
+ <a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>
+ </li>
+ {{ end }}
+ </ul>
+ </li>
+ {{ end }}
</ul>
</nav>
+++ b/layouts/partials/slideout.html
@@ -23,5 +23,17 @@
</a>
</li>
{{- end }}
+ {{ if gt (len .Site.Home.AllTranslations) 1 }}
+ <li class="mobile-menu-item">
+ {{ i18n "language" }}
+ <ul class="submenu">
+ {{ range .Site.Home.AllTranslations }}
+ <li>
+ <a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>
+ </li>
+ {{ end }}
+ </ul>
+ </li>
+ {{ end }}
+++ b/i18n/en.yaml
@@ -95,3 +95,7 @@
- id: read_fr
translation: Lire en français
+
+- id: language
+ translation: Language
from hugo-theme-jane.
@shaform Yes, mobile-menu
should support drop down menu. I will do this next step.
Your progress looks good! But I have a little doubt about "how to display language menu better".
Maybe like this site: https://www.duolingo.com/ ? I am not sure.
Most users just use two languages. They can add a language link to the menu easily.
So, my point is, it's better add an option to show available translations in the menu.
Thanks for your progress. Welcome to PR! 😄
from hugo-theme-jane.
Thanks for @shaform ! Now, hugo-theme-jane could show list of languages in the menu.
To enable this feature, you need add an option showMenuLanguageChooser = true
to your site config file.
from hugo-theme-jane.
Related Issues (20)
- 顶部导航栏字体没有加粗 HOT 1
- In 58d7b87, menus does not work in Chinese exampleSite HOT 1
- In 58d7b87, code block without language looks weird HOT 3
- config.toml里面的外部链接设置有误
- 如何支持二级目录?
- mathjaxEnableSingleDollar 这个配置是失效了吗? HOT 1
- 在小屏幕上,表格列数过多会导致布局没有对齐,文章整体出现横向滚动条。 HOT 1
- 我都以为你放弃了。。。。。 HOT 9
- 想问下大家配置了goldmark代码显示还是这样可能是什么原因啊 HOT 1
- In e4f2475, code block with one line looks weird
- .Rmd figures do not show up
- Sticky navbar
- Help Enable Comment for Post
- Widescreen support
- 电脑显示器模式 看着页面内容太窄,怎么加宽些呢?
- Add a copy button to the theme code block? HOT 1
- Add a copy button to the theme code block?
- cannot remove rss logo HOT 1
- 发生了啥,为啥语法高亮没有了,无论什么语言都是这样。
- 模板日志是有问题吗 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hugo-theme-jane.