Skip to content

Commit 3753ff7

Browse files
authored
Reorganize SCSS, fix scroll padding, normalize blocks-shortcode heading IDs and keep old IDs as alias (google#2505)
1 parent 09b9a9f commit 3753ff7

22 files changed

Lines changed: 150 additions & 104 deletions

File tree

.vscode/cspell.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
"Gantt",
1414
"getenv",
1515
"GLFM",
16+
"gohugo",
17+
"gohugoio",
1618
"Goldydocs",
1719
"htmltest",
1820
"hugo",

AGENTS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,11 @@ project CI/CD, release process, etc.
1212
[project]: docsy.dev/content/en/project/_index.md
1313
[git-info.md]: docsy.dev/content/en/project/build/git-repo.md
1414

15+
## User guide
16+
17+
Enforce the [style guide][] when reviewing user guide additions or
18+
modifications.
19+
20+
[style guide]: docsy.dev/content/en/project/style-guide.md
21+
1522
<!-- cSpell:ignore docsy -->
Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
@import 'pageinfo';
3737
@import 'taxonomy';
3838
@import 'drawio';
39+
@import 'scroll';
3940
@import 'shortcodes';
4041
@import 'swagger';
4142
@import 'support/rtl';
@@ -44,30 +45,4 @@
4445
@import url($td-web-font-path);
4546
}
4647

47-
// Adjust anchors vs the fixed menu.
48-
@include media-breakpoint-up(md) {
49-
.td-offset-anchor:target {
50-
display: block;
51-
position: relative;
52-
top: -$td-navbar-min-height;
53-
visibility: hidden;
54-
}
55-
56-
h2[id]::before,
57-
h3[id]::before,
58-
h4[id]::before,
59-
h5[id]::before,
60-
h6[id]::before,
61-
.td-offset-anchor::before {
62-
$td-anchor-offset-delta: 1.5rem;
63-
display: block;
64-
content: ' ';
65-
margin-top: calc(
66-
-1 * #{$td-navbar-min-height} - #{$td-anchor-offset-delta}
67-
);
68-
height: calc(#{$td-navbar-min-height} + #{$td-anchor-offset-delta});
69-
visibility: hidden;
70-
}
71-
}
72-
7348
@import '../styles_project';

assets/scss/td/_scroll.scss

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Browser scroll padding
2+
3+
html,
4+
body {
5+
--td-anchor-offset-delta: 1.5rem;
6+
--td-scroll-padding-top: calc(
7+
#{$td-navbar-min-height} + var(--td-anchor-offset-delta)
8+
);
9+
10+
// Small viewports where the navbar is not fixed,
11+
// we still want a bit of padding:
12+
scroll-padding-top: var(--td-anchor-offset-delta);
13+
14+
// Wide viewports where the navbar is fixed.
15+
@include media-breakpoint-up(md) {
16+
scroll-padding-top: var(--td-scroll-padding-top);
17+
}
18+
}

docsy.dev/content/en/blog/2023/0.7.x.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ changes ([PR #221](https://github.com/google/docsy-example/pull/221)) were
155155
mainly confined to the landing page of each natural language:
156156

157157
- Utility-class renames, such as `.ml-*` and `.mr-*` to `.ms-*` and `.me-*`
158-
- [blocks/section](/docs/content/shortcodes/#blockssection) changes
158+
- [blocks/section](/docs/content/shortcodes/#blocks-section) changes
159159
([PR #1472](https://github.com/google/docsy/pull/1472)):
160160
- Language landing pages had to be renamed from `.html` to `.md` in support of
161161
using blocks shortcodes to render markdown content

docsy.dev/content/en/blog/2024/0.9.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ specifically:
204204
[#1841]: https://github.com/google/docsy/issues/1841
205205
[#1852]: https://github.com/google/docsy/issues/1852
206206
[#2]: https://github.com/google/docsy/issues/2
207-
[blocks/feature]: /docs/content/shortcodes/#blocksfeature
207+
[blocks/feature]: /docs/content/shortcodes/#blocks-feature
208208
[CL@0.9.0]: /project/about/changelog/#v0.9.0
209209
[functions]: https://gohugo.io/functions/
210210
[hook]: https://gohugo.io/templates/render-hooks/

docsy.dev/content/en/blog/2025/0.12.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ structure as follows:
139139
```
140140

141141
The following commands can help you move your custom layout files and folders
142-
<a name="move-layout-files"></a>:
142+
<a id="move-layout-files"></a>:
143143

144144
1. Move your custom layout files and folders:
145145

docsy.dev/content/en/blog/2025/0.13.0.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Release 0.13.0 report and upgrade guide
33
linkTitle: Release 0.13.0
44
date: 2025-11-24
5-
lastmod: 2026-01-30
5+
lastmod: 2026-02-02
66
author: >-
77
[Patrice Chalin](https://github.com/chalin) ([CNCF](https://www.cncf.io/)),
88
for the [Docsy Steering Committee](/blog/2022/hello/#introducing-the-psc)
@@ -44,7 +44,7 @@ Docsy [0.13.0] comes with the following notable features and fixes:
4444
- {{% _param FA universal-access "" %}} [Accessibility](#accessibility)
4545
enhancements for better color contrast and dark mode support
4646

47-
## Ready to upgrade?<a id="breaking-changes"></a> {#ready-to-upgrade}
47+
## Ready to upgrade? <a id="breaking-changes"></a> {#ready-to-upgrade}
4848

4949
- Review {{% _param BADGE BREAKING warning %}} changes:
5050
- {{% _param BREAKING %}} [Alert shortcode](#alert-shortcode) body content
@@ -282,6 +282,7 @@ Docsy 0.12.0][]: follow them, using version **0.13.0** where the guide refers to
282282
283283
- **Docsy**: [0.12.0] → [0.13.0]<br> Includes **Bootstrap**: 5.3.65.3.8
284284
- **Hugo**: 0.147.50.152.2&nbsp;[^vers-note]
285+
> [!NB] See [Hugo 0.152.0 **breaking changes**][hugo-0.152.0].
285286
- **Node**: LTS 22 → LTS 24&nbsp;[^vers-note]
286287
287288
[^vers-note]:
@@ -342,8 +343,9 @@ About this release:
342343
Other references:
343344
344345
- [0.12.0 upgrade guide][]
345-
- For Hugo upgrade considerations when moving from 0.147.5 to 0.152.2, see the
346-
[Hugo release notes](https://github.com/gohugoio/hugo/releases).
346+
- For Hugo upgrade considerations when moving from 0.147.5 to 0.152.2, see:
347+
- [Hugo 0.152.0 breaking changes][hugo-0.152.0], our companion post
348+
- The official [Hugo release notes](https://github.com/gohugoio/hugo/releases)
347349
348350
[#349]: https://github.com/google/docsy/issues/349
349351
[#941]: https://github.com/google/docsy/pull/941
@@ -358,5 +360,6 @@ Other references:
358360
[CL@0.13.0]: /project/about/changelog/#v0.13.0
359361
[Upgrade to Docsy 0.12.0]: /blog/2025/0.12.0/
360362
[0.12.0 upgrade guide]: /blog/2025/0.12.0/
363+
[hugo-0.152.0]: /blog/2026/hugo-0.152.0+/#0.152.0
361364
362365
> [!NB] **Last updated** {{% param lastmod %}}

0 commit comments

Comments
 (0)