Skip to content

Commit

Permalink
chore(website): bump hugo to latest version (#22018)
Browse files Browse the repository at this point in the history
feat: update components to work with latest version of hugo
  • Loading branch information
devindford authored Dec 11, 2024
1 parent df0fbc1 commit 68622bc
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 31 deletions.
56 changes: 28 additions & 28 deletions website/layouts/partials/css.html
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{{ $serverMode := site.IsServer }}
{{ $serverMode := hugo.IsServer }}
{{ $isHome := .IsHome }}
{{ $cssInputs := site.Params.css }}
{{ $includePaths := slice "node_modules" }}
{{ $devOpts := dict "includePaths" $includePaths "enableSourceMap" true }}
{{ $prodOpts := dict "includePaths" $includePaths "outputStyle" "compressed" }}
{{ $cssOpts := cond $serverMode $devOpts $prodOpts }}
{{ $postCssOpts := dict "inlineImports" true }}
{{ $devOpts := dict "includePaths" $includePaths "enableSourceMap" true }}
{{ $prodOpts := dict "includePaths" $includePaths "outputStyle" "compressed" }}
{{ $cssOpts := cond $serverMode $devOpts $prodOpts }}
{{ $postCssOpts := dict "inlineImports" true }}
{{ $ctx := . }}

{{ range $cssInputs }}
{{ $opts := merge $cssOpts (dict "targetPath" .output) }}

{{ $postProcess := .post_process }}
{{ $css := resources.Get .input | resources.ExecuteAsTemplate .input $ctx | toCSS $opts }}

{{ if .postcss }}
{{ $css = $css | postCSS $postCssOpts }}
{{ end }}

{{ if not (and (not $isHome) .home_page_only) }}
{{ if $serverMode }}
<link rel="stylesheet" href="{{ $css.RelPermalink }}">
{{ else }}
{{ $css = $css | fingerprint }}

{{ if $postProcess }}
{{ $css = $css | resources.PostProcess }}
{{ end }}

<link rel="stylesheet" href="{{ $css.RelPermalink }}" integrity="{{ $css.Data.Integrity }}">
{{ end }}
{{ end }}
{{ end }}
{{ $opts := merge $cssOpts (dict "targetPath" .output) }}
{{ $postProcess := .post_process }}
{{ $css := resources.Get .input | resources.ExecuteAsTemplate .input $ctx | toCSS $opts }}
{{ if .postcss }}
{{ $css = $css | postCSS $postCssOpts }}
{{ end }}
{{ if not (and (not $isHome) .home_page_only) }}
{{ if $serverMode }}
<link rel="stylesheet" href="{{ $css.RelPermalink }}">
{{ else }}
{{ $css = $css | fingerprint }}
{{ if $postProcess }}
{{ $css = $css | resources.PostProcess }}
{{ end }}
<link rel="stylesheet" href="{{ $css.RelPermalink }}" integrity="{{ $css.Data.Integrity }}">
{{ end }}
{{ end }}
{{ end }}
14 changes: 11 additions & 3 deletions website/layouts/shortcodes/jump.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
{{ $link := .Get 0 }}
{{ if not $link }}
{{ errorf "No page title specified" }}
{{ errorf "No page title specified" }}
{{ end }}

{{ $hash := .Get 1 }}

{{ $page := site.GetPage $link }}
{{/* Try both with and without leading slash for compatibility */}}
{{ $page := "" }}
{{ if hasPrefix $link "/" }}
{{ $page = site.GetPage (strings.TrimPrefix "/" $link) }}
{{ else }}
{{ $page = site.GetPage $link }}
{{ end }}

{{ if not $page }}
{{ errorf "Error in link shortcode at content/%s. No page found at %s." $.Page.File $link }}
{{ errorf "Error in jump shortcode at %s: No page found at %s. Please ensure the page exists and the path is correct." $.Page.File.Path $link }}
{{ end }}

<div class="jump">
<a href="{{ $link }}{{ with $hash }}#{{ . }}{{ end }}">
<div class="border dark:border-gray-700 rounded-md px-3.5 py-2 hover:border-secondary dark:hover:border-primary">
Expand Down

0 comments on commit 68622bc

Please sign in to comment.