Skip to content

Commit ca52456

Browse files
authored
Update docs publish (#91)
1 parent 4f3dbb3 commit ca52456

2 files changed

Lines changed: 22 additions & 14 deletions

File tree

.github/workflows/publish.yaml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,25 @@ jobs:
1616
- name: 📂 setup
1717
uses: actions/checkout@v2
1818

19-
- name: Use PSDocs
20-
shell: pwsh
21-
run: |-
22-
Install-Module PSDocs -MinimumVersion '0.9.0-B2102002' -AllowPrerelease -Force;
23-
Install-Module PSDocs.Azure -MinimumVersion '0.3.0' -AllowPrerelease -Force;
24-
Import-Module PSDocs.Azure;
25-
Get-AzDocTemplateFile -Path templates/ | ForEach-Object {
26-
# Generate a standard name of the markdown file. i.e. <name>_<version>.md
27-
$template = Get-Item -Path $_.TemplateFile;
28-
Invoke-PSDocument -Path .ps-docs/ -Module PSDocs.Azure -OutputPath docs/templates/ -InputObject $template.FullName -Convention 'AddMeta';
29-
}
19+
- name: Generate docs
20+
uses: microsoft/ps-docs@main
21+
with:
22+
conventions: AddMeta
23+
modules: PSDocs,PSDocs.Azure
24+
outputPath: docs/templates/
25+
prerelease: true
26+
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+
# }
3038

3139
- name: Setup Python
3240
uses: actions/setup-python@v2.2.2

.ps-docs/Conventions.Doc.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

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

89
# Get parent directory paths where <templateName>/v<version>/template.json
910
$version = $template.Directory.Name;
@@ -18,8 +19,7 @@ Export-PSDocumentConvention 'AddMeta' {
1819
}
1920
$PSDocs.Document.InstanceName = $docName;
2021

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

0 commit comments

Comments
 (0)