Skip to content

Commit

Permalink
broken links
Browse files Browse the repository at this point in the history
Signed-off-by: Frederic BIDON <[email protected]>
  • Loading branch information
fredbi committed Mar 17, 2024
1 parent 5ba4475 commit 9f2048c
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/update-doc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
name: Prepare config
run: |
# Builds a commit-dependant extra config to inject parameterization.
# HUGO doesn't support config from the command line or from environment.
# HUGO doesn't support config from the command line.
#
# Set go-swagger specific parameters that are used in some parameterized documents
# This is used to keep up-to-date installation instructions.
Expand All @@ -79,7 +79,7 @@ jobs:
--printPathWarnings
--ignoreCache
--noBuildLock
--verbose
--logLevel info
--source ${{ github.workspace }}/hack/doc-site/hugo"
-
Expand Down
2 changes: 1 addition & 1 deletion docs/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ There are essentially two ways along which your API and its documentation tend t
We all want to remove the repetitive nature of writing what is essentially boilerplate,
and achieve faster iteration times.

This toolkit helps achieve this objective with both approaches.
This toolkit helps you achieve these objectives with both approaches.

## Design-first approach

Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ You are welcome to clone this repo and start helping the `go-openapi` community:
git clone https://github.com/go-swagger/go-swagger
```

Have an idea? A problem? Engage the conversation on our [![Slack channel](../slack.png) Slack channel](https://goswagger.slack.com)
Have an idea? A problem? Engage the conversation on our [![Slack logo](../slack.png) Slack channel](https://goswagger.slack.com)
15 changes: 9 additions & 6 deletions hack/doc-site/hugo/hugo.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
title: go-swagger
theme: hugo-book

markup:
goldmark:
renderHooks:
link:
enableDefault: true
#markup:
# goldmark:
# renderHooks:
# image:
# enableDefault: true
# link:
# enableDefault: true

enableEmoji: true

baseURL: https://fredbi.github.io/go-swagger
Expand Down Expand Up @@ -147,7 +150,7 @@ params:
# (Optional, experimental, default false) Enables portable links and link checks in markdown pages.
# Portable links meant to work with text editors and let you write markdown without {{< relref >}} shortcode
# Theme will print warning if page referenced in markdown does not exists.
BookPortableLinks: true
BookPortableLinks: false

# /!\ This is an experimental feature, might be removed or changed at any time
# (Optional, experimental, default false) Enables service worker that caches visited pages and resources for offline use.
Expand Down
15 changes: 15 additions & 0 deletions hack/doc-site/hugo/layouts/_default/_markup/render-image.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- $u := urls.Parse .Destination -}}
{{- $src := $u.String -}}
{{- if not $u.IsAbs -}}
{{- with or (.Page.Resources.Get $u.Path) (resources.Get $u.Path) -}}
{{- $src = .RelPermalink -}}
{{- end -}}
{{- end -}}
{{- $attributes := merge .Attributes (dict "alt" .Text "src" $src "title" .Title) -}}
<img
{{- range $k, $v := $attributes -}}
{{- if $v -}}
{{- printf " %s=%q" $k $v | safeHTMLAttr -}}
{{- end -}}
{{- end -}}>
{{- /**/ -}}
28 changes: 28 additions & 0 deletions hack/doc-site/hugo/layouts/_default/_markup/render-link.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{- $u := urls.Parse .Destination -}}
{{- $href := $u.String -}}
{{- if strings.HasPrefix $u.String "#" }}
{{- $href = printf "%s#%s" .Page.RelPermalink $u.Fragment }}
{{- else if not $u.IsAbs -}}
{{- with or
($.Page.GetPage $u.Path)
($.Page.Resources.Get $u.Path)
(resources.Get $u.Path)
-}}
{{- $href = .RelPermalink -}}
{{- with $u.RawQuery -}}
{{- $href = printf "%s?%s" $href . -}}
{{- end -}}
{{- with $u.Fragment -}}
{{- $href = printf "%s#%s" $href . -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- $attributes := dict "href" $href "title" .Title -}}
<a
{{- range $k, $v := $attributes -}}
{{- if $v -}}
{{- printf " %s=%q" $k $v | safeHTMLAttr -}}
{{- end -}}
{{- end -}}
>{{ .Text | safeHTML }}</a>
{{- /**/ -}}

0 comments on commit 9f2048c

Please sign in to comment.