Skip to content

Commit ab4d8c4

Browse files
authored
Fix docs metadata (#92)
1 parent ca52456 commit ab4d8c4

2 files changed

Lines changed: 1 addition & 15 deletions

File tree

.github/workflows/publish.yaml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,10 @@ jobs:
1919
- name: Generate docs
2020
uses: microsoft/ps-docs@main
2121
with:
22-
conventions: AddMeta
2322
modules: PSDocs,PSDocs.Azure
2423
outputPath: docs/templates/
2524
prerelease: true
2625

27-
# - name: Use PSDocs
28-
# shell: pwsh
29-
# run: |-
30-
# Install-Module PSDocs -MinimumVersion '0.9.0-B2102002' -AllowPrerelease -Force;
31-
# Install-Module PSDocs.Azure -MinimumVersion '0.3.0' -AllowPrerelease -Force;
32-
# Import-Module PSDocs.Azure;
33-
# Get-AzDocTemplateFile -Path templates/ | ForEach-Object {
34-
# # Generate a standard name of the markdown file. i.e. <name>_<version>.md
35-
# $template = Get-Item -Path $_.TemplateFile;
36-
# Invoke-PSDocument -Path .ps-docs/ -Module PSDocs.Azure -OutputPath docs/templates/ -InputObject $template.FullName -Convention 'AddMeta';
37-
# }
38-
3926
- name: Setup Python
4027
uses: actions/setup-python@v2.2.2
4128
with:

.ps-docs/Conventions.Doc.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
# Synopsis: Add metadata for Jekyll
55
Export-PSDocumentConvention 'AddMeta' {
6-
# $template = Get-Item -Path $PSDocs.TargetObject;
76
$template = Get-Item -Path $PSDocs.Source.FullName;
87

98
# Get parent directory paths where <templateName>/v<version>/template.json
@@ -19,7 +18,7 @@ Export-PSDocumentConvention 'AddMeta' {
1918
}
2019
$PSDocs.Document.InstanceName = $docName;
2120

22-
$metadata = Get-Content -Path $template.FullName -Raw | ConvertFrom-Json | GetTemplateMetadata -Path $template.FullName;
21+
$metadata = $PSDocs.TargetObject | GetTemplateMetadata -Path $template.FullName;
2322
$Document.Metadata['title'] = $version;
2423
$Document.Metadata['parent'] = $metadata.name;
2524
$Document.Metadata['grand_parent'] = 'Templates'

0 commit comments

Comments
 (0)