Skip to content

Commit 2402c17

Browse files
committed
add release notes proposal
1 parent 23671b0 commit 2402c17

2 files changed

Lines changed: 84 additions & 17 deletions

File tree

docs/layouts/_partials/header/header.html

Lines changed: 65 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,32 @@ <h5 class="offcanvas-title" id="offcanvasNavMainLabel">{{ site.Title }}</h5>
125125
</div>
126126
<div class="offcanvas-body d-flex flex-column flex-lg-row align-items-center">
127127
<!-- Site title — linked to home -->
128-
<a href="/" class="d-flex align-items-center text-decoration-none">
129-
<img src="/svgs/logo-lightmode.svg" class="logo-lightmode" alt="DefectDojo" width="184" />
130-
<img src="/svgs/logo-darkmode.svg" class="logo-darkmode" alt="DefectDojo" width="184" />
131-
<span class="ms-2 text-bs-body fw-bold">| docs</span>
132-
</a>
128+
{{ $url := "https://api.github.com/repos/DefectDojo/django-DefectDojo/releases/latest" }}
129+
{{ $resource := resources.GetRemote $url }}
130+
{{ $releaseName := "" }}
131+
{{ if $resource }}
132+
{{ $release := $resource | transform.Unmarshal | default dict }}
133+
{{ if $release.name }}
134+
{{ $releaseName = $release.name }}
135+
{{ else }}
136+
{{ printf "⚠️ Could not parse release name (not valid JSON or missing field)\n" | warnf }}
137+
{{ printf "Media Type: %s\n" $resource.MediaType | warnf }}
138+
{{ $contentPreview := substr $resource.Content 0 500 }}
139+
{{ printf "Content Preview (first 500 chars):\n%s\n" $contentPreview | warnf }}
140+
{{ end }}
141+
{{ else }}
142+
{{ printf "❌ Release Notes Fetch failed from: %s\n" $url | warnf }}
143+
{{ end }}
144+
<div class="d-flex align-items-center">
145+
<a href="/" class="d-flex align-items-center text-decoration-none">
146+
<img src="/svgs/logo-lightmode.svg" class="logo-lightmode" alt="DefectDojo" width="184" />
147+
<img src="/svgs/logo-darkmode.svg" class="logo-darkmode" alt="DefectDojo" width="184" />
148+
<span class="ms-2 text-bs-body fw-bold">| docs</span>
149+
</a>
150+
{{ if $releaseName }}
151+
<a href="/releases/pro/changelog/" class="badge rounded-pill text-bg-primary fw-normal text-decoration-none ms-2 d-none d-lg-inline-flex">{{ $releaseName | htmlEscape }} | changelog</a>
152+
{{ end }}
153+
</div>
133154

134155
<!-- Spacer -->
135156
<div class="flex-grow-1 d-none d-lg-block"></div>
@@ -236,8 +257,8 @@ <h5 class="offcanvas-title" id="offcanvasNavMainLabel">{{ site.Title }}</h5>
236257
{{ partial "main/showFlexSearch" . }}
237258
{{ $showFlexSearch := .Scratch.Get "showFlexSearch" -}}
238259
{{ if $showFlexSearch -}}
239-
<button type="button" id="searchToggleDesktop" class="btn btn-link nav-link d-none d-lg-flex align-items-center me-2"
240-
aria-label="Search website">
260+
<button type="button" id="searchToggleDesktop"
261+
class="btn btn-link nav-link d-none d-lg-flex align-items-center me-2" aria-label="Search website">
241262
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-search me-1" width="16"
242263
height="16" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none"
243264
stroke-linecap="round" stroke-linejoin="round">
@@ -252,8 +273,8 @@ <h5 class="offcanvas-title" id="offcanvasNavMainLabel">{{ site.Title }}</h5>
252273

253274
<!-- DocSearch desktop -->
254275
{{ if site.Params.add_ons.docSearch -}}
255-
<button type="button" id="searchToggleDesktop" class="btn btn-link nav-link d-none d-lg-flex align-items-center me-2"
256-
aria-label="Search website">
276+
<button type="button" id="searchToggleDesktop"
277+
class="btn btn-link nav-link d-none d-lg-flex align-items-center me-2" aria-label="Search website">
257278
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-search me-1" width="16"
258279
height="16" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none"
259280
stroke-linecap="round" stroke-linejoin="round">
@@ -289,17 +310,44 @@ <h5 class="offcanvas-title" id="offcanvasNavMainLabel">{{ site.Title }}</h5>
289310

290311
<!-- Social links — Tabler stroke icons -->
291312
<div class="d-none d-lg-flex align-items-center header-social-links ms-lg-2">
292-
<a class="nav-link social-link" href="https://github.com/DefectDojo/django-DefectDojo" aria-label="GitHub" rel="noopener">
293-
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M9 19c-4.3 1.4 -4.3 -2.5 -6 -3m12 5v-3.5c0 -1 .1 -1.4 -.5 -2c2.8 -.3 5.5 -1.4 5.5 -6a4.6 4.6 0 0 0 -1.3 -3.2a4.2 4.2 0 0 0 -.1 -3.2s-1.1 -.3 -3.5 1.3a12.3 12.3 0 0 0 -6.2 0c-2.4 -1.6 -3.5 -1.3 -3.5 -1.3a4.2 4.2 0 0 0 -.1 3.2a4.6 4.6 0 0 0 -1.3 3.2c0 4.6 2.7 5.7 5.5 6c-.6 .6 -.6 1.2 -.5 2v3.5"></path></svg>
313+
<a class="nav-link social-link" href="https://github.com/DefectDojo/django-DefectDojo"
314+
aria-label="GitHub" rel="noopener">
315+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" stroke-width="2"
316+
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
317+
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
318+
<path
319+
d="M9 19c-4.3 1.4 -4.3 -2.5 -6 -3m12 5v-3.5c0 -1 .1 -1.4 -.5 -2c2.8 -.3 5.5 -1.4 5.5 -6a4.6 4.6 0 0 0 -1.3 -3.2a4.2 4.2 0 0 0 -.1 -3.2s-1.1 -.3 -3.5 1.3a12.3 12.3 0 0 0 -6.2 0c-2.4 -1.6 -3.5 -1.3 -3.5 -1.3a4.2 4.2 0 0 0 -.1 3.2a4.6 4.6 0 0 0 -1.3 3.2c0 4.6 2.7 5.7 5.5 6c-.6 .6 -.6 1.2 -.5 2v3.5">
320+
</path>
321+
</svg>
294322
</a>
295-
<a class="nav-link social-link" href="https://www.linkedin.com/company/defectdojo/" aria-label="LinkedIn" rel="noopener">
296-
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"/><path d="M8 11l0 5"/><path d="M8 8l0 .01"/><path d="M12 16l0 -5"/><path d="M16 16v-3a2 2 0 0 0 -4 0"/></svg>
323+
<a class="nav-link social-link" href="https://www.linkedin.com/company/defectdojo/"
324+
aria-label="LinkedIn" rel="noopener">
325+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" stroke-width="2"
326+
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
327+
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
328+
<path d="M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z" />
329+
<path d="M8 11l0 5" />
330+
<path d="M8 8l0 .01" />
331+
<path d="M12 16l0 -5" />
332+
<path d="M16 16v-3a2 2 0 0 0 -4 0" />
333+
</svg>
297334
</a>
298-
<a class="nav-link social-link" href="https://www.youtube.com/@defectdojo" aria-label="YouTube" rel="noopener">
299-
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M2 8a4 4 0 0 1 4 -4h12a4 4 0 0 1 4 4v8a4 4 0 0 1 -4 4h-12a4 4 0 0 1 -4 -4v-8z"/><path d="M10 9l5 3l-5 3z"/></svg>
335+
<a class="nav-link social-link" href="https://www.youtube.com/@defectdojo" aria-label="YouTube"
336+
rel="noopener">
337+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" stroke-width="2"
338+
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
339+
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
340+
<path d="M2 8a4 4 0 0 1 4 -4h12a4 4 0 0 1 4 4v8a4 4 0 0 1 -4 4h-12a4 4 0 0 1 -4 -4v-8z" />
341+
<path d="M10 9l5 3l-5 3z" />
342+
</svg>
300343
</a>
301344
<a class="nav-link social-link" href="https://x.com/defectdojo" aria-label="X" rel="noopener">
302-
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 4l11.733 16h4.267l-11.733 -16z"></path><path d="M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772"></path></svg>
345+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" stroke-width="2"
346+
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
347+
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
348+
<path d="M4 4l11.733 16h4.267l-11.733 -16z"></path>
349+
<path d="M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772"></path>
350+
</svg>
303351
</a>
304352
</div>
305353
</div>
@@ -368,4 +416,4 @@ <h5 class="offcanvas-title" id="offcanvasNavMainLabel">{{ site.Title }}</h5>
368416
<!-- Search modal -->
369417
{{ if site.Params.doks.flexSearch -}}
370418
{{ partial "header/search-modal" . }}
371-
{{ end -}}
419+
{{ end -}}

docs/layouts/home.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
{{ define "main" }}
2+
{{ $url := "https://api.github.com/repos/DefectDojo/django-DefectDojo/releases/latest" }}
3+
{{ $resource := resources.GetRemote $url }}
4+
{{ $releaseName := "" }}
5+
{{ if $resource }}
6+
{{ $release := $resource | transform.Unmarshal | default dict }}
7+
{{ if $release.name }}
8+
{{ $releaseName = $release.name }}
9+
{{ else }}
10+
{{ printf "⚠️ Could not parse release name (not valid JSON or missing field)\n" | warnf }}
11+
{{ printf "Media Type: %s\n" $resource.MediaType | warnf }}
12+
{{ $contentPreview := substr $resource.Content 0 500 }}
13+
{{ printf "Content Preview (first 500 chars):\n%s\n" $contentPreview | warnf }}
14+
{{ end }}
15+
{{ else }}
16+
{{ printf "❌ Release Notes Fetch failed from: %s\n" $url | warnf }}
17+
{{ end }}
218
<section class="hero-section">
319
<div class="container">
420
<div class="row justify-content-center">
@@ -13,6 +29,9 @@ <h1 class="hero-title">{{ .Title }}</h1>
1329
<a class="btn btn-primary rounded-pill btn-lg" href="{{ if site.Params.doks.docsVersioning }}{{ site.Params.doks.docsVersion }}/{{ end }}/get_started/about/about_defectdojo/" role="button">Get Started</a>
1430
<a class="btn btn-outline-secondary rounded-pill btn-lg ms-2" href="/supported_tools/" role="button">Supported Tools</a>
1531
</div>
32+
{{ if $releaseName }}
33+
<p class="mt-3 mb-0"><a href="/releases/pro/changelog/" class="text-muted">What's new in {{ $releaseName | htmlEscape }} →</a></p>
34+
{{ end }}
1635
{{ .Content }}
1736
</div>
1837
</div>

0 commit comments

Comments
 (0)