Skip to content

Commit

Permalink
Misc corrections:
Browse files Browse the repository at this point in the history
- Fix paths for PDF generation
- Specify product name for cloud service
- Don't no-index main!
- Exclude stub products
  • Loading branch information
josh-heyer committed Jan 14, 2025
1 parent 5d94362 commit 26b4fd7
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
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' />
13 changes: 9 additions & 4 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 @@ -196,6 +197,9 @@ def hash_check(pdf_file, pdf_hash_file, mdx_file):
with mdx_file.open(mode="rb") as output:
newHash = hashlib.file_digest(output, "md5").hexdigest()

print("existingHash='" + existingHash + "'")
print("newHash='" + newHash + "'")

if pdf_file.exists() and newHash == existingHash:
return True

Expand Down Expand Up @@ -270,8 +274,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

0 comments on commit 26b4fd7

Please sign in to comment.