Skip to content

Commit

Permalink
Merge branch 'main' into chalin-im-gtag-2022-08-17
Browse files Browse the repository at this point in the history
  • Loading branch information
LisaFC committed Aug 23, 2022
2 parents 302050e + 519930c commit b0c7c1a
Show file tree
Hide file tree
Showing 9 changed files with 328 additions and 385 deletions.
56 changes: 41 additions & 15 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
cSpell:ignore docsy
-->

# Changelog

Useful links: Docsy [releases][] & [tags][]. Jump to the [latest][] release.
Expand All @@ -6,43 +10,60 @@ For a list of issues targeted for the next release, see the [22Q2][] milestone.

## [0.5.0][] - next planned release (unpublished yet)

For a full list of the changes to this release, see the [release notes][0.5.0].
For the full list of the changes found in this release, see the [release
notes][0.5.0]. **BREAKING CHANGES** are documented below.

**After you update** your project's Docsy:

- Update your project setup (see [0.4.0][]) if you haven't already.
- Run `npm install`.

**New**:

- Projects can now install and use [Docsy as an NPM package][].

**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][].

[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
[upgraded fontawesome]: https://fontawesome.com/docs/web/setup/upgrade/
[what's changed]: https://fontawesome.com/docs/web/setup/upgrade/whats-changed

## [0.4.0][]

For a full list of the changes to this release, see the [release notes][0.4.0].
Potential **BREAKING CHANGES** are documented below.

**Breaking changes**:
**After you update** your project's Docsy, run `npm install`.

### Update your project setup

- Docsy no longer uses git submodules for Bootstrap and FontAwesome. If your
project uses [Hugo Modules][], then this change doesn't impact you.
If your project uses Docsy as follows:

For projects with [other Docsy setups][], use the NPM packages of Bootstrap
and FontAwesome. Migrate your site by following these steps (execute commands
from your project's root directory):
- [Hugo Module][], then this change doesn't impact you.
- For [other Docsy setups][], this is a **BREAKING CHANGE** -- read on.

1. Update Docsy to 0.4.0.
2. Delete obsolete Docsy Git submodules:
Docsy now fetches Bootstrap and FontAwesome as NPM packages rather than git
submodules. This has an impact on your project-build setup. To migrate your
site, follow these steps (execute commands from your project's root directory):

1. Delete obsolete Docsy Git submodules:
```console
$ rm -Rf themes/docsy/assets/vendor
```
3. Get Docsy dependencies:
2. Get Docsy dependencies:
```console
$ (cd themes/docsy && npm install)
```
4. (Optional) If your site uses NPM, consider getting Docsy dependencies via
a [prepare][] script as follows:
3. Update your build scripts to fetch Docsy dependencies automatically. For
example, if your site build uses NPM scripts, consider getting Docsy
dependencies via a [prepare][] script as follows:
```json
{
"name": "my-website",
Expand All @@ -53,9 +74,14 @@ For a full list of the changes to this release, see the [release notes][0.4.0].
"...": "..."
}
```
5. Proceed as usual to build or serve your site.
4. (Optional) Build script cleanup. If your project uses Docsy as a git
submodule, Docsy updates no longer require the `--recursive` flag when
running `git submodule update`. Consider dropping the flag if you have no
other recursive git submodules.

Proceed as usual to build or serve your site.

[hugo modules]: https://www.docsy.dev/docs/get-started/docsy-as-module/
[hugo module]: https://www.docsy.dev/docs/get-started/docsy-as-module/
[other docsy setups]: https://www.docsy.dev/docs/get-started/other-options/
[prepare]:
https://docs.npmjs.com/cli/v8/using-npm/scripts#prepare-and-prepublish
Expand Down
2 changes: 1 addition & 1 deletion assets/scss/_search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
border-radius: 1rem;
}

font-family: $font-awesome-font-name, $font-family-base;
font-family: $font-family-base, $font-awesome-font-name;
}

.popover.offline-search-result {
Expand Down
64 changes: 0 additions & 64 deletions config.toml

This file was deleted.

46 changes: 46 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Docsy config
#
# cSpell:ignore docsy fortawesome fontawesome webfonts

params:
time_format_blog: Monday, January 02, 2006
time_format_default: January 2, 2006
rss_sections: [blog]
drawio:
enable: true

outputFormats:
PRINT:
baseName: index
isHTML: true
mediaType: text/html
path: _print
permalinkable: false

module:
hugoVersion:
extended: true
min: 0.73.0
mounts:
- source: assets
target: assets
- source: node_modules/bootstrap
target: assets/vendor/bootstrap
- source: node_modules/@fortawesome/fontawesome-free
target: assets/vendor/Font-Awesome
- source: i18n
target: i18n
- source: layouts
target: layouts
- source: static
target: static
- source: node_modules/@fortawesome/fontawesome-free/webfonts
target: static/webfonts
# Mounts for projects using Docsy as an NPM package. The source path prefix
# "../.." moves out of themes/docsy so that Docsy can find its dependencies.
- source: ../../node_modules/bootstrap
target: assets/vendor/bootstrap
- source: ../../node_modules/@fortawesome/fontawesome-free
target: assets/vendor/Font-Awesome
- source: ../../node_modules/@fortawesome/fontawesome-free/webfonts
target: static/webfonts
97 changes: 62 additions & 35 deletions layouts/partials/navbar.html
Original file line number Diff line number Diff line change
@@ -1,35 +1,62 @@
{{ $cover := and (.HasShortcode "blocks/cover") (not .Site.Params.ui.navbar_translucent_over_cover_disable) }}
<nav class="js-navbar-scroll navbar navbar-expand navbar-dark {{ if $cover}} td-navbar-cover {{ end }}flex-column flex-md-row td-navbar">
<a class="navbar-brand" href="{{ .Site.Home.RelPermalink }}">
<span class="navbar-logo">{{ if .Site.Params.ui.navbar_logo }}{{ with resources.Get "icons/logo.svg" }}{{ ( . | minify).Content | safeHTML }}{{ end }}{{ end }}</span><span class="font-weight-bold">{{ .Site.Title }}</span>
</a>
<div class="td-navbar-nav-scroll ml-md-auto" id="main_navbar">
<ul class="navbar-nav mt-2 mt-lg-0">
{{ $p := . }}
{{ range .Site.Menus.main }}
<li class="nav-item mr-4 mb-2 mb-lg-0">
{{ $active := or ($p.IsMenuCurrent "main" .) ($p.HasMenuCurrent "main" .) }}
{{ with .Page }}
{{ $active = or $active ( $.IsDescendant .) }}
{{ end }}
{{ $pre := .Pre }}
{{ $post := .Post }}
{{ $url := urls.Parse .URL }}
{{ $baseurl := urls.Parse $.Site.Params.Baseurl }}
<a class="nav-link{{if $active }} active{{end}}" href="{{ with .Page }}{{ .RelPermalink }}{{ else }}{{ .URL | relLangURL }}{{ end }}" {{ if ne $url.Host $baseurl.Host }}target="_blank" {{ end }}>{{ with .Pre}}{{ $pre }}{{ end }}<span{{if $active }} class="active"{{end}}>{{ .Name }}</span>{{ with .Post}}{{ $post }}{{ end }}</a>
</li>
{{ end }}
{{ if .Site.Params.versions }}
<li class="nav-item dropdown mr-4 d-none d-lg-block">
{{ partial "navbar-version-selector.html" . }}
</li>
{{ end }}
{{ if (gt (len .Site.Home.Translations) 0) }}
<li class="nav-item dropdown mr-4 d-none d-lg-block">
{{ partial "navbar-lang-selector.html" . }}
</li>
{{ end }}
</ul>
</div>
<div class="navbar-nav d-none d-lg-block">{{ partial "search-input.html" . }}</div>
</nav>
{{ $cover := and
(.HasShortcode "blocks/cover")
(not .Site.Params.ui.navbar_translucent_over_cover_disable)
-}}

<nav
class="js-navbar-scroll navbar navbar-expand navbar-dark {{ if $cover }}td-navbar-cover{{ end }} flex-column flex-md-row td-navbar">
<a class="navbar-brand" href="{{ .Site.Home.RelPermalink }}">
{{- /**/ -}}
<span class="navbar-logo">
{{- if .Site.Params.ui.navbar_logo -}}
{{ with resources.Get "icons/logo.svg" -}}
{{ ( . | minify).Content | safeHTML -}}
{{ end -}}
{{ end -}}
</span>
{{- /**/ -}}
<span class="font-weight-bold">
{{- .Site.Title -}}
</span>
{{- /**/ -}}
</a>
<div class="td-navbar-nav-scroll ml-md-auto" id="main_navbar">
<ul class="navbar-nav mt-2 mt-lg-0">
{{ $p := . -}}
{{ range .Site.Menus.main -}}
<li class="nav-item mr-4 mb-2 mb-lg-0">
{{ $active := or ($p.IsMenuCurrent "main" .) ($p.HasMenuCurrent "main" .) -}}
{{ with .Page }}{{ $active = or $active ( $.IsDescendant .) }}{{ end -}}
{{ $pre := .Pre -}}
{{ $post := .Post -}}
{{ $url := urls.Parse .URL -}}
{{ $baseurl := urls.Parse $.Site.Params.Baseurl -}}
<a {{/**/ -}}
class="nav-link {{- if $active }} active {{- end }}" {{/**/ -}}
href="{{ with .Page }}{{ .RelPermalink }}{{ else }}{{ .URL | relLangURL }}{{ end }}"
{{- if ne $url.Host $baseurl.Host }} target="_blank" {{- end -}}
>
{{- with .Pre }}{{ $pre }}{{ end -}}
<span {{- if $active }} class="active" {{- end }}>
{{- .Name -}}
</span>
{{- with .Post }}{{ $post }}{{ end -}}
</a>
</li>
{{ end -}}
{{ if .Site.Params.versions -}}
<li class="nav-item dropdown mr-4 d-none d-lg-block">
{{ partial "navbar-version-selector.html" . -}}
</li>
{{ end -}}
{{ if (gt (len .Site.Home.Translations) 0) -}}
<li class="nav-item dropdown mr-4 d-none d-lg-block">
{{ partial "navbar-lang-selector.html" . -}}
</li>
{{ end -}}
</ul>
</div>
<div class="navbar-nav d-none d-lg-block">
{{ partial "search-input.html" . }}
</div>
</nav>
Loading

0 comments on commit b0c7c1a

Please sign in to comment.