From beea20d55b193f9e6787b6978da9c5c319f7b010 Mon Sep 17 00:00:00 2001 From: MJOVANOVIC Date: Fri, 24 Apr 2020 19:21:06 +0200 Subject: [PATCH 01/41] fixed disqus integration, changing to .Site.Params.DisqusShortname --- layouts/_default/content.html | 2 +- layouts/blog/content.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/_default/content.html b/layouts/_default/content.html index 2aa4e6b1c4..f6f47475ad 100644 --- a/layouts/_default/content.html +++ b/layouts/_default/content.html @@ -9,7 +9,7 @@

{{ .Title }}

{{ partial "feedback.html" .Site.Params.ui.feedback }}
{{ end }} - {{ if (.Site.DisqusShortname) }} + {{ if (.Site.Params.DisqusShortname) }}
{{ partial "disqus-comment.html" . }} {{ end }} diff --git a/layouts/blog/content.html b/layouts/blog/content.html index 7193b191d7..3a5faedd2e 100644 --- a/layouts/blog/content.html +++ b/layouts/blog/content.html @@ -6,7 +6,7 @@

{{ .Title }}

{{ .Content }} - {{ if (.Site.DisqusShortname) }} + {{ if (.Site.Params.DisqusShortname) }}
{{ partial "disqus-comment.html" . }}
From 8bcc620ea9b6faeffa34f649d8581b584cc6540f Mon Sep 17 00:00:00 2001 From: Daniel Muller Date: Mon, 27 Apr 2020 16:56:35 +0800 Subject: [PATCH 02/41] Add french translations --- i18n/fr.toml | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 i18n/fr.toml diff --git a/i18n/fr.toml b/i18n/fr.toml new file mode 100644 index 0000000000..8d9f65ed36 --- /dev/null +++ b/i18n/fr.toml @@ -0,0 +1,43 @@ + + +# UI strings. Buttons and similar. + +[ui_pager_prev] +other = "Précédent" + +[ui_pager_next] +other = "Suivant" + +[ui_read_more] +other = "Lire plus" + +[ui_search] +other = "Rechercher ce site…" + +# Used in sentences such as "Posted in News" +[ui_in] +other = "dans" + +# Footer text +[footer_all_rights_reserved] +other = "Tous droits résérvés" + +[footer_privacy_policy] +other = "Politique de confidentialité" + + +# Post (blog, articles etc.) +[post_byline_by] +other = "Par" +[post_created] +other = "Crée" +[post_last_mod] +other = "Dernière modification" +[post_edit_this] +other = "Modifier cette page" +[post_create_issue] +other = "Créer un problème dans la documentation" +[post_create_project_issue] +other = "Créer un problème dans le projet" +[post_posts_in] +other = "Messages dans" From a9972c262399c99896eabcede6b5ff67fec202b6 Mon Sep 17 00:00:00 2001 From: BuhoSolido Date: Sat, 2 May 2020 12:25:11 +0200 Subject: [PATCH 03/41] add Spanish template --- i18n/es.toml | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 i18n/es.toml diff --git a/i18n/es.toml b/i18n/es.toml new file mode 100644 index 0000000000..d148c95ff1 --- /dev/null +++ b/i18n/es.toml @@ -0,0 +1,43 @@ + + +# UI strings. Botones y similares. + +[ui_pager_prev] +other = "Previo" + +[ui_pager_next] +other = "Siguiente" + +[ui_read_more] +other = "Contiuar leyendo" + +[ui_search] +other = "Buscar" + +# Used in sentences such as "Posted in News" +[ui_in] +other = "en" + +# Footer text +[footer_all_rights_reserved] +other = "Derechos reservados" + +[footer_privacy_policy] +other = "Política de privacidad" + + +# Post (blog, articles etc.) +[post_byline_by] +other = "Por" +[post_created] +other = "Creado" +[post_last_mod] +other = "Última modificación" +[post_edit_this] +other = "Editar esta página" +[post_create_issue] +other = "Notificar una incidencia con la documentanción" +[post_create_project_issue] +other = "Notificar una incidencia en un proyecto" +[post_posts_in] +other = "Añadir entrada" From 1b791730e651f9079d365fee3ba66b50b968d6e9 Mon Sep 17 00:00:00 2001 From: vildam Date: Thu, 14 May 2020 11:24:08 +0300 Subject: [PATCH 04/41] Add Russian translations --- i18n/ru.toml | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 i18n/ru.toml diff --git a/i18n/ru.toml b/i18n/ru.toml new file mode 100644 index 0000000000..95fe77169a --- /dev/null +++ b/i18n/ru.toml @@ -0,0 +1,43 @@ + + +# UI strings. Buttons and similar. + +[ui_pager_prev] +other = "Предыдущая" + +[ui_pager_next] +other = "Следующая" + +[ui_read_more] +other = "Подробнее" + +[ui_search] +other = "Поиск по сайту…" + +# Used in sentences such as "Posted in News" +[ui_in] +other = "в" + +# Footer text +[footer_all_rights_reserved] +other = "Все права защищены" + +[footer_privacy_policy] +other = "Политика конфиденциальности" + + +# Post (blog, articles etc.) +[post_byline_by] +other = "Автор" +[post_created] +other = "Создано" +[post_last_mod] +other = "Изменено" +[post_edit_this] +other = "Отредактировать страницу" +[post_create_issue] +other = "Предложить изменения документации" +[post_create_project_issue] +other = "Предложить доработки по проекту" +[post_posts_in] +other = "Публикации в" From 88311ff57a5e2fb058bbecad843d3f10bdde15c2 Mon Sep 17 00:00:00 2001 From: Takayama Fumihiko Date: Sat, 23 May 2020 14:20:19 +0900 Subject: [PATCH 05/41] Fix a offline search issue that escaped HTML entities is shown --- assets/json/offline-search-index.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/json/offline-search-index.json b/assets/json/offline-search-index.json index 0ec4084350..d15055db66 100644 --- a/assets/json/offline-search-index.json +++ b/assets/json/offline-search-index.json @@ -1,5 +1,5 @@ {{- $.Scratch.Add "offline-search-index" slice -}} {{- range where .Site.AllPages ".Params.exclude_search" "!=" true -}} -{{- $.Scratch.Add "offline-search-index" (dict "title" .Title "ref" .RelPermalink "body" .Plain "excerpt" (.Summary | truncate 100)) -}} +{{- $.Scratch.Add "offline-search-index" (dict "title" (.Title | htmlUnescape) "ref" .RelPermalink "body" (.Plain | htmlUnescape) "excerpt" (.Summary | htmlUnescape | truncate 100)) -}} {{- end -}} {{- $.Scratch.Get "offline-search-index" | jsonify -}} From 3c17f0fa0f4d6deb109836698d16fb3de4477f06 Mon Sep 17 00:00:00 2001 From: Takayama Fumihiko Date: Sat, 23 May 2020 16:25:34 +0900 Subject: [PATCH 06/41] Add offlineSearchSummaryLength to config.toml --- assets/json/offline-search-index.json | 2 +- userguide/config.toml | 3 +-- userguide/content/en/docs/Adding content/navigation.md | 10 ++++++++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/assets/json/offline-search-index.json b/assets/json/offline-search-index.json index d15055db66..bc832b7933 100644 --- a/assets/json/offline-search-index.json +++ b/assets/json/offline-search-index.json @@ -1,5 +1,5 @@ {{- $.Scratch.Add "offline-search-index" slice -}} {{- range where .Site.AllPages ".Params.exclude_search" "!=" true -}} -{{- $.Scratch.Add "offline-search-index" (dict "title" (.Title | htmlUnescape) "ref" .RelPermalink "body" (.Plain | htmlUnescape) "excerpt" (.Summary | htmlUnescape | truncate 100)) -}} +{{- $.Scratch.Add "offline-search-index" (dict "title" (.Title | htmlUnescape) "ref" .RelPermalink "body" (.Plain | htmlUnescape) "excerpt" (.Plain | htmlUnescape | truncate (.Site.Params.offlineSearchSummaryLength | default 70))) -}} {{- end -}} {{- $.Scratch.Get "offline-search-index" | jsonify -}} diff --git a/userguide/config.toml b/userguide/config.toml index d79b191241..e0156d0b18 100644 --- a/userguide/config.toml +++ b/userguide/config.toml @@ -127,6 +127,7 @@ algolia_docsearch = false #Enable offline search with Lunr.js offlineSearch = false +offlineSearchSummaryLength = 70 # User interface configuration [params.ui] @@ -188,5 +189,3 @@ enable = false # url = "https://example.org/mail" # icon = "fa fa-envelope" # desc = "Discuss development issues around the project" - - diff --git a/userguide/content/en/docs/Adding content/navigation.md b/userguide/content/en/docs/Adding content/navigation.md index e1a44b0bd7..dbb1d81525 100644 --- a/userguide/content/en/docs/Adding content/navigation.md +++ b/userguide/content/en/docs/Adding content/navigation.md @@ -187,6 +187,16 @@ Once you've completed these steps, local search is enabled for your site and res If you're [testing this locally](/docs/deployment/#serving-your-site-locally) using Hugo’s local server functionality, you need to build your `offline-search-index.xxx.json` file first by running `hugo`. If you have the Hugo server running while you build `offline-search-index.xxx.json`, you may need to stop the server and restart it in order to see your search results. {{% /alert %}} +### Changing the summary length of the local search results + +You can customize the summary length by setting `offlineSearchSummaryLength` in `config.toml`. + +``` +#Enable offline search with Lunr.js +offlineSearch = true +offlineSearchSummaryLength = 200 +``` + ### Changing the width of the local search results popover The width of the search results popover will automatically widen according to the content. From 4e0c7e8e04c5d5e12cdc3c41abb27919d41290a9 Mon Sep 17 00:00:00 2001 From: Takayama Fumihiko Date: Sat, 23 May 2020 16:38:04 +0900 Subject: [PATCH 07/41] Add offlineSearchMaxResults to config.toml --- assets/js/offline-search.js | 2 +- layouts/partials/search-input.html | 1 + userguide/config.toml | 1 + userguide/content/en/docs/Adding content/navigation.md | 10 ++++++++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/assets/js/offline-search.js b/assets/js/offline-search.js index 9fb5afea3b..ea59eae50a 100644 --- a/assets/js/offline-search.js +++ b/assets/js/offline-search.js @@ -98,7 +98,7 @@ }); }); }) - .slice(0, 10); + .slice(0, $targetSearchInput.data('offlnie-search-max-results')); // // Make result html diff --git a/layouts/partials/search-input.html b/layouts/partials/search-input.html index 6e442eb9af..a53215bc68 100644 --- a/layouts/partials/search-input.html +++ b/layouts/partials/search-input.html @@ -18,5 +18,6 @@ */}} data-offline-search-index-json-src="{{ $offlineSearchIndexFingerprint.RelPermalink }}" data-offline-search-base-href="/" + data-offlnie-search-max-results="{{ .Site.Params.offlineSearchMaxResults | default 10 }}" > {{ end }} diff --git a/userguide/config.toml b/userguide/config.toml index e0156d0b18..b2a6b8e682 100644 --- a/userguide/config.toml +++ b/userguide/config.toml @@ -128,6 +128,7 @@ algolia_docsearch = false #Enable offline search with Lunr.js offlineSearch = false offlineSearchSummaryLength = 70 +offlineSearchMaxResults = 10 # User interface configuration [params.ui] diff --git a/userguide/content/en/docs/Adding content/navigation.md b/userguide/content/en/docs/Adding content/navigation.md index dbb1d81525..a63bdfd35c 100644 --- a/userguide/content/en/docs/Adding content/navigation.md +++ b/userguide/content/en/docs/Adding content/navigation.md @@ -197,6 +197,16 @@ offlineSearch = true offlineSearchSummaryLength = 200 ``` +### Changing the maximum result count of the local search + +You can customize the maximum result count by setting `offlineSearchMaxResults` in `config.toml`. + +``` +#Enable offline search with Lunr.js +offlineSearch = true +offlineSearchMaxResults = 25 +``` + ### Changing the width of the local search results popover The width of the search results popover will automatically widen according to the content. From bac04df9bcb4be87d503b04cf396a69f89b590bb Mon Sep 17 00:00:00 2001 From: Takayama Fumihiko Date: Sat, 23 May 2020 17:05:54 +0900 Subject: [PATCH 08/41] Fix a offline search result when excerpt contains HTML entities --- assets/json/offline-search-index.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/json/offline-search-index.json b/assets/json/offline-search-index.json index bc832b7933..17707a8d39 100644 --- a/assets/json/offline-search-index.json +++ b/assets/json/offline-search-index.json @@ -1,5 +1,6 @@ {{- $.Scratch.Add "offline-search-index" slice -}} {{- range where .Site.AllPages ".Params.exclude_search" "!=" true -}} -{{- $.Scratch.Add "offline-search-index" (dict "title" (.Title | htmlUnescape) "ref" .RelPermalink "body" (.Plain | htmlUnescape) "excerpt" (.Plain | htmlUnescape | truncate (.Site.Params.offlineSearchSummaryLength | default 70))) -}} +{{/* We have to apply `htmlUnescape` again after `truncate` because `truncate` applies `html.EscapeString` if the argument is not HTML. */}} +{{- $.Scratch.Add "offline-search-index" (dict "title" .Title "ref" .RelPermalink "body" (.Plain | htmlUnescape) "excerpt" (.Plain | htmlUnescape | truncate (.Site.Params.offlineSearchSummaryLength | default 70) | htmlUnescape)) -}} {{- end -}} {{- $.Scratch.Get "offline-search-index" | jsonify -}} From ef078069d178505718493c50f6768967fb7d2137 Mon Sep 17 00:00:00 2001 From: Takayama Fumihiko Date: Sat, 23 May 2020 20:17:02 +0900 Subject: [PATCH 09/41] Apply Prettier to offline-search.js --- assets/js/offline-search.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/assets/js/offline-search.js b/assets/js/offline-search.js index ea59eae50a..31f70f02b6 100644 --- a/assets/js/offline-search.js +++ b/assets/js/offline-search.js @@ -98,7 +98,10 @@ }); }); }) - .slice(0, $targetSearchInput.data('offlnie-search-max-results')); + .slice( + 0, + $targetSearchInput.data('offlnie-search-max-results') + ); // // Make result html From 0176e3d266898f6c8d768c11dd4a552529c6a6b8 Mon Sep 17 00:00:00 2001 From: Takayama Fumihiko Date: Sat, 23 May 2020 21:36:38 +0900 Subject: [PATCH 10/41] Update offline search result design --- assets/js/offline-search.js | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/assets/js/offline-search.js b/assets/js/offline-search.js index 9fb5afea3b..a24a5f86cb 100644 --- a/assets/js/offline-search.js +++ b/assets/js/offline-search.js @@ -143,27 +143,30 @@ ); } else { results.forEach((r) => { - const $cardHeader = $('
').addClass('card-header'); const doc = resultDetails.get(r.ref); const href = $searchInput.data('offline-search-base-href') + r.ref.replace(/^\//, ''); - $cardHeader.append( - $('').attr('href', href).text(doc.title) + const $entry = $('
').addClass('mt-4'); + + $entry.append( + $('').addClass('d-block text-muted').text(r.ref) ); - const $cardBody = $('
').addClass('card-body'); - $cardBody.append( - $('

') - .addClass('card-text text-muted') - .text(doc.excerpt) + $entry.append( + $('') + .addClass('d-block') + .css({ + fontSize: '1.2rem', + }) + .attr('href', href) + .text(doc.title) ); - const $card = $('

').addClass('card'); - $card.append($cardHeader).append($cardBody); + $entry.append($('

').text(doc.excerpt)); - $searchResultBody.append($card); + $searchResultBody.append($entry); }); } From b203f77284fc2ca1b34464165981530af1f0a2a4 Mon Sep 17 00:00:00 2001 From: Bence Ferdinandy Date: Mon, 25 May 2020 13:47:58 +0200 Subject: [PATCH 11/41] adding Hungarian toml --- i18n/hu.toml | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 i18n/hu.toml diff --git a/i18n/hu.toml b/i18n/hu.toml new file mode 100644 index 0000000000..832bc13787 --- /dev/null +++ b/i18n/hu.toml @@ -0,0 +1,47 @@ + + +# UI strings. Buttons and similar. + +[ui_pager_prev] +other = "Előző" + +[ui_pager_next] +other = "Következő" + +[ui_read_more] +other = "További olvasnivaló" + +[ui_search] +other = "Keresés ezen az oldalon…" + +# Used in sentences such as "Posted in News" +# TODO: this structure will not work in Hungarian +# so I left it as is +[ui_in] +other = "in" + +# Footer text +[footer_all_rights_reserved] +other = "Minden jog fenntartva" + +[footer_privacy_policy] +other = "Adatvédelmi szabályzat" + + +# Post (blog, articles etc.) +[post_byline_by] +other = "Készítette" +[post_created] +other = "Elkészítve" +[post_last_mod] +other = "Utolsó módosítás" +[post_edit_this] +other = "Oldal szerkesztése" +[post_create_issue] +other = "Dokumentáció issue létrehozása" +[post_create_project_issue] +other = "Projekt issue létrehozása" +# TODO: this structure will not work in Hungarian +# so I left it as is +[post_posts_in] +other = "Posts in" From 445cdfe4346ac26e963ae86792a4d2234004a8f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20B=C3=B6ttger?= Date: Tue, 16 Jun 2020 10:06:28 +0200 Subject: [PATCH 12/41] remove duplicates --- userguide/content/en/docs/Adding content/lookandfeel.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userguide/content/en/docs/Adding content/lookandfeel.md b/userguide/content/en/docs/Adding content/lookandfeel.md index d104805dd3..a1d183cb9d 100644 --- a/userguide/content/en/docs/Adding content/lookandfeel.md +++ b/userguide/content/en/docs/Adding content/lookandfeel.md @@ -54,7 +54,7 @@ Note that if you decide to go with a font with different weights (in the built-i ## CSS utilities -For documentation of available CSS utility classes, see the [Bootstrap Documentation](https://getbootstrap.com/). This theme adds very little on its own in this area. However, we have added some some color state CSS classes that can be useful in a dynamic context: +For documentation of available CSS utility classes, see the [Bootstrap Documentation](https://getbootstrap.com/). This theme adds very little on its own in this area. However, we have added some color state CSS classes that can be useful in a dynamic context: * `.-bg-` * `.-text-` From 2d533cadfbb0f28fde21c751d0baa1437514ab9c Mon Sep 17 00:00:00 2001 From: LisaFC Date: Fri, 19 Jun 2020 17:03:50 +0100 Subject: [PATCH 13/41] Configure feedback so it works for our own site! --- userguide/config.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/userguide/config.toml b/userguide/config.toml index b2a6b8e682..65f30935ac 100644 --- a/userguide/config.toml +++ b/userguide/config.toml @@ -148,8 +148,9 @@ navbar_logo = true [params.ui.feedback] enable = true # The responses that the user sees after clicking "yes" (the page was helpful) or "no" (the page was not helpful). -yes = 'Glad to hear it! Please tell us how we can improve.' -no = 'Sorry to hear that. Please tell us how we can improve.' +# Update with your own repository and response text. +yes = 'Glad to hear it! Please tell us how we can improve.' +no = 'Sorry to hear that. Please tell us how we can improve.' # Adds a reading time to the top of each doc. # If you want this feature, but occasionally need to remove the Reading time from a single page, From 44eebab8c95522c2feb35e22cc6754a729cd903b Mon Sep 17 00:00:00 2001 From: Christian Oliff Date: Mon, 22 Jun 2020 13:01:16 +0900 Subject: [PATCH 14/41] Update jQuery to 3.5.1 From: https://code.jquery.com/jquery/ Fixes a few security vulns: https://snyk.io/vuln/npm:jquery --- layouts/partials/head.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 28b45f471c..33011e4699 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -20,8 +20,8 @@ {{ end }} {{ partialCached "head-css.html" . "asdf" }} {{ if .Site.Params.offlineSearch }} {{end}} -{{ partial "hooks/head-end.html" . }} \ No newline at end of file +{{ partial "hooks/head-end.html" . }} From b2d3cce4cbfdf6514b892cd530553eeaca9e61ef Mon Sep 17 00:00:00 2001 From: Christian Oliff Date: Tue, 23 Jun 2020 00:17:58 +0900 Subject: [PATCH 15/41] Remove browsers from PostCSS Config Specifying browsers via this config is not recommended. The best way to provide browsers is a .browserslistrc file in your project root, or by adding a browserslist key to your package.json. (see: https://github.com/postcss/autoprefixer). However, if you don't define the supported browsers the default browsers option will be used (which is a great setup). REF: https://github.com/browserslist/browserslist#full-list --- postcss.config.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/postcss.config.js b/postcss.config.js index 13d64ecc18..ad6eb708f9 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -16,17 +16,6 @@ limitations under the License. module.exports = { plugins: { - autoprefixer: { - browsers: [ - "Android 2.3", - "Android >= 4", - "Chrome >= 20", - "Firefox >= 24", - "Explorer >= 8", - "iOS >= 6", - "Opera >= 12", - "Safari >= 6" - ] - } + autoprefixer: {} }, } From a13cb0138e0548ab79896d7931e3a84ea6a9d64c Mon Sep 17 00:00:00 2001 From: Michael Gibson Date: Tue, 23 Jun 2020 13:17:27 -0700 Subject: [PATCH 16/41] force sidebar search to hide on desktop but show on mobile, when enabled --- assets/scss/_sidebar-tree.scss | 9 +++++++++ layouts/partials/sidebar-tree.html | 3 +++ 2 files changed, 12 insertions(+) diff --git a/assets/scss/_sidebar-tree.scss b/assets/scss/_sidebar-tree.scss index 3eef1c4b01..45c6043167 100644 --- a/assets/scss/_sidebar-tree.scss +++ b/assets/scss/_sidebar-tree.scss @@ -129,4 +129,13 @@ width: 100%; } } + + #content-desktop {display: block;} + #content-mobile {display: none;} + + @media screen and (max-width: 990px) { + + #content-desktop {display: none;} + #content-mobile {display: block;} + } } \ No newline at end of file diff --git a/layouts/partials/sidebar-tree.html b/layouts/partials/sidebar-tree.html index a3eeb2a45e..fab5060285 100644 --- a/layouts/partials/sidebar-tree.html +++ b/layouts/partials/sidebar-tree.html @@ -2,11 +2,14 @@ {{ $shouldDelayActive := ge (len .Site.Pages) 2000 }}

{{ if not .Site.Params.ui.sidebar_search_disable }} +
+
+
{{ end }}