-
Notifications
You must be signed in to change notification settings - Fork 338
Add Vary: Accept header and document nginx content negotiation config #3548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
b7b3fe1
951b34e
d92baf2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| {{- /* AI-friendly JSON output for the home page */ -}} | ||
|
|
||
| {{- $content := partial "process-markdown-content.html" (dict "RawContent" .RawContent "Site" .Site "Page" .) -}} | ||
|
|
||
| {{- $summary := (.Params.description | default .Description) | plainify | replaceRE "\\s+" " " | strings.TrimSpace -}} | ||
| {{- $tags := .Params.categories | default (slice) -}} | ||
| {{- $lastUpdated := .Lastmod.Format "2006-01-02T15:04:05Z07:00" -}} | ||
|
|
||
| {{- $children := slice -}} | ||
| {{- range .Pages -}} | ||
| {{- $childId := "" -}} | ||
| {{- with .File -}} | ||
| {{- $baseName := .ContentBaseName -}} | ||
| {{- if or (not $baseName) (eq $baseName "_index") -}} | ||
| {{- $childId = $.Title | urlize -}} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wrong child id in loopMedium Severity In the Reviewed by Cursor Bugbot for commit d92baf2. Configure here. |
||
| {{- else -}} | ||
| {{- $childId = $baseName | urlize -}} | ||
| {{- end -}} | ||
| {{- else -}} | ||
| {{- $childId = .Title | urlize -}} | ||
| {{- end -}} | ||
| {{- $childSummary := (.Params.description | default .Description) | plainify | replaceRE "\\s+" " " | strings.TrimSpace -}} | ||
| {{- $child := dict "id" $childId "title" .Title "url" .Permalink "summary" $childSummary -}} | ||
| {{- $children = $children | append $child -}} | ||
| {{- end -}} | ||
|
|
||
| { | ||
| "id": "home", | ||
| "title": {{ .Title | jsonify }}, | ||
| "url": {{ .Permalink | jsonify }}, | ||
| "summary": {{ $summary | jsonify }}, | ||
| "content": {{ $content | jsonify }}, | ||
| "tags": {{ $tags | jsonify }}, | ||
| "last_updated": {{ $lastUpdated | jsonify }}, | ||
| "children": {{ $children | jsonify }} | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # {{ .Title }} | ||
|
|
||
| ```json metadata | ||
| { | ||
| "title": {{ .Title | jsonify }}, | ||
| "description": {{ (.Params.description | default .Description) | plainify | replaceRE "\\s+" " " | strings.TrimSpace | jsonify }}, | ||
| "categories": {{ .Params.categories | jsonify }}, | ||
| "tableOfContents": {{ partial "toc-from-markdown.html" . }}, | ||
| "codeExamples": {{ partial "code-examples-json.html" . }} | ||
| } | ||
| ``` | ||
|
|
||
| {{- /* Process content with shared partial (shortcode expansion, HTML unescaping, etc.) */ -}} | ||
| {{- $content := partial "process-markdown-content.html" (dict "RawContent" .RawContent "Site" .Site "Page" .) -}} | ||
|
|
||
| {{ $content }} |


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is outdated now