Skip to content

Commit

Permalink
Merge pull request #1052 from szarnyasg/archive-installation-page
Browse files Browse the repository at this point in the history
Archive installation page
  • Loading branch information
szarnyasg authored Aug 26, 2023
2 parents 28ca261 + 1079238 commit 4670e01
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions scripts/archive_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,34 @@ def recursive_copy(source, target, version):
recursive_copy(source_path, target_path, version)


def archive_installation_page(version):
# get frontmatter of the proxy installation file (which includes the actual one)
with open(f"docs/installation/index.html") as current_installation_file:
current_installation_file_loaded = frontmatter.load(current_installation_file)
current_installation_file_loaded.content = ""

# adjust installation links to point to the old version in the archived page
with open(f"_includes/installation.html") as main_installation_file, open(
f"docs/archive/{version}/installation/index.html", "w"
) as archived_installation_file:
installation_page = main_installation_file.read()
installation_page = installation_page.replace(" (Latest Release)", "")
installation_page = installation_page.replace(
"{{ site.currentduckdbversion }}", version
)
# we leave the variable "{{ site.nextjavaversion }}" as is
# to allow the "GitHub main (Bleeding Edge)" to move with new versions

archived_installation_file.write(
frontmatter.dumps(current_installation_file_loaded)
)
archived_installation_file.write(installation_page)


recursive_copy('docs', folder, version)
copy_file(
'_data/menu_docs_dev.json',
'_data/menu_docs_%s.json' % (version.replace('.', ''),),
version,
)
archive_installation_page(version)

0 comments on commit 4670e01

Please sign in to comment.