Skip to content

Commit 27589f5

Browse files
author
Yasir
committed
Merge branch 'main' into updateFontAwesome
2 parents c9f4971 + 2b3b924 commit 27589f5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+727
-593
lines changed

CHANGELOG.md

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,17 @@ For a list of issues targeted for the next release, see the [22Q2][] milestone.
88

99
For a full list of the changes to this release, see the [release notes][0.5.0].
1010

11+
**New**:
12+
13+
- Projects can now install and use [Docsy as an NPM package][].
14+
1115
**Breaking changes**:
1216

1317
- ...
1418

19+
[docsy as an npm package]:
20+
https://www.docsy.dev/docs/get-started/other-options/#option-3-docsy-as-an-npm-package
21+
1522
## [0.4.0][]
1623

1724
For a full list of the changes to this release, see the [release notes][0.4.0].
@@ -25,62 +32,64 @@ For a full list of the changes to this release, see the [release notes][0.4.0].
2532
and FontAwesome. Migrate your site by following these steps (execute commands
2633
from your project's root directory):
2734

28-
1. Update Docsy to 0.4.0.
29-
2. Delete obsolete Docsy Git submodules:
35+
1. Update Docsy to 0.4.0.
36+
2. Delete obsolete Docsy Git submodules:
3037
```console
3138
$ rm -Rf themes/docsy/assets/vendor
3239
```
33-
3. Get Docsy dependencies:
40+
3. Get Docsy dependencies:
3441
```console
3542
$ (cd themes/docsy && npm install)
3643
```
37-
4. (Optional) If your site project uses NPM, consider getting Docsy
38-
dependencies via a `prepare` script, for example:
44+
4. (Optional) If your site uses NPM, consider getting Docsy dependencies via
45+
a [prepare][] script as follows:
3946
```json
4047
{
4148
"name": "my-website",
4249
"scripts": {
43-
"get:submodule": "git submodule update --init --depth 1",
44-
"_prepare:docsy": "cd themes/docsy && npm install",
45-
"prepare": "npm run get:submodule && npm run _prepare:docsy",
50+
"prepare": "cd themes/docsy && npm install",
4651
"...": "..."
4752
},
4853
"...": "..."
4954
}
5055
```
51-
5. Proceed as usual to build or serve your site.
56+
5. Proceed as usual to build or serve your site.
5257

53-
[Hugo Modules]: https://www.docsy.dev/docs/get-started/docsy-as-module/
54-
[other Docsy setups]: https://www.docsy.dev/docs/get-started/other-options/
58+
[hugo modules]: https://www.docsy.dev/docs/get-started/docsy-as-module/
59+
[other docsy setups]: https://www.docsy.dev/docs/get-started/other-options/
60+
[prepare]:
61+
https://docs.npmjs.com/cli/v8/using-npm/scripts#prepare-and-prepublish
5562

5663
## [0.3.0][]
5764

5865
For a full list of the changes to this release, see the [release notes][0.3.0].
5966

6067
**Breaking changes**:
6168

62-
- Upgrade to [Algolia DocSearch
63-
v3](https://docsearch.algolia.com/docs/DocSearch-v3). If your site uses the
64-
deprecated DocSearch v2, you must [update your DocSearch
65-
code](https://docsearch.algolia.com/docs/migrating-from-v2).
69+
- Upgrade to
70+
[Algolia DocSearch v3](https://docsearch.algolia.com/docs/DocSearch-v3). If
71+
your site uses the deprecated DocSearch v2, you must
72+
[update your DocSearch code](https://docsearch.algolia.com/docs/migrating-from-v2).
6673

6774
## [0.2.0][]
6875

6976
**New**:
7077

71-
- Add official Docsy support for [Hugo modules][]. Many thanks to the dedicated and
72-
patient efforts of [@deining][], who researched, experimented, and implemented
73-
this feature. Thanks to [@deining][] and [@LisaFC][] for the doc updates.
78+
- Add official Docsy support for [Hugo modules][]. Many thanks to the dedicated
79+
and patient efforts of [@deining][], who researched, experimented, and
80+
implemented this feature. Thanks to [@deining][] and [@LisaFC][] for the doc
81+
updates.
7482

75-
For details, see [Migrate to Hugo Modules](https://www.docsy.dev/docs/updating/convert-site-to-module/).
83+
For details, see
84+
[Migrate to Hugo Modules](https://www.docsy.dev/docs/updating/convert-site-to-module/).
7685

7786
**Details**:
7887

7988
- For a full list of the changes to this release, see the [release notes][0.2.0]
8089

8190
## [0.X.Y][] - next planned release (unpublished yet)
8291

83-
For a full list of the changes to this release, see the [release notes][0.X.Y].
92+
For a full list of the changes to this release, see the [release notes][0.x.y].
8493

8594
**Breaking changes**:
8695

@@ -92,7 +101,7 @@ For a full list of the changes to this release, see the [release notes][0.X.Y].
92101
[0.3.0]: https://github.com/google/docsy/releases/v0.3.0
93102
[0.4.0]: https://github.com/google/docsy/releases/v0.4.0
94103
[0.5.0]: https://github.com/google/docsy/releases/v0.5.0
95-
[0.X.Y]: #
104+
[0.x.y]: #
96105
[22q2]: https://github.com/google/docsy/milestone/3
97106
[hugo modules]: https://gohugo.io/hugo-modules/
98107
[latest]: https://github.com/google/docsy/releases/latest

CONTRIBUTING.md

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<!-- cSpell:ignore docsy userguide -->
2+
13
# How to Contribute
24

35
We'd love to accept your patches and contributions to this project. There are
@@ -29,35 +31,37 @@ This project follows
2931

3032
## How to contribute
3133

32-
See the [contribution
33-
guidelines](https://www.docsy.dev/docs/contribution-guidelines/)
34-
in the Docsy user guide.
34+
See the [contribution guidelines][] in the Docsy user guide.
3535

3636
## Publishing a release
3737

3838
These notes are WIP for creating a release (v0.X.Y) from a local copy of the
3939
repo.
4040

41-
1. Change directory to your local Docsy repo and ensure that you're on a branch
42-
and at the commit that you want to tag as the next release (usually
43-
`@HEAD`).
41+
1. Change directory to your local Docsy repo.
4442
2. Ensure that the [CHANGELOG](CHANGELOG.md) has a release summary entry for
4543
v0.X.Y. If not, create one with a brief summary of breaking changes using
4644
the section template at the end of the file. (Note that change details are
4745
autogenerated by GitHub in a later step.)
48-
3. Update the Hugo module versions to v0.X.Y.
49-
4. Update the NPM package version in [package.json](package.json) to 0.X.Y.
46+
3. Update module and package versions:
47+
- Update the version of `docsy/dependencies` in [go.mod](go.mod) to v0.X.Y.
48+
- Update the NPM package version in [package.json](package.json) to 0.X.Y.
49+
4. Update the Docsy `version` in [userguide/config.toml][] to 0.X.Y.
5050
5. Commit your changes, usually as a PR entitled "Release v0.X.Y preparation".
5151
Once the PR is approved and merged, proceed with the remaining steps.
52-
6. Create the tags for v0.X.Y (we currently need two):
52+
6. Ensure that you're:
53+
- On the default branch
54+
- At the commit that you want to tag as the next release (usually `@HEAD`).
55+
7. Create the tags for v0.X.Y (we currently need two):
5356

5457
```sh
5558
REL=v0.X.Y
5659
git tag $REL
5760
git tag dependencies/$REL
5861
```
5962

60-
7. Push the new tags to the main repo (which is named `upstream` in my setup):
63+
8. Push the new tags to the main repo (which is named `upstream` in the
64+
following setup):
6165

6266
```console
6367
$ git push upstream $REL && git push upstream dependencies/$REL
@@ -66,28 +70,30 @@ repo.
6670
* [new tag] dependencies/v0.X.Y -> dependencies/v0.X.Y
6771
```
6872

69-
8. Use the GitHub [Draft a new release][] feature, filling in the fields as
73+
9. Use the GitHub [Draft a new release][] feature, filling in the fields as
7074
follows:
7175

72-
- From the **release/tag dropdown**: Select the new release tag that you just
73-
pushed, v0.X.Y.
74-
- Set the **release title** to the release number (without the "v").
75-
- Click "auto-generate release notes" to get the release details.
76-
- Replace the auto-generated "## What's Changed" heading by the following:
76+
- From the **release/tag dropdown**: Select the new release tag that you
77+
just pushed, v0.X.Y.
78+
- Set the **release title** to the release number (without the "v").
79+
- Click "auto-generate release notes" to get the release details.
80+
- Replace the auto-generated "## What's Changed" heading by the following:
7781

78-
```markdown
79-
## Release summary
82+
```markdown
83+
## Release summary
8084
81-
See, https://github.com/google/docsy/blob/main/CHANGELOG.md#0XY
85+
See, https://github.com/google/docsy/blob/main/CHANGELOG.md#0XY
8286
83-
## Commit details
84-
```
87+
## Commit details
88+
```
8589

86-
- Replace the `0XY` anchor target above with a target appropriate for this
87-
release.
88-
- Remove the "New contributors" autogenerated text (if present) since we
89-
don't publish that as part of our release notes.
90-
- Select **Create a discussion for this release**.
91-
- Click **Publish release**.
90+
- Replace the `0XY` anchor target above with a target appropriate for this
91+
release.
92+
- Remove the "New contributors" autogenerated text (if present) since we
93+
don't publish that as part of our release notes.
94+
- Select **Create a discussion for this release**.
95+
- Click **Publish release**.
9296
93-
[draft a new release]: https://github.com/google/docsy/releases/new
97+
[contribution guidelines]: https://www.docsy.dev/docs/contribution-guidelines/
98+
[Draft a new release]: https://github.com/google/docsy/releases/new
99+
[userguide/config.toml]: userguide/config.toml

assets/js/offline-search.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,8 @@
188188
});
189189
});
190190

191-
// Enable inline styles in popover.
192-
const whiteList = $.fn.tooltip.Constructor.Default.whiteList;
193-
whiteList['*'].push('style');
194-
195191
$targetSearchInput
196192
.data('content', $html[0].outerHTML)
197-
.popover({ whiteList: whiteList })
198193
.popover('show');
199194
};
200195
});

assets/scss/_main-container.scss

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@
2222

2323
.td-main {
2424
flex-grow: 1;
25+
}
2526

26-
main {
27-
@include media-breakpoint-up(md) {
28-
padding-top: 5.5rem;
29-
}
30-
31-
32-
padding-bottom: 2rem;
33-
}
27+
.td-404 main,
28+
.td-main main {
29+
padding-top: 1.5rem;
30+
padding-bottom: 2rem;
31+
@include media-breakpoint-up(md) { padding-top: 5.5rem; }
3432
}

config.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,11 @@ min = "0.73.0"
4848
[[module.mounts]]
4949
source = 'static'
5050
target = 'static'
51+
# Mounts for projects using Docsy as an NPM package. The source path prefix
52+
# "../.." moves out of themes/docsy so that Docsy can find its dependencies.
53+
[[module.mounts]]
54+
source = '../../node_modules/bootstrap'
55+
target = 'assets/vendor/bootstrap'
56+
[[module.mounts]]
57+
source = '../../node_modules/@fortawesome/fontawesome-free'
58+
target = 'assets/vendor/Font-Awesome'

layouts/404.html

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
{{ define "main"}}
2-
<main id="main">
3-
<div>
4-
<h1 id="title">Not found</h1>
5-
<p>Oops! This page doesn't exist. Try going back to our <a href="{{ "/" | relURL }}">home page</a>.</p>
6-
</div>
7-
</main>
8-
{{ end }}
1+
{{ define "main" -}}
2+
<div class="td-content">
3+
<h1>Not found</h1>
4+
<p>Oops! This page doesn't exist. Try going back to the <a href="{{ "" | relURL }}">home page</a>.</p>
5+
</div>
6+
{{- end }}

layouts/blog/list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{ define "main" }}
2-
{{ if .Parent.IsHome }}
2+
{{ if (and .Parent .Parent.IsHome) }}
33
{{ $.Scratch.Set "blog-pages" (where .Site.RegularPages "Section" .Section) }}
44
{{ else }}
55
{{$.Scratch.Set "blog-pages" .Pages }}

layouts/partials/head.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
{{ end -}}
3939

4040
{{ if .Site.Params.prism_syntax_highlighting -}}
41-
<link rel="stylesheet" href="{{ "/css/prism.css" | relURL }}"/>
41+
<link rel="stylesheet" href="{{ "css/prism.css" | relURL }}"/>
4242
{{ end -}}
4343

4444
{{ partial "hooks/head-end.html" . -}}

layouts/partials/scripts.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
crossorigin="anonymous"></script>
77

88
{{ if .Site.Params.mermaid.enable }}
9-
<script src="https://cdn.jsdelivr.net/npm/mermaid@8.13.4/dist/mermaid.min.js" integrity="sha512-JERecFUBbsm75UpkVheAuDOE8NdHjQBrPACfEQYPwvPG+fjgCpHAz1Jw2ci9EXmd3DdfiWth3O3CQvcfEg8gsA==" crossorigin="anonymous"></script>
9+
<script src="https://cdn.jsdelivr.net/npm/mermaid@9.1.3/dist/mermaid.min.js" integrity="sha512-E/owfVh8/U1xwhvIT4HSI064DRc1Eo/xf7AYax84rt9gVqA8tc/JNH/lvTl1tuw9PUHQIMGUtObkjYkgRjFqAA==" crossorigin="anonymous"></script>
1010
{{ end }}
1111

1212
{{ if .Site.Params.markmap.enable }}
@@ -24,11 +24,11 @@
2424
<script src="https://cdn.jsdelivr.net/npm/markmap-autoloader"></script>
2525
{{ end }}
2626

27-
<script src='{{ "/js/tabpane-persist.js" | relURL }}'></script>
27+
<script src='{{ "js/tabpane-persist.js" | relURL }}'></script>
2828

2929
<!-- load the deflate.js for plantuml support -->
3030
{{ if .Site.Params.plantuml.enable }}
31-
<script src='{{ "/js/deflate.js" | relURL }}'></script>
31+
<script src='{{ "js/deflate.js" | relURL }}'></script>
3232
{{ end }}
3333

3434
<!-- load stylesheet and scripts for KaTeX support -->
@@ -48,7 +48,7 @@
4848
{{ end }}
4949
<!-- To automatically render math in text elements, include the auto-render extension: -->
5050
<script defer src='https://cdn.jsdelivr.net/npm/katex@0.15.1/dist/contrib/auto-render.min.js'
51-
integrity='sha512-ZA/RPrAo88DlwRnnoNVqKINnQNcWERzRK03PDaA4GIJiVZvGFIWQbdWCsUebMZfkWohnfngsDjXzU6PokO4jGw==' crossorigin='anonymous'
51+
integrity='sha512-ZA/RPrAo88DlwRnnoNVqKINnQNcWERzRK03PDaA4GIJiVZvGFIWQbdWCsUebMZfkWohnfngsDjXzU6PokO4jGw==' crossorigin='anonymous'
5252
{{ printf "onload='renderMathInElement(%s, %s);'" (( .Site.Params.katex.html_dom_element | default "document.body" ) | safeJS ) ( printf "%s" ( $.Site.Params.katex.options | jsonify )) | safeHTMLAttr }}></script>
5353
{{ end }}
5454

@@ -71,6 +71,6 @@
7171
{{ end }}
7272
{{ if .Site.Params.prism_syntax_highlighting }}
7373
<!-- scripts for prism -->
74-
<script src='{{ "/js/prism.js" | relURL }}'></script>
74+
<script src='{{ "js/prism.js" | relURL }}'></script>
7575
{{ end }}
7676
{{ partial "hooks/body-end.html" . }}

layouts/swagger/baseof.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
{{ partial "head.html" . }}
55
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title }}{{ end }}</title>
6-
<link rel="stylesheet" type="text/css" href="{{ "/css/swagger-ui.css" | relURL }}">
6+
<link rel="stylesheet" type="text/css" href="{{ "css/swagger-ui.css" | relURL }}">
77
</head>
88
<body class="td-{{ .Kind }}">
99
<header>
@@ -22,8 +22,8 @@
2222
</aside>
2323
<main class="col-12 col-md-9 col-xl-8 pl-md-5" role="main">
2424
{{ if not .Site.Params.ui.breadcrumb_disable }}{{ partial "breadcrumb.html" . }}{{ end }}
25-
<script src="{{ "/js/swagger-ui-bundle.js" | relURL }}"></script>
26-
<script src="{{ "/js/swagger-ui-standalone-preset.js" | relURL }}"></script>
25+
<script src="{{ "js/swagger-ui-bundle.js" | relURL }}"></script>
26+
<script src="{{ "js/swagger-ui-standalone-preset.js" | relURL }}"></script>
2727
{{ block "main" . }}{{ end }}
2828
</main>
2929
</div>

0 commit comments

Comments
 (0)