Skip to content

Commit

Permalink
Add apisets to page title
Browse files Browse the repository at this point in the history
  • Loading branch information
learn-more committed Dec 13, 2023
1 parent 2097191 commit c419857
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ indent_style = space
indent_size = 4
end_of_line = lf

[*.{html,toml,md}]
[*.{html,toml,md,py}]
end_of_line = crlf


Expand Down
2 changes: 1 addition & 1 deletion content/apisetschemas/_autogenerated_001.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

---
# This file is auto-generated by a script
title: "Win7-x64"
title: "Win7-x64 apisets"
slug: "06.1.7601.23455-amd64"
weight: 1
---
Expand Down
2 changes: 1 addition & 1 deletion content/apisetschemas/_autogenerated_002.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

---
# This file is auto-generated by a script
title: "Win7-x86"
title: "Win7-x86 apisets"
slug: "06.1.7601.23455-i386"
weight: 2
---
Expand Down
2 changes: 1 addition & 1 deletion content/apisetschemas/_autogenerated_003.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

---
# This file is auto-generated by a script
title: "Win8-x64"
title: "Win8-x64 apisets"
slug: "06.2.9200.16384-amd64"
weight: 3
---
Expand Down
2 changes: 1 addition & 1 deletion content/apisetschemas/_autogenerated_004.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

---
# This file is auto-generated by a script
title: "Win8-x86"
title: "Win8-x86 apisets"
slug: "06.2.9200.16384-i386"
weight: 4
---
Expand Down
2 changes: 1 addition & 1 deletion content/apisetschemas/_autogenerated_005.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

---
# This file is auto-generated by a script
title: "Win8.1-x64"
title: "Win8.1-x64 apisets"
slug: "06.3.9600.16384-amd64"
weight: 5
---
Expand Down
2 changes: 1 addition & 1 deletion content/apisetschemas/_autogenerated_006.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

---
# This file is auto-generated by a script
title: "Win10-x64"
title: "Win10-x64 apisets"
slug: "10.0.19041.1-AMD64"
weight: 6
---
Expand Down
2 changes: 1 addition & 1 deletion content/apisetschemas/_autogenerated_007.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

---
# This file is auto-generated by a script
title: "Win11-x64"
title: "Win11-x64 apisets"
slug: "10.0.22621.2506-amd64"
weight: 7
---
Expand Down
2 changes: 1 addition & 1 deletion layouts/shortcodes/apisetschema_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<ul>
<li><a href="{{ "apisetschemas/" | absURL }}">All versions in one table</a></li></li>
{{ range $.Site.RegularPages }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
<li><a href="{{ .RelPermalink }}">{{ .Title }} apisets</a></li>
{{ end }}
</ul>
10 changes: 5 additions & 5 deletions scripts/hugo_pages_from_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
HUGO_TEMPLATE = """
---
# This file is auto-generated by a script
title: "{name}"
title: "{name} apisets"
slug: "{version}"
weight: {weight}
---
{{{{< {template} >}}}}
{{{{< apisetschema >}}}}
"""

Expand All @@ -42,7 +42,7 @@ def read_name(filename):
data = json.load(filename)
return data['Version']

def write_templates(data_dir, template_dir, template):
def write_templates(data_dir, template_dir):
sources = sorted_datafiles(data_dir)
weight = 1
template_dir.mkdir(parents=True, exist_ok=True)
Expand All @@ -51,7 +51,7 @@ def write_templates(data_dir, template_dir, template):
data_file = data_dir / (source + '.json')
name = read_name(data_file.open('r'))
with open(template_dir / filename, 'w') as markdown_file:
markdown_file.write(HUGO_TEMPLATE.format(name=name, version=source, weight=weight, template=template))
markdown_file.write(HUGO_TEMPLATE.format(name=name, version=source, weight=weight))
weight += 1


Expand All @@ -62,7 +62,7 @@ def pages_from_schemas(apisetschema_data_dir, schema_content_dir):
filename.unlink()

# Create new apisetschema pages
write_templates(apisetschema_data_dir, schema_content_dir, 'apisetschema')
write_templates(apisetschema_data_dir, schema_content_dir)
print('Done')


Expand Down

0 comments on commit c419857

Please sign in to comment.