Skip to content

Commit

Permalink
docs: update version for non docs pages
Browse files Browse the repository at this point in the history
This sets the default version for all non docs pages to latest.

We have recently started to list some pages in the search index from non
docs pages, when a user makes a search, they search within the current
version. This will make pages from the rest of the site available in the
index when searching from 'latest'.

Signed-off-by: Charlie Egan <charlie@styra.com>
  • Loading branch information
charlieegan3 authored and ashutosh-narkar committed Jan 16, 2024
1 parent 2dbacae commit 89bb42b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/website/layouts/partials/meta.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
{{ $pageType := cond $isHome "website" "article" }}
{{ $imageUrl := "/img/logos/opa-horizontal-color.png" | absURL }}
{{ $twitter := site.Params.social.twitter }}
{{ $version := index (split .File.Path "/") 1 }}
{{ $version := "latest" }}
{{ if strings.HasPrefix .Permalink "/docs/" }}
{{ $version := index (split .File.Path "/") 1 }}
{{ end }}
{{ $page := trim .RelPermalink "/" }}
{{ $releases := site.Data.releases }}
{{ $latest := index $releases 1 }}
Expand Down

0 comments on commit 89bb42b

Please sign in to comment.