fix: Remove broken PDF download fallback, use explicit download_formats
The sidebar download button was assuming every document had a PDF at
/downloads/{slug}.pdf, causing 404s for 70 documents where the slug
didn't match a file (or no PDF existed). Now only shows download
buttons when download_formats.pdf is explicitly set in MongoDB.
Corresponding migration populated download_formats.pdf for 72 documents
that have actual PDF files on disk.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
626b684a21
commit
8e7a65c79a
1 changed files with 0 additions and 15 deletions
|
|
@ -506,14 +506,6 @@ function renderDocLink(doc, isHighlighted = false) {
|
|||
if (doc.download_formats && doc.download_formats.pdf) {
|
||||
pdfPath = doc.download_formats.pdf;
|
||||
hasPDF = true;
|
||||
} else if (!doc.slug.includes('api-reference-complete') &&
|
||||
!doc.slug.includes('openapi-specification') &&
|
||||
!doc.slug.includes('api-javascript-examples') &&
|
||||
!doc.slug.includes('api-python-examples') &&
|
||||
!doc.slug.includes('technical-architecture-diagram')) {
|
||||
// Fallback to default /downloads/ path for documents that typically have PDFs
|
||||
pdfPath = `/downloads/${doc.slug}.pdf`;
|
||||
hasPDF = true;
|
||||
}
|
||||
|
||||
// Add download button styling
|
||||
|
|
@ -963,13 +955,6 @@ async function loadDocument(slug, lang = null) {
|
|||
if (currentDocument.download_formats && currentDocument.download_formats.pdf) {
|
||||
pdfPath = currentDocument.download_formats.pdf;
|
||||
hasPDF = true;
|
||||
} else if (!currentDocument.slug.includes('api-reference-complete') &&
|
||||
!currentDocument.slug.includes('openapi-specification') &&
|
||||
!currentDocument.slug.includes('api-javascript-examples') &&
|
||||
!currentDocument.slug.includes('api-python-examples') &&
|
||||
!currentDocument.slug.includes('technical-architecture-diagram')) {
|
||||
pdfPath = `/downloads/${currentDocument.slug}.pdf`;
|
||||
hasPDF = true;
|
||||
}
|
||||
|
||||
let headerHTML = `
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue