From 691f41a599507c2400c58b92921ad8582d98d3e0 Mon Sep 17 00:00:00 2001 From: Deano Centrella Date: Fri, 31 Jan 2020 10:18:32 +1030 Subject: [PATCH 1/4] Improved the language selector with improved navigation. - On small screens the user can now trigger the language selector via a new menu button at the top of the page, rather than having to scroll down below the content to access it. - Language selector no longer requires javascript - Also brings the user to the same page they were viewing but in the selected language, rather than sending the user to the landing page and having them try to navigate their way back to the page that they wanted to read. - The icon for the language selector has a retina display variant (not hugely important to include a low resolution version of the icon except for the fact that some rendering engines add white artifacts to the edges of png images if they are shown much smaller than what the resolution of the image actually is (Firefox). --- _data/navigation.yaml | 96 ++++- _data/strings.json | 29 +- _docs/Security_Model.md | 2 +- _includes/header.html | 48 ++- _includes/language-selector.html | 25 ++ _includes/nav-generator.html | 12 + _includes/sidebar-lang.html | 26 -- _includes/sidebar-search.html | 15 +- _includes/underlined-search.html | 20 + _layouts/default-package-sidebar.html | 4 +- _layouts/default.html | 4 +- _sass/_base.scss | 469 ++++++++++++++++++++++- _sass/_layout.scss | 155 +++++++- assets/icon_language-select_dark.png | Bin 0 -> 583 bytes assets/icon_language-select_dark_2x.png | Bin 0 -> 977 bytes assets/icon_language-select_white.png | Bin 0 -> 309 bytes assets/icon_language-select_white_2x.png | Bin 0 -> 515 bytes assets/icon_search_white_24px.png | Bin 0 -> 553 bytes assets/icon_search_white_48px.png | Bin 0 -> 994 bytes assets/social_fediverse_mastodon.png | Bin 0 -> 1950 bytes assets/social_rss.png | Bin 0 -> 1856 bytes assets/social_twitter.png | Bin 0 -> 2202 bytes css/main.scss | 4 + js/sidebar-lang.js | 26 -- 24 files changed, 854 insertions(+), 81 deletions(-) create mode 100644 _includes/language-selector.html create mode 100644 _includes/nav-generator.html delete mode 100644 _includes/sidebar-lang.html create mode 100644 _includes/underlined-search.html create mode 100644 assets/icon_language-select_dark.png create mode 100644 assets/icon_language-select_dark_2x.png create mode 100644 assets/icon_language-select_white.png create mode 100644 assets/icon_language-select_white_2x.png create mode 100644 assets/icon_search_white_24px.png create mode 100644 assets/icon_search_white_48px.png create mode 100644 assets/social_fediverse_mastodon.png create mode 100644 assets/social_rss.png create mode 100644 assets/social_twitter.png delete mode 100644 js/sidebar-lang.js diff --git a/_data/navigation.yaml b/_data/navigation.yaml index 0a3990cd..0ffdc148 100644 --- a/_data/navigation.yaml +++ b/_data/navigation.yaml @@ -1,15 +1,101 @@ - key : browse + title : browse__title url : /packages/ -- key : forum - url : https://forum.f-droid.org - external : true + locations : {"hero", + "dropMenu", # drop-down menu AND footer + "internal"} + +- key : about + url : /about/ + locations : {"hero", + "dropMenu", + "internal"} + +- key : installation + title : installation__title + url : /docs/Security_Model/#secure-initial-installation + locations : {"dropMenu"} + +- key : faq + url : /docs/ + locations : {"hero", + "dropMenu", + "internal"} + - key : documentation url : /docs/ + locations : {"community"} # first of the 'Community' links + - key : news + title : news__title url : /news/ + locations : {"hero", + "dropMenu", + "internal"} + +- key : forum + url : https://forum.f-droid.org + external : true + locations : {"hero", + "internal", + "community"} + +# drop-down menu and footer 'secondary links' +- key : security + title : security__title + url : /docs/Security_Model/ + locations : {"drop2"} + +- key : privacy + url : /2019/05/05/trust-privacy-and-free-software.html + locations : {"drop2"} + +- key : contacts + title : contacts__title + url : /about/#contact + locations : {"drop2"} + +# the remaining 'Community' links +- key : repo + url : https://gitlab.com/fdroid/fdroidclient + external : true + locations : {"community"} + - key : issues + title : issues__title url : /issues/ + locations : {"community"} + +- key : become_a_mirror + url : /docs/Running_a_Mirror/ + locations : {"community"} + - key : contribute url : /contribute/ -- key : about - url : /about/ + locations : {"internal", + "community"} + +- key : social__fediverse__alt + title : social__fediverse__title + url : https://mastodon.technology/@fdroidorg + class : fediverse + external : true + locations : {"social"} + +- key : social__twitter__alt + title : social__twitter__title + url : https://twitter.com/fdroidorg + class : twitter + external : true + locations : {"social"} + +- key : social__rss__alt + title : social__rss__title + url : https://f-droid.org/en/feed.xml + class : rss + external : true + locations : {"social"} + +# Search +- key : search_site + url : https://search.f-droid.org/ diff --git a/_data/strings.json b/_data/strings.json index 01bec46a..f73bd9f9 100644 --- a/_data/strings.json +++ b/_data/strings.json @@ -20,12 +20,35 @@ }, "navigation": { "about": "About", - "browse": "Browse", + "become_a_mirror": "Become a Mirror", + "browse": "Apps", + "browse__title": "App list from A to Z", + "celebrating_10yrs_service": "Celebrating 10 years of service since 2010", + "community": "Community", + "contacts": "Contacts", + "contacts__title": "Contributors and Consultants", "contribute": "Contribute", "documentation": "Docs", + "documentation__alt": "Documentation", + "faq": "FAQs", "forum": "Forum", - "issues": "Issues", - "news": "News" + "gitlab__title": "F-Droid source-code", + "installation": "Installation", + "installation__title": "Secure download and install", + "issues": "Report issues", + "issues__title": "See and report issues", + "news": "News", + "news__title": "Posts by F-Droid Contributors", + "privacy": "Privacy", + "repo": "Gitlab", + "security": "Security", + "security__title": "Our Security Model", + "social__fediverse__alt": "Mastodon icon", + "social__fediverse__title": "Toot us on the Fediverse", + "social__rss__alt": "RSS icon", + "social__rss__title": "Our RSS feed", + "social__twitter__alt": "Twitter icon", + "social__twitter__title": "Our tweets" }, "package": { "anti_features": "Anti-Features", diff --git a/_docs/Security_Model.md b/_docs/Security_Model.md index cc00ea40..727c89ee 100644 --- a/_docs/Security_Model.md +++ b/_docs/Security_Model.md @@ -62,7 +62,7 @@ and the [Signing Process](../Signing_Process) are documented separately. -## Initial Installs +## Secure Initial Installation Most users of F-Droid download the APK from _f-droid.org_ and install it. This is a potential vector of attack that built-in app stores do diff --git a/_includes/header.html b/_includes/header.html index 23f5e0d2..9aa84361 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -3,18 +3,40 @@ {{ site.header-title }} +
+ {% include language-selector.html checkbox_menu_id="header-lang" hideOnPhone=true %} - - +
+ {% assign menu_id = "header-ellipsis" %} + + +
+ + +
+ +
+
+ diff --git a/_includes/language-selector.html b/_includes/language-selector.html new file mode 100644 index 00000000..617eb241 --- /dev/null +++ b/_includes/language-selector.html @@ -0,0 +1,25 @@ +{% comment %} + The language chooser is now a checkbox/radio button hack that opens a dropdown list of the languages + that can be scrolled through on small screens which link to the same page but in the different language. +{% endcomment %} + +{% assign strings = site.data.strings.sidebars.lang %} + +
+ + +
+ + +
+
+
+ {% for lang in site.languages %} + + {{ site.data.languagenames[lang] }} + + {% endfor %} +
+
+
diff --git a/_includes/nav-generator.html b/_includes/nav-generator.html new file mode 100644 index 00000000..580c0d23 --- /dev/null +++ b/_includes/nav-generator.html @@ -0,0 +1,12 @@ +{% for nav-item in site.data.navigation %} + {% if nav-item.key and nav-item.locations contains include.nav_location %} + {% assign text = site.data.strings.navigation[nav-item.key] %} + {% assign title = site.data.strings.navigation[nav-item.title] %} + {% if nav-item.external %} + {{ text }} + {% else %} + {{ text }} + {% endif %} + {% endif %} +{% endfor %} + diff --git a/_includes/sidebar-lang.html b/_includes/sidebar-lang.html deleted file mode 100644 index c8c20d29..00000000 --- a/_includes/sidebar-lang.html +++ /dev/null @@ -1,26 +0,0 @@ -{% comment %} - The language chooser is a drop down list which displays the relevant flag to the left. - If JavaScript is enabled, then it will automatically redirect to the relevant translation when changed. - If the user has JavaScript disabled, then it will show a submit button, and the .htaccess file will rewrite - the incoming "?lang=..." query parameter to the correct translated path. -{% endcomment %} - -{% assign strings = site.data.strings.sidebars.lang %} - -
- - - - - - - -
diff --git a/_includes/sidebar-search.html b/_includes/sidebar-search.html index cea8b6d5..4d4c7a49 100644 --- a/_includes/sidebar-search.html +++ b/_includes/sidebar-search.html @@ -1,7 +1,20 @@ + +{% comment %} + See 'post.html' for reasoning on the below annoying loop +{% endcomment %} + +{% assign searchUrl = 0 %} +{% for navItem in site.data.navigation %} + {% if navItem.key == 'search_site' %} + {% assign searchUrl = navItem.url %} + {% break %} + {% endif %} +{% endfor %} +

{{ site.data.strings.sidebars.search.heading }}

-
+
diff --git a/_includes/underlined-search.html b/_includes/underlined-search.html new file mode 100644 index 00000000..da68cebf --- /dev/null +++ b/_includes/underlined-search.html @@ -0,0 +1,20 @@ + +{% comment %} + See 'post.html' for reasoning on the below annoying loop +{% endcomment %} + +{% assign searchUrl = 0 %} +{% for navItem in site.data.navigation %} + {% if navItem.key == 'search_site' %} + {% assign searchUrl = navItem.url %} + {% break %} + {% endif %} +{% endfor %} + + +
+ + + +
+
diff --git a/_layouts/default-package-sidebar.html b/_layouts/default-package-sidebar.html index 7b818d0c..14c0f80a 100644 --- a/_layouts/default-package-sidebar.html +++ b/_layouts/default-package-sidebar.html @@ -21,7 +21,9 @@