Skip to content
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

Misc corrections for parallel PDF build changes #6406

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
- name: Gatsby build
run: npm run build
env:
APP_ENV: ${{ inputs.ref == 'main' && 'production' || 'staging' }}
APP_ENV: ${{ inputs.ref == 'refs/heads/main' && 'production' || 'staging' }}
NODE_ENV: ${{ vars.NODE_ENV }}
NODE_OPTIONS: --max-old-space-size=4096
FATHOM_SITE_ID: ${{ vars.FATHOM_SITE_ID }}
Expand Down
1 change: 1 addition & 0 deletions advocacy_docs/edb-postgres-ai/cloud-service/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ navTitle: Cloud Service
description: An introduction to the EDB Postgres AI Cloud Service and its features.
directoryDefaults:
displayBanner: "Notice: EDB will no longer offer the  Hosted Cloud Service option for new customers. However, support will remain available for existing customers of the EDB Hosted plan. The associated documentation topics will soon be removed, and updates regarding the removal process will be shared as they become available. The 'Your Cloud Account' option will continue to be available."
product: "EDB Postgres AI Cloud Service"
navigation:
- getting_started
- using_cluster
Expand Down
1 change: 0 additions & 1 deletion product_docs/docs/net_connector/4.0.10.1/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ legacyRedirectsGenerated:
- "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.10.1/genindex.html"
- "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.10.1/whats_new.html"
- "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.10.1/index.html"
pdf: true
---

<StubCards product='net_connector' version='4.0.10.1' />
1 change: 0 additions & 1 deletion product_docs/docs/net_connector/4.0.6.1/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ legacyRedirectsGenerated:
- "/edb-docs/p/edb-postgres-net-connector/4.0.6.1"
- "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.6.1/genindex.html"
- "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.6.1/index.html"
pdf: true
---

<StubCards product='net_connector' version='4.0.6.1' />
1 change: 0 additions & 1 deletion product_docs/docs/net_connector/4.1.3.1/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ legacyRedirectsGenerated:
- "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.3.1/genindex.html"
- "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.3.1/conclusion.html"
- "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.3.1/index.html"
pdf: true
---

<StubCards product='net_connector' version='4.1.3.1' />
1 change: 0 additions & 1 deletion product_docs/docs/net_connector/4.1.5.1/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ legacyRedirectsGenerated:
- "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.5.1/genindex.html"
- "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.5.1/conclusion.html"
- "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.5.1/index.html"
pdf: true
---

<StubCards product='net_connector' version='4.1.5.1' />
12 changes: 7 additions & 5 deletions scripts/pdf/generate_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ def main(args):
def setup(args):
doc_path = args.doc_path
index_meta = load_index_metadata(doc_path)
product = index_meta.get("product", None) or doc_path.parts[-2] if len(doc_path.parts) >= 4 else doc_path.parts[-1]
version = index_meta.get("version", None) or doc_path.parts[-1] if len(doc_path.parts) >= 4 else ''
directoryDefaults = index_meta.get("directoryDefaults", None) or {}
product = directoryDefaults.get("product", None) or index_meta.get("product", None) or (doc_path.parts[-2] if len(doc_path.parts) >= 4 else doc_path.parts[-1])
version = directoryDefaults.get("version", None) or index_meta.get("version", None) or (doc_path.parts[-1] if len(doc_path.parts) >= 4 else '')

_file_prefix = product + (version and "_v" + version or "") + "_documentation"

Expand Down Expand Up @@ -199,7 +200,7 @@ def hash_check(pdf_file, pdf_hash_file, mdx_file):
if pdf_file.exists() and newHash == existingHash:
return True

pdf_file.unlink()
pdf_file.unlink(missing_ok=True)
pdf_hash_file.write_text(newHash)
return False

Expand Down Expand Up @@ -270,8 +271,9 @@ def parse_mdx(mdx_file):

def load_index_metadata(path):
try:
indexMeta = frontmatter.load(path / "index.mdx")
return indexMeta
with open(path / "index.mdx") as indexFile:
indexMeta, content = frontmatter.parse(indexFile.read())
return indexMeta
except (FileNotFoundError):
return {}

Expand Down
Loading