From 71f8fa611bfb811003667ea6330bce73d0e5ed89 Mon Sep 17 00:00:00 2001 From: Carl Marshall <572826+marshalc@users.noreply.github.com> Date: Fri, 23 Dec 2022 12:41:54 +0000 Subject: [PATCH] Squashed commit of the following: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 324942ae5e9219347e4fa8487e6ab92c94f4bdf1 Author: Patrice Chalin Date: Mon Dec 19 12:15:42 2022 -0500 Docsy examples: drop private-repo (#1338) commit 799fc54ff8079ae2c3979eb7dfdb590954da3f62 Author: Andreas Deininger Date: Thu Dec 8 14:36:44 2022 +0100 Bump Font-Awesome to latest version 6.2.1 (#1325) commit 8924f289b5976dfa3722b12b870680dda9e13798 Author: Geri Ochoa Date: Mon Dec 5 13:45:54 2022 -0500 Update post-release changelog links commit 5597d435dc74ce68240e0c3871addf24567493b0 Author: Geri Ochoa Date: Mon Dec 5 11:18:13 2022 -0500 Release v0.6.0 preparation commit 2c11f5365392945cc49a1220d8fea074b225b6ca Author: Andreas Deininger Date: Fri Oct 14 17:23:14 2022 +0200 Add render hook for 'chem' code blocks Auto activation of `math' and 'chem' blocks Add ability to enable KateX and/or mhchem for individual pages only Upgrade to KaTeX 0.16.3 commit 1fb0e23132b47ca84b1729665e63125566e689a9 Author: Victor "multun" Collod Date: Fri Nov 25 22:36:26 2022 +0100 prevent navbar text wrapping When a navbar item has multiple words, and there are enough navbar item to cause the flexbox to be full at reduced window widths without transitioning through the lower media breakpoint, the navbar link name can wrap, which causes the alignment of all navbar items to break. This change forbids navbar text wrapping even at bigger screen sizes. commit 33f3dfe384636c8f102d2f7980e365be58999b1e Author: Andreas Deininger Date: Wed Nov 23 08:48:12 2022 +0100 Fix: mermaid diagrams with parameters in site config commit b4d66f70ba9b12cf75502cea19c5aa58d5e91486 Merge: f0a06ef 9cc0cd0 Author: Erin McKean Date: Mon Nov 21 09:07:08 2022 -0800 Merge pull request #1314 from google/LisaFC-fontawesome Add FontAwesome info to logos and images page commit 9cc0cd09a6ce645e3d83abb67d96761283e8e2fe Merge: f18a4e8 f0a06ef Author: LisaFC Date: Mon Nov 21 17:04:42 2022 +0000 Merge branch 'main' into LisaFC-fontawesome commit f0a06ef1562763767e7e34a77e50f8be6db492d4 Author: copy rogers <40619032+rogerogers@users.noreply.github.com> Date: Fri Nov 18 20:17:34 2022 +0800 Add etcd, CloudWeGo and Dapr website to examples (#1315) Signed-off-by: rogerogers Signed-off-by: rogerogers commit 1c9e12564d6c47bb97f226f67e4bcd5f48ab7691 Author: LisaFC Date: Thu Nov 17 16:17:25 2022 +0000 Updated to better "mostly docs" example commit c6f138a3862c77b84f210892ef8c6c7cfda770c6 Author: Robert Pająk Date: Thu Nov 17 17:09:41 2022 +0100 Add OpenTelemetry webpage to examples (#1312) commit f18a4e8b6a63fadcec194e426e7bd33263d7260f Author: LisaFC Date: Thu Nov 17 16:05:11 2022 +0000 Update iconsimages.md commit 0cc3704b97afea4d31c0e67d413c82d90101f69d Author: LisaFC Date: Thu Nov 17 16:01:23 2022 +0000 Add FontAwesome info to logos and images page Currently only mention FontAwesome in the context of menus, which has confused some users commit 246a2e1e80ce19b7f08d5820518882d59013429b Author: Geri Ochoa Date: Tue Nov 8 11:34:43 2022 -0500 Fix readfile not rendering html code commit 90ee4810a7c07c1ac8f6baab41bb0b10585d408d Author: Patrice Chalin Date: Wed Nov 9 11:14:17 2022 -0500 Update CHANGELOG.md commit e6a44dff7eb73ee4abd058ca0ee6dc7d18a941f1 Author: Takayama Fumihiko Date: Thu Nov 3 21:48:20 2022 +0900 Fix offline search popover (#1305) commit 42f6ef861ab0f82de71d34368db7eaa857b49bc6 Author: LisaFC Date: Thu Nov 3 11:56:22 2022 +0000 Algolia updates (#1270) Updates for #1250 commit aa7c0ae5d2869f12967b0e979bf935754bb0734c Author: erwin-faceit <43995928+erwin-faceit@users.noreply.github.com> Date: Wed Nov 2 21:15:29 2022 +0100 Update nl (#1301) I18N: update nl.toml commit 33fd6eae0a900ac59eb0cdd0f03b0583929d4c29 Author: mboukhalfa Date: Sun Oct 23 23:53:13 2022 +0300 Add more translation to ar.toml commit d9bf98b876d74772b850ef910c6f59b898f61ccf Author: Andreas Deininger Date: Fri Oct 28 17:22:30 2022 +0200 CHANGELOG: add breaking change (tabbed panes, text display) commit 90843e360b921ea8417995e0261a355f2f3aed7a Author: Stephan Lachnit Date: Thu Oct 27 17:00:08 2022 +0200 Auto activation of mermaid diagrams (via use of hugo render hook) (#990) commit f27daed90073fb74ca3afdc0250910abcfaa6bea Author: Geri Ochoa Date: Fri Oct 21 13:46:19 2022 -0400 Release v0.5.1 preparation commit dd2e2b94852a08ae1e529fd0d60390e50ec9c787 Author: Andreas Deininger Date: Wed Oct 19 16:27:39 2022 +0200 Tabbed pane, fix: avoid duplicate html id if content is pulled in via readfile shortcode (#1289) commit a2f7ecd91d67540afb622454994b7845b396a8bb Author: Andreas Deininger Date: Fri Oct 14 08:41:24 2022 +0200 User guide: fix invalid html by adding alt attribute to image Remove trailing whitespace in a few .md files commit cfa70e3d5fbb9cf8d01c11c1cd06357c8797450b Author: Andreas Deininger Date: Fri Oct 14 08:35:51 2022 +0200 Fix: Tabpane shows multiple tabs at the same time #1271 commit abb7307a311f04de5e97d0fda6cafa49c0d9ddf7 Author: Andreas Deininger Date: Thu Oct 13 12:30:22 2022 +0200 Shortcodes for tabbed panes: improved whitespace handling commit 99eacb09ffb01d8d73f3367ea821e1412a572572 Author: Andreas Deininger Date: Sat Oct 15 12:49:29 2022 +0200 Module setup: update docsy/dependencies to tip of main commit 123800f80efea543a53df4915654cb3e0446c90b Author: Stephan Lachnit Date: Sun Oct 16 17:32:02 2022 +0200 feature: add support for GLFM math blocks (#987) * feature: add support for GLFM math blocks This add supports for GLFM's math blocks [1] using hugo's Markdown render hooks [2]. [1]: https://docs.gitlab.com/ee/user/markdown.html#math [2]: https://gohugo.io/templates/render-hooks/#render-hooks-for-code-blocks Signed-off-by: Stephan Lachnit commit be5da07ecff1247cc64208faa115dc761d1ba825 Author: Andreas Deininger Date: Fri Oct 14 18:16:17 2022 +0200 Fix: hugo serve does not serve Font Awesome anymore (#1282) commit 1e7e32934f520cfe1baaecfe6576db42addc89d1 Author: the-kraljica <25987891+the-kraljica@users.noreply.github.com> Date: Wed Oct 5 17:14:26 2022 +0200 Remove > selector from elements commit 19ec7be59a8ac8f959ac3b0688dd9edeb36c8f9a Author: Patrice Chalin Date: Thu Oct 13 16:15:01 2022 -0400 Search styling refactoring, and fix for offline search (#1279) commit ba4ed72caf54c8bbc246e1e5c0553fc897369a8a Author: Mike Kruskal <62662355+mkruskal-google@users.noreply.github.com> Date: Thu Oct 13 00:37:57 2022 -0700 Fixing FontAwesome icon handling in search placeholder (#1247) commit 7489c354a3ca873182e4748ba7bb57cea2d7f468 Author: Patrice Chalin Date: Mon Oct 10 13:08:44 2022 -0400 CHANGELOG adjustments commit ded6a0d97909338a2757c1f2f30262fd2d658a65 Author: Patrice Chalin Date: Mon Oct 10 12:22:25 2022 -0400 Revert #1200 to recover desc blog post order (#1269) commit 14cee5a8b6a8f5f9361d430899d0ee7f2645003d Author: Patrice Chalin Date: Sat Oct 8 11:25:31 2022 -0400 Scripts: one more whitespace tweak commit 0e7912306d23c6c5da8a534a4e6e7be932d58192 Author: Patrice Chalin Date: Sat Oct 8 11:18:56 2022 -0400 Scripts: get Popper from Bootstrap bundle (#1268) commit 0204dd9e78ffba89ae88997f63e48bc8a84e671d Author: Patrice Chalin Date: Sat Oct 8 11:02:03 2022 -0400 Revert to Popper v1 so tooltips work (#1266) commit c4216a8c93b2649b51918bc520de3d99a6ff8858 Author: Patrice Chalin Date: Sat Oct 8 10:32:08 2022 -0400 More whitespace cleanup - partials/scripts.html commit 20b0c70068dd6bbd2bb5733ad1a4546e6ecb795e Author: Patrice Chalin Date: Sat Oct 8 09:45:52 2022 -0400 Scripts tweak to cleanup whitespace etc (#1262) commit 25b0205a5ea1d975b7f5304ca34392f9c0918484 Author: Patrice Chalin Date: Sat Oct 8 09:03:57 2022 -0400 CHANGELOG: adjust prose since FA was further upgraded (#1261) commit 264566cbd9f3d9e719e21d7791055dfdd981e42e Author: Andreas Deininger Date: Sat Oct 8 12:57:30 2022 +0200 Upgrade to Bootstrap 4.6.2 (module install) (#1218) commit 31476617e566d053525116f7b58428c2d40fdd0a Author: Andreas Deininger Date: Fri Oct 7 22:35:35 2022 +0200 User guide, conversion to modules: fixing config.yaml (#1209) commit 326b0f14b4dc2bcb4342a616ceed557e1326e405 Author: Patrice Chalin Date: Fri Oct 7 12:13:39 2022 -0400 Navbar-brand: define classes for the logo and name (#1190) commit 646ef44abf9fa00a2112efac2e835dd270c54073 Author: Geri Ochoa Date: Thu Oct 6 18:24:29 2022 -0400 Release v0.5.0 prep, fix module dependency commit 0c183ef752905c915cbc635675839e513b52b429 Author: Geri Ochoa Date: Fri Sep 30 10:12:08 2022 -0400 Release v0.5.0 preparation commit de7048f920d410c3fb33f4522da8bc94bdd9fcc0 Author: Geri Ochoa Date: Wed Sep 28 15:45:24 2022 -0400 Add click to copy button Adds a click to copy button to code samples that don't use the Prism highlighter. commit 5c4662c13cf719861486a210759589dd96dd3792 Author: Geri Ochoa Date: Wed Sep 28 17:47:10 2022 -0400 Fix importing wrong drawio script commit bd991a5a206d5417d3d5594963e17e3a4d70d78d Author: Patrice Chalin Date: Tue Oct 4 19:20:55 2022 -0400 Update CHANGELOG.md commit 7f9dc281b229cd9d10444c8f03fa9f9dfd4e1688 Author: Patrice Chalin Date: Wed Aug 17 15:57:38 2022 -0400 Use gtag.js analytics library for all site tags commit c937bcd845ded247fc9a334a515087fbe6b2a29c Author: Andreas Deininger Date: Wed Oct 5 01:47:21 2022 +0200 Userguide, installation via npm: correct themes directory (#1213) commit 07ff9a5bff3d08e6a43c678e1fc97ef895b34261 Author: Patrice Chalin Date: Tue Oct 4 19:18:04 2022 -0400 CHANGELOG: mention FA font-glyph width changes (#1251) commit 01bf2a27513ec38131c4564784fd8423dd27bb1d Author: Patrice Chalin Date: Tue Oct 4 18:40:27 2022 -0400 Mention inadvertent style leakage in CHANGELOG (#1167) --- CHANGELOG.md | 92 ++++++- assets/js/click-to-copy.js | 86 ++++++ assets/js/mermaid.js | 13 +- assets/js/offline-search.js | 15 +- assets/js/search.js | 2 +- assets/scss/_code.scss | 48 +++- assets/scss/_content.scss | 6 +- assets/scss/_nav.scss | 18 +- assets/scss/_search.scss | 111 +++++++- assets/scss/shortcodes/tabbed-pane.scss | 24 +- dependencies/config.toml | 3 + dependencies/go.mod | 4 +- go.mod | 6 +- go.sum | 14 +- i18n/ar.toml | 25 +- i18n/nl.toml | 24 +- .../_markup/render-codeblock-chem.html | 18 ++ .../_markup/render-codeblock-math.html | 18 ++ .../_markup/render-codeblock-mermaid.html | 5 + layouts/_internal/google_analytics_gtag.html | 42 +++ layouts/blog/list.html | 2 +- layouts/partials/head.html | 5 +- layouts/partials/navbar.html | 10 +- layouts/partials/scripts.html | 78 ++++-- layouts/partials/search-input.html | 42 +-- layouts/shortcodes/readfile.html | 9 +- layouts/shortcodes/tab.html | 96 +++---- layouts/shortcodes/tabpane.html | 248 ++++++++++-------- netlify.toml | 2 +- package.json | 6 +- userguide/config.yaml | 10 +- userguide/content/en/docs/Examples/_index.md | 16 +- userguide/content/en/docs/Language/_index.md | 2 +- .../docs/Updating/Convert-site-to-module.md | 1 - .../content/en/docs/adding-content/content.md | 18 +- .../diagrams-and-formulae/index.md | 244 ++++++++++------- .../en/docs/adding-content/feedback.md | 6 + .../en/docs/adding-content/iconsimages.md | 46 ++-- .../en/docs/adding-content/lookandfeel.md | 28 ++ .../en/docs/adding-content/navigation.md | 8 +- .../docs/adding-content/shortcodes/index.md | 6 +- .../en/docs/adding-content/taxonomy.md | 8 +- .../en/docs/adding-content/versioning.md | 14 +- .../installation-prerequisites.md | 4 +- .../en/docs/get-started/other-options.md | 4 +- 45 files changed, 1008 insertions(+), 479 deletions(-) create mode 100644 assets/js/click-to-copy.js create mode 100644 layouts/_default/_markup/render-codeblock-chem.html create mode 100644 layouts/_default/_markup/render-codeblock-math.html create mode 100644 layouts/_default/_markup/render-codeblock-mermaid.html create mode 100644 layouts/_internal/google_analytics_gtag.html diff --git a/CHANGELOG.md b/CHANGELOG.md index 47ad2299e3..e365377c2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # Changelog @@ -8,10 +8,43 @@ Useful links: Docsy [releases][] & [tags][]. Jump to the [latest][] release. For a list of issues targeted for the next release, see the [22Q2][] milestone. -## [0.5.0][] - next planned release (unpublished yet) +## 0.7.0 - next planned release (unpublished yet) + +**New**: + +**Breaking changes**: + +**Other changes**: + +## [0.6.0][] For the full list of the changes found in this release, see the [release -notes][0.5.0]. **BREAKING CHANGES** are documented below. +notes][0.6.0]. + +With this release we declare a feature freeze while we migrate to the newest +Bootstrap version. See [the announcement][bs-announcement] for more information. + +**New**: + +- **Simplified use of mermaid diagrams**: when using a `mermaid` code block on + your page, mermaid is now automatically enabled (needs hugo version >= 0.93.0). + For existing sites build with hugo 0.93.0+, parameter `mermaid.enable` + can be removed from site config. + +- **Add render hook for chem code blocks**: add auto-activation of `math` and + `chem` blocks via KateX and mhchem. Support for formula rendering activation + on individual pages only. Hugo version >= 0.93.0 required. + +**Breaking changes**: + + +**Other changes**: + + +## [0.5.1][] + +For the full list of the changes found in this release, see the [release +notes][0.5.1]. **BREAKING CHANGES** are documented below. **After you update** your project's Docsy: @@ -24,17 +57,44 @@ notes][0.5.0]. **BREAKING CHANGES** are documented below. **Breaking changes**: -- **Upgraded Bootstrap** to v4.6.2, resulting in some style changes. For - details, see [v4.6.2 release notes][]. -- **[Upgraded FontAwesome][]** to v6.1.2 from v5. While many icons were renamed, - the v5 names will still work. For all the details, see [What's changed][]. - +- **Tabbed panes, text display**. By default, the content of a tab inside a tabbed + pane is shown as code. As of version 0.4 of the shortcode, you can add the + parameter `code=false` to your `tabpane` or `tab` shortcode in order to render + tab content(s) as text (markdown or html). As of version 0.5 the name of this + parameter was changed, we now use `text=true` in order to mark content as text. +- **Display logo by default**. Most projects show their logo in the navbar. In + support of this majority, Docsy now displays a logo by default. For details on + how to hide the logo (or your brand name), see [Styling your project logo and + name][]. +- **Upgraded Bootstrap** to v4.6.2 from v4.6.1, resulting in some style changes + (such as an adjustment in the size of `small`). For details, see [v4.6.2 + release notes][]. +- **[Upgraded FontAwesome][]** to v6 from v5. While many icons were renamed, the + v5 names still work. For details about icon renames and more, see [What's + changed][]. +- **Search-box**: the HTML structure and class names have changed, due to the + Font Awesome upgrade, for both online and offline search. This may affect your + project if you have overridden search styling or scripts. + +**Other changes**: + +- By default, Docsy now uses the [gtag.js][] analytics library for all site + tags. For details, see [Adding Analytics > Setup][]. + +[Adding Analytics > Setup]: https://www.docsy.dev/docs/adding-content/feedback/#setup [v4.6.2 release notes]: https://github.com/twbs/bootstrap/releases/tag/v4.6.2 [docsy as an npm package]: https://www.docsy.dev/docs/get-started/other-options/#option-3-docsy-as-an-npm-package +[gtag.js]: https://support.google.com/analytics/answer/10220869 +[styling your project logo and name]: + https://www.docsy.dev/docs/adding-content/lookandfeel/#styling-your-project-logo-and-name [upgraded fontawesome]: https://fontawesome.com/docs/web/setup/upgrade/ [what's changed]: https://fontawesome.com/docs/web/setup/upgrade/whats-changed +## [0.5.0][] + +Unpublished. + ## [0.4.0][] For a full list of the changes to this release, see the [release notes][0.4.0]. @@ -96,6 +156,13 @@ For a full list of the changes to this release, see the [release notes][0.3.0]. [Algolia DocSearch v3](https://docsearch.algolia.com/docs/DocSearch-v3). If your site uses the deprecated DocSearch v2, you must [update your DocSearch code](https://docsearch.algolia.com/docs/migrating-from-v2). +- (**Edit**) [PR #1009][] inadvertently changed the base [Bootstrap styles for + cards][bs4cards], as well as the Docsy `highlight` style. For details, see + [issue #1154][]. Release [0.5.0][] includes a fix. + +[bs4cards]: https://getbootstrap.com/docs/4.1/components/card/ +[pr #1009]: https://github.com/google/docsy/pull/1009 +[issue #1154]: https://github.com/google/docsy/issues/1154 ## [0.2.0][] @@ -123,13 +190,16 @@ For a full list of the changes to this release, see the [release notes][0.x.y]. [@deining]: https://github.com/deining [@lisafc]: https://github.com/LisaFC -[0.2.0]: https://github.com/google/docsy/releases/v0.2.0 -[0.3.0]: https://github.com/google/docsy/releases/v0.3.0 -[0.4.0]: https://github.com/google/docsy/releases/v0.4.0 +[0.6.0]: https://github.com/google/docsy/releases/v0.6.0 +[0.5.1]: https://github.com/google/docsy/releases/v0.5.1 [0.5.0]: https://github.com/google/docsy/releases/v0.5.0 +[0.4.0]: https://github.com/google/docsy/releases/v0.4.0 +[0.3.0]: https://github.com/google/docsy/releases/v0.3.0 +[0.2.0]: https://github.com/google/docsy/releases/v0.2.0 [0.x.y]: # [22q2]: https://github.com/google/docsy/milestone/3 [hugo modules]: https://gohugo.io/hugo-modules/ [latest]: https://github.com/google/docsy/releases/latest [releases]: https://github.com/google/docsy/releases [tags]: https://github.com/google/docsy/tags +[bs-announcement]: https://github.com/google/docsy/discussions/1308 diff --git a/assets/js/click-to-copy.js b/assets/js/click-to-copy.js new file mode 100644 index 0000000000..5fdb041a86 --- /dev/null +++ b/assets/js/click-to-copy.js @@ -0,0 +1,86 @@ +let codeListings = document.querySelectorAll('.highlight > pre'); + +for (let index = 0; index < codeListings.length; index++) +{ + const codeSample = codeListings[index].querySelector('code'); + const copyButton = document.createElement("button"); + copyButton.setAttribute('type', 'button'); + copyButton.onclick = function() { copyCode(codeSample); }; + copyButton.classList.add('fas', 'fa-copy'); + + const buttonTooltip = document.createElement('div'); + buttonTooltip.classList.add('c2c-tooltip'); + buttonTooltip.setAttribute('role', 'tooltip'); + buttonTooltip.innerHTML += 'Copy to clipboard'; + + const buttonDiv = document.createElement('div'); + buttonDiv.classList.add('click-to-copy'); + + // Use Popper to create and handle the tooltip behavior. + + const popperInstance = Popper.createPopper(copyButton, buttonTooltip, + { + modifiers: + [ + { + name: 'offset', + options: + { + offset: [0, -48], + }, + }, + ], + }); + + copyButton.addEventListener('click', () => + { + buttonTooltip.innerHTML = 'Copied!'; + }); + + copyButton.addEventListener('mouseenter', () => + { + buttonTooltip.setAttribute('show-tooltip', ''); + + // Enable eventListeners when the code block is on the viewport + + popperInstance.setOptions((options) => ({ + ...options, + modifiers: + [ + ...options.modifiers, + { name: 'eventListeners', enabled: true }, + ], + })); + popperInstance.update(); + }); + + copyButton.addEventListener('mouseleave', () => + { + buttonTooltip.removeAttribute('show-tooltip'); + + // Reset the message in case the button was clicked + buttonTooltip.innerHTML = 'Copy to clipboard'; + + // Disble eventListeners when the code block is NOT on the viewport + + popperInstance.setOptions((options) => ({ + ...options, + modifiers: + [ + ...options.modifiers, + { name: 'eventListeners', enabled: false }, + ], + })); + }); + + buttonDiv.append(copyButton); + buttonDiv.append(buttonTooltip); + codeListings[index].insertBefore(buttonDiv, codeSample); + +} + +function copyCode(codeSample) +{ + navigator.clipboard.writeText(codeSample.textContent.trim()); +} + diff --git a/assets/js/mermaid.js b/assets/js/mermaid.js index 821e567872..6b021d416d 100644 --- a/assets/js/mermaid.js +++ b/assets/js/mermaid.js @@ -1,18 +1,23 @@ -{{ with .Site.Params.mermaid }} -{{ if .enable }} (function($) { var needMermaid = false; + +{{ if ge hugo.Version "0.93.0" -}} + if ($('.mermaid').length > 0) { + needMermaid = true; + }; +{{ else -}} $('.language-mermaid').parent().replaceWith(function() { needMermaid = true; return $('
').text($(this).text());
     });
+{{ end -}}
 
     if (!needMermaid)  {
         mermaid.initialize({startOnLoad: false});
         return;
     }
 
-    var params = {{ . | jsonify | safeJS }};
+    var params = {{ .Site.Params.mermaid | jsonify | safeJS }};
 
     // site params are stored with lowercase keys; lookup correct casing
     // from Mermaid default config.
@@ -34,5 +39,3 @@
     settings.startOnLoad = true;
     mermaid.initialize(settings);
 })(jQuery);
-{{ end }}
-{{ end }}
diff --git a/assets/js/offline-search.js b/assets/js/offline-search.js
index 55e8a81caf..666a4b45d1 100644
--- a/assets/js/offline-search.js
+++ b/assets/js/offline-search.js
@@ -4,7 +4,7 @@
     'use strict';
 
     $(document).ready(function () {
-        const $searchInput = $('.td-search-input');
+        const $searchInput = $('.td-search input');
 
         //
         // Options for popover
@@ -14,7 +14,7 @@
         $searchInput.data('placement', 'bottom');
         $searchInput.data(
             'template',
-            ''
+            ''
         );
 
         //
@@ -130,11 +130,8 @@
                             .css({ fontWeight: 'bold' })
                     )
                     .append(
-                        $('')
-                            .addClass('fas fa-times search-result-close-button')
-                            .css({
-                                cursor: 'pointer',
-                            })
+                        $('')
+                            .addClass('td-offline-search-results__close-button')
                     )
             );
 
@@ -182,14 +179,14 @@
             }
 
             $targetSearchInput.on('shown.bs.popover', () => {
-                $('.search-result-close-button').on('click', () => {
+                $('.td-offline-search-results__close-button').on('click', () => {
                     $targetSearchInput.val('');
                     $targetSearchInput.trigger('change');
                 });
             });
 
             $targetSearchInput
-                .data('content', $html[0].outerHTML)
+                .data('content', $html[0])
                 .popover('show');
         };
     });
diff --git a/assets/js/search.js b/assets/js/search.js
index 83fbb155d5..2ae687c791 100644
--- a/assets/js/search.js
+++ b/assets/js/search.js
@@ -21,7 +21,7 @@ limitations under the License.
     var Search = {
         init: function() {
             $(document).ready(function() {
-               $(document).on('keypress', '.td-search-input', function(e) {
+               $(document).on('keypress', '.td-search input', function(e) {
                     if (e.keyCode !== 13) {
                         return
                     }
diff --git a/assets/scss/_code.scss b/assets/scss/_code.scss
index d491beeb45..b96850bff6 100644
--- a/assets/scss/_code.scss
+++ b/assets/scss/_code.scss
@@ -7,10 +7,56 @@
 	
         margin: 2rem 0;
         padding: 0;
-	    
+        position: relative;
+
+        .click-to-copy {
+            display: block;
+            text-align: right;
+            height: 1ex;
+        }
+
         pre {
             margin: 0;
             padding: 1rem;
+
+            // Default click-to-copy button
+
+            button {
+               position: absolute;
+               color: $gray-400;
+               border-radius: 3px;
+               border-width: 0;
+               background-color: inherit;
+               box-shadow: 1px 1px $gray-400;
+               right: 8px;
+               top: 6px;
+
+               &:hover {
+                  color: $dark;
+                  background-color: $gray-400;
+               }
+               &:active {
+                  color: $dark;
+                  background-color: $gray-400;
+                  transform: translateY(2px);
+               }
+            }
+
+            .c2c-tooltip {
+               background: $dark;
+               color: $white;
+               padding: 2px 4px;
+               border-radius: 3px;
+               display: block;
+               visibility: hidden;
+               opacity: 0;
+               transition: visibility 0s, opacity 0.5s linear;
+            }
+
+            .c2c-tooltip[show-tooltip] {
+               visibility: visible;
+               opacity: 1;
+            }
         }
     }
 
diff --git a/assets/scss/_content.scss b/assets/scss/_content.scss
index 3e72e00ebb..9a9f3969ef 100644
--- a/assets/scss/_content.scss
+++ b/assets/scss/_content.scss
@@ -35,7 +35,7 @@
         @extend .img-fluid;
     }
 
-    > table {
+    table {
         @extend .table-striped;
 
         @extend .table-responsive;
@@ -43,14 +43,14 @@
         @extend .table;
     }
 
-    > blockquote {
+    blockquote {
         padding: 0 0 0 1rem;
         margin-bottom: $spacer;
         color: $gray-600;
         border-left: 6px solid $secondary;
     }
 
-    > ul li, > ol li {
+    ul li, ol li {
         margin-bottom: .25rem;
     }
 
diff --git a/assets/scss/_nav.scss b/assets/scss/_nav.scss
index 2b82c0440a..d34f180b08 100644
--- a/assets/scss/_nav.scss
+++ b/assets/scss/_nav.scss
@@ -36,14 +36,12 @@
         width: 100%;
     }
 
-
     .navbar-brand {
         text-transform: none;
         text-align: middle;
 
-        .nav-link {
-            display: inline-block;
-            margin-right: -30px;
+        &__name {
+          font-weight: $font-weight-bold;
         }
 
         svg {
@@ -58,14 +56,12 @@
         font-weight: $font-weight-bold;
     }
 
-    .td-search-input {
-        border: none;
-        color: $navbar-dark-color;
-        @include placeholder {
-            color: $navbar-dark-color;
-        }
+    .navbar-nav {
+        white-space: nowrap;
     }
 
+    // For .td-search__input styling, see _search.scss
+
     .dropdown {
         min-width: 100px;
     }
@@ -89,9 +85,7 @@
             .navbar-nav {
                 padding-bottom: 2rem;
                 overflow-x: auto;
-                white-space: nowrap;
                 -webkit-overflow-scrolling: touch;
-
             }
         }
     }
diff --git a/assets/scss/_search.scss b/assets/scss/_search.scss
index 4c8fe88ee1..481ec5ddb6 100644
--- a/assets/scss/_search.scss
+++ b/assets/scss/_search.scss
@@ -1,24 +1,103 @@
 // Search
 
-.td-search-input {
+.td-search {
     background: transparent;
-    max-width: 90%;
+    position: relative;
+    width: 90%;
+
+    // Search icon
+    &__icon {
+        // Vertically center the content.
+        display: flex;
+        align-items: center;
+        height: 100%;
+
+        // Position this on the left of the input.
+        position: absolute;
+        left: 0.75em;
 
-    &.form-control:focus {
-        border-color: lighten($primary, 60%);
-        box-shadow: 0 0 0 2px lighten($primary, 30%);
-        color: inherit;
+        // Click-through to the underlying input.
+        pointer-events: none;
+
+        &:before {
+            @extend .fa;
+            content: fa-content($fa-var-search);
+        }
+
+        // Styling adjustments for the navbar
+        @at-root {
+            .td-navbar & {
+                color: $navbar-dark-color;
+            }
+        }
     }
 
-    @if $enable-rounded {
-        border-radius: 1rem;
+    // Search input element
+    &__input {
+        width: 100%;
+        text-indent: 1.25em;
+
+        @if $enable-rounded {
+            border-radius: 1rem;
+        }
+
+        &:not(:focus) {
+            background: transparent;
+        }
+
+        &.form-control:focus {
+            border-color: lighten($primary, 60%);
+            box-shadow: 0 0 0 2px lighten($primary, 30%);
+            color: inherit;
+        }
+
+        // Styling adjustments for the navbar
+        @at-root {
+            .td-navbar & {
+                border: none;
+                color: $navbar-dark-color;
+
+                @include placeholder {
+                    color: $navbar-dark-color;
+                }
+            }
+        }
+
     }
 
-    font-family: $font-family-base, $font-awesome-font-name;
+    // Hide icon on focus
+    &:focus-within {
+
+        .td-search__icon {
+            display: none;
+        }
+
+        .td-search-input {
+            text-indent: 0px;
+        }
+    }
+
+    &:not(:focus-within) {
+        color: $input-placeholder-color;
+    }
 }
 
-.popover.offline-search-result {
-    // Override bootstrap default style (max-width: $popover-max-width;)
+// Offline search
+
+.td-search--offline {
+
+    &:focus-within {
+        // Don't hide the search icon on focus: this gives better UX when user
+        // explores content of search-results popup and focus is lost.
+
+        .td-search__icon {
+            display: flex;
+            color: $input-placeholder-color;
+        }
+    }
+}
+
+.td-offline-search-results {
     max-width: 90%;
 
     .card {
@@ -28,4 +107,14 @@
             font-weight: bold;
         }
     }
+
+    &__close-button {
+        // cursor: pointer;
+        float: right;
+
+        &:after {
+            @extend .fas;
+            content: fa-content($fa-var-times);
+        }
+    }
 }
diff --git a/assets/scss/shortcodes/tabbed-pane.scss b/assets/scss/shortcodes/tabbed-pane.scss
index f63b50d064..65096aee6e 100644
--- a/assets/scss/shortcodes/tabbed-pane.scss
+++ b/assets/scss/shortcodes/tabbed-pane.scss
@@ -1,14 +1,17 @@
 .tab-content {
-  .highlight {
-    margin: 0rem 0 2rem 0;
+  .tab-pane {
+    pre {
+      margin: 0rem 0 0rem 0;
+    }
   }
 }
+
 .tab-content {
   .tab-pane {
     .highlight {
-    margin: 0rem 0 0rem 0;
-    border: none;
-    max-width: 100%;
+      margin: 0rem 0 0rem 0;
+      border: none;
+      max-width: 100%;
     }
     margin-top: 0rem;
     margin-bottom: 1.5rem;
@@ -16,7 +19,7 @@
     border-left: 1px solid rgba(0, 0, 0, 0.125);
     border-right: 1px solid rgba(0, 0, 0, 0.125);
     border-bottom: 1px solid rgba(0, 0, 0, 0.125);
-    }
+  }
 }
 
 .tab-body {
@@ -27,10 +30,9 @@
   padding: 1.5rem;
 
   @each $color, $value in $theme-colors {
-      &-#{$color} {
-
-          border-style: solid;
-          border-color: $value;
-      }
+    &-#{$color} {
+      border-style: solid;
+      border-color: $value;
+    }
   }
 }
diff --git a/dependencies/config.toml b/dependencies/config.toml
index 3d4ec07abd..3ba31f38f9 100644
--- a/dependencies/config.toml
+++ b/dependencies/config.toml
@@ -37,3 +37,6 @@ _merge = "deep"
 [[module.imports.mounts]]
   source = "scss"
   target = "assets/vendor/Font-Awesome/scss"
+[[module.imports.mounts]]
+  source = "webfonts"
+  target = "static/webfonts"
diff --git a/dependencies/go.mod b/dependencies/go.mod
index 21e47f477c..29a0cb1729 100644
--- a/dependencies/go.mod
+++ b/dependencies/go.mod
@@ -3,6 +3,6 @@ module github.com/google/docsy/dependencies
 go 1.12
 
 require (
-	github.com/FortAwesome/Font-Awesome v0.0.0-20210804190922-7d3d774145ac // indirect
-	github.com/twbs/bootstrap v4.6.1+incompatible // indirect
+	github.com/FortAwesome/Font-Awesome v0.0.0-20221115183454-96cafbd73ec4 // indirect
+	github.com/twbs/bootstrap v4.6.2+incompatible // indirect
 )
diff --git a/go.mod b/go.mod
index a92e03b58f..70b0dbf1d3 100644
--- a/go.mod
+++ b/go.mod
@@ -3,7 +3,7 @@ module github.com/google/docsy
 go 1.12
 
 require (
-	github.com/FortAwesome/Font-Awesome v0.0.0-20210804190922-7d3d774145ac // indirect
-	github.com/google/docsy/dependencies v0.4.1-0.20220905171817-ae8b8117ed16 // indirect
-	github.com/twbs/bootstrap v4.6.1+incompatible // indirect
+	github.com/FortAwesome/Font-Awesome v0.0.0-20221115183454-96cafbd73ec4 // indirect
+	github.com/google/docsy/dependencies v0.6.0 // indirect
+	github.com/twbs/bootstrap v4.6.2+incompatible // indirect
 )
diff --git a/go.sum b/go.sum
index 8032032524..ca3df92a6a 100644
--- a/go.sum
+++ b/go.sum
@@ -1,6 +1,12 @@
-github.com/FortAwesome/Font-Awesome v0.0.0-20210804190922-7d3d774145ac h1:AjwgwoaDsNEA1Wtc8pgw/BqG7SEk9bKxXPjEPQQ42vY=
-github.com/FortAwesome/Font-Awesome v0.0.0-20210804190922-7d3d774145ac/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
+github.com/FortAwesome/Font-Awesome v0.0.0-20220831210243-d3a7818c253f h1:bvkUptSRPZBr3Kxuk+bnWCEmQ5MtEJX5fjezyV0bC3g=
+github.com/FortAwesome/Font-Awesome v0.0.0-20220831210243-d3a7818c253f/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
+github.com/FortAwesome/Font-Awesome v0.0.0-20221115183454-96cafbd73ec4 h1:xfr9SidRCMEh4A8fdkLhFPcHAVbrdv3Ua0Jp/nSmhhQ=
+github.com/FortAwesome/Font-Awesome v0.0.0-20221115183454-96cafbd73ec4/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
+github.com/google/docsy/dependencies v0.4.0/go.mod h1:2zZxHF+2qvkyXhLZtsbnqMotxMukJXLaf8fAZER48oo=
 github.com/google/docsy/dependencies v0.4.1-0.20220905171817-ae8b8117ed16 h1:6Ju+wn/ReUk9qmvKU68JlYhnWe48Tq+2HZ4vyeSpNMk=
 github.com/google/docsy/dependencies v0.4.1-0.20220905171817-ae8b8117ed16/go.mod h1:2zZxHF+2qvkyXhLZtsbnqMotxMukJXLaf8fAZER48oo=
-github.com/twbs/bootstrap v4.6.1+incompatible h1:75PsBfPU1SS65ag0Z3Cq6JNXVAfUNfB0oCLHh9k9Fu8=
-github.com/twbs/bootstrap v4.6.1+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
+github.com/google/docsy/dependencies v0.5.1-0.20221014161617-be5da07ecff1 h1:DH0NbaXJjODFImfRJGCSXDhnRO/IaD2VTGVlRjULUtc=
+github.com/google/docsy/dependencies v0.5.1-0.20221014161617-be5da07ecff1/go.mod h1:EDGc2znMbGUw0RW5kWwy2oGgLt0iVXBmoq4UOqstuNE=
+github.com/google/docsy/dependencies v0.5.1/go.mod h1:EDGc2znMbGUw0RW5kWwy2oGgLt0iVXBmoq4UOqstuNE=
+github.com/twbs/bootstrap v4.6.2+incompatible h1:TDa+R51BTiy1wEHSYjmqDb8LxNl/zaEjAOpRE9Hwh/o=
+github.com/twbs/bootstrap v4.6.2+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
diff --git a/i18n/ar.toml b/i18n/ar.toml
index 12d93820d4..8035bd935c 100644
--- a/i18n/ar.toml
+++ b/i18n/ar.toml
@@ -15,6 +15,9 @@ other = "ابحث في هذا الموقع"
 # Used in sentences such as "Posted in News"
 [ui_in]
 other = "في"
+# Used in sentences such as "All Tags"
+[ui_all]
+other = "كل"
 
 # Footer text
 [footer_all_rights_reserved]
@@ -33,6 +36,8 @@ other = "منشئة"
 other = "اخر تعديل"
 [post_edit_this]
 other = "عدل هذه الصفحة"
+[post_view_this]
+other = "أنظر مصدر الصفحة"
 [post_create_child_page]
 other = " أنشئ صفحة فرعية"
 [post_create_issue]
@@ -42,9 +47,9 @@ other = "أنشئ مسألة حول المشروع"
 [post_posts_in]
 other = "منشور في"
 [post_reading_time]
-other = "minute read"
+other = "دقيقة للقراءة"
 [post_less_than_a_minute_read]
-other = "less than a minute"
+other = "أقل من دقيقة"
 
 # Print support
 [print_printable_section]
@@ -58,18 +63,18 @@ other = "اطبع القسم كاملا"
 
 # Community
 [community_join]
-other = "Join the {{ .Site.Title }} community"
+other = "انضم الي مجتمع {{ .Site.Title }}"
 [community_introduce]
-other = "{{ .Site.Title }} is an open source project that anyone in the community can use, improve, and enjoy. We'd love you to join us! Here's a few ways to find out what's happening and get involved."
+other = "{{ .Site.Title }} هو مشروع مفتوح المصدر يمكن لأي شخص في المجتمع استخدامه وتحسينه والاستمتاع به. يسعدنا أن تنضم إلينا! إليك بعض الطرق للمشاركة و معرفة ما يحدث."
 [community_learn]
-other = "Learn and Connect"
+other = "تعلم وتواصل"
 [community_using]
-other = "Using or want to use {{ .Site.Title }}? Find out more here:"
+other = "تستخدام أو تريد استخدام {{ .Site.Title }}؟ اكتشف المزيد هنا:"
 [community_develop]
-other = "Develop and Contribute"
+other = "طور و ساهم"
 [community_contribute]
-other = "If you want to get more involved by contributing to {{ .Site.Title }}, join us here:"
+other = "إذا كنت ترغب في المشاركة بشكل أكبر من خلال المساهمة في {{ .Site.Title }}, انضم إلينا هنا:"
 [community_how_to]
-other = "You can find out how to contribute to {{ .Site.Title }} in our"
+other = "يمكنك معرفة كيفية المساهمة في {{ .Site.Title }} من خلال"
 [community_guideline]
-other = "Contribution Guidelines"
+other = "إرشادات المساهمة"
diff --git a/i18n/nl.toml b/i18n/nl.toml
index 8f1ac46774..b259842763 100644
--- a/i18n/nl.toml
+++ b/i18n/nl.toml
@@ -18,6 +18,9 @@ other = "Doorzoek deze site"
 [ui_in]
 other = "in"
 
+[ui_all]
+other = "alle"
+
 # Footer text
 [footer_all_rights_reserved]
 other = "Alle rechten voorbehouden"
@@ -25,7 +28,6 @@ other = "Alle rechten voorbehouden"
 [footer_privacy_policy]
 other = "Privacy Policy"
 
-
 # Post (blog, articles etc.)
 [post_byline_by]
 other = "Door"
@@ -35,6 +37,8 @@ other = "Aangemaakt"
 other = "Laatst gewijzigd"
 [post_edit_this]
 other = "Bewerk deze pagina"
+[post_view_this]
+other = "Bekijk paginabron"
 [post_create_child_page]
 other = "Maak sub pagina"
 [post_create_issue]
@@ -56,22 +60,22 @@ other = "Klik hier om te printen"
 [print_show_regular]
 other = "Terug naar normale view van deze pagina"
 [print_entire_section]
-other = "Print complete sectie"
+other = "Print volledige sectie"
 
 # Community
 [community_join]
-other = "Join the {{ .Site.Title }} community"
+other = "Wordt lid van de {{ .Site.Title }} community"
 [community_introduce]
-other = "{{ .Site.Title }} is an open source project that anyone in the community can use, improve, and enjoy. We'd love you to join us! Here's a few ways to find out what's happening and get involved."
+other = "{{ .Site.Title }} is een open source project welke iedereen kan gebruiken, verbeteren en van kan genieten. We zouden het fijn vinden als je betrokken wordt! Hier zijn een aantal manieren om erachter te komen wat er speelt en hoe je betrokken kunt worden."
 [community_learn]
-other = "Learn and Connect"
+other = "Leren en aansluiten"
 [community_using]
-other = "Using or want to use {{ .Site.Title }}? Find out more here:"
+other = "Gebruik je {{ .Site.Title }} of wil je dit gebruiken? Meer informatie hier:"
 [community_develop]
-other = "Develop and Contribute"
+other = "Ontwikkel en draag bij"
 [community_contribute]
-other = "If you want to get more involved by contributing to {{ .Site.Title }}, join us here:"
+other = "Als je meer betrokken wil zijn door bij te dragen aan {{ .Site.Title }}, meldt je hier aan:"
 [community_how_to]
-other = "You can find out how to contribute to {{ .Site.Title }} in our"
+other = "Je kunt meer informatie vinden over hoe bij te dragen aan {{ .Site.Title }} in onze"
 [community_guideline]
-other = "Contribution Guidelines"
+other = "Richtlijnen voor bijdrage"
diff --git a/layouts/_default/_markup/render-codeblock-chem.html b/layouts/_default/_markup/render-codeblock-chem.html
new file mode 100644
index 0000000000..1480857725
--- /dev/null
+++ b/layouts/_default/_markup/render-codeblock-chem.html
@@ -0,0 +1,18 @@
+{{ .Page.Store.Set "hasmhchem" true -}}
+
+{{/* set default delimiters */ -}}
+{{ $delimiter_left := "$$" -}}
+{{ $delimiter_right := "$$" -}}
+
+{{/* override delimiters if set in config file */ -}}
+{{ with $.Page.Site.Params.katex.options.delimiters -}}
+  {{ range first 1 ( where . "display" true ) -}}
+    {{ $delimiter_left = index . "left" -}}
+    {{ $delimiter_right = index . "right" -}}
+  {{ end -}}
+{{ end -}}
+
+{{/* output of chemical formulae */}}
+
{{ $delimiter_left -}} +{{ .Inner | safeHTML -}} +{{ $delimiter_right -}}
{{ "" -}} diff --git a/layouts/_default/_markup/render-codeblock-math.html b/layouts/_default/_markup/render-codeblock-math.html new file mode 100644 index 0000000000..8308694906 --- /dev/null +++ b/layouts/_default/_markup/render-codeblock-math.html @@ -0,0 +1,18 @@ +{{ .Page.Store.Set "hasKaTeX" true -}} + +{{/* set default delimiters */ -}} +{{ $delimiter_left := "$$" -}} +{{ $delimiter_right := "$$" -}} + +{{/* override delimiters if set in config file */ -}} +{{ with $.Page.Site.Params.katex.options.delimiters -}} + {{ range first 1 ( where . "display" true ) -}} + {{ $delimiter_left = index . "left" -}} + {{ $delimiter_right = index . "right" -}} + {{ end -}} +{{ end -}} + +{{/* output of equation */}} +
{{ $delimiter_left -}} +{{ .Inner | safeHTML -}} +{{ $delimiter_right }}
{{ "" -}} \ No newline at end of file diff --git a/layouts/_default/_markup/render-codeblock-mermaid.html b/layouts/_default/_markup/render-codeblock-mermaid.html new file mode 100644 index 0000000000..0b8d7c01bd --- /dev/null +++ b/layouts/_default/_markup/render-codeblock-mermaid.html @@ -0,0 +1,5 @@ +{{ .Page.Store.Set "hasmermaid" true -}} + +
+ {{- .Inner | safeHTML }} +
diff --git a/layouts/_internal/google_analytics_gtag.html b/layouts/_internal/google_analytics_gtag.html new file mode 100644 index 0000000000..32b6a33654 --- /dev/null +++ b/layouts/_internal/google_analytics_gtag.html @@ -0,0 +1,42 @@ +{{/* + + This is a modified copy of + + https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/google_analytics.html, + + specifically this version: + + https://github.com/gohugoio/hugo/blob/f7e00c039ff3cea5f991b05c1e325666004cf129/tpl/tplimpl/embedded/templates/google_analytics.html + + The only differences between this copy and the original are that we've dropped: + + - The `{{ if hasPrefix . "G-"}}` condition + - The `{{ else }}` block + - The `anonymize_ip` argument to the `gtag()` call, since it is superfluous. + For details, see https://github.com/gohugoio/hugo/issues/10093. + +*/}} + +{{- $pc := .Site.Config.Privacy.GoogleAnalytics -}} +{{- if not $pc.Disable }}{{ with .Site.GoogleAnalytics -}} + + +{{- end }}{{ end -}} + +{{- define "__ga_js_set_doNotTrack" -}}{{/* This is also used in the async version. */}} +{{- $pc := .Site.Config.Privacy.GoogleAnalytics -}} +{{- if not $pc.RespectDoNotTrack -}} +var doNotTrack = false; +{{- else -}} +var dnt = (navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack); +var doNotTrack = (dnt == "1" || dnt == "yes"); +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/layouts/blog/list.html b/layouts/blog/list.html index c63c3099be..0f781cb87e 100644 --- a/layouts/blog/list.html +++ b/layouts/blog/list.html @@ -8,7 +8,7 @@
{{- if .Pages -}} - {{ $pag := .Paginate (( $.Scratch.Get "blog-pages").GroupByDate "2006" "asc" )}} + {{ $pag := .Paginate (( $.Scratch.Get "blog-pages").GroupByDate "2006" )}} {{ range $pag.PageGroups }}

{{ T "post_posts_in" }} {{ .Key }}