Skip to content

Commit f555b60

Browse files
author
James Brundage
committed
fix: PSJekyll.Template.Include.PSAlias ( Fixes #80 )
Making into table
1 parent 33e63dc commit f555b60

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

PSJekyll.PSJekyll.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,13 @@ $PSJekyll.CurrentSite.Data = @{
4747
"PSModule/FunctionNames" = $sourceModule.ExportedFunctions.Keys
4848
"PSModule/CmdletNames" = $sourceModule.ExportedCmdlets.Keys
4949
"PSModule/AliasNames" = $sourceModule.ExportedAliases.Keys
50+
"PSModule/Aliases" = @($sourceModule.ExportedAliases.Values |
51+
ForEach-Object { [Ordered]@{Name=$_.Name;Definition=$_.Definition} })
52+
5053
"PSModule/VariableNames" = $sourceModule.ExportedVariables.Keys
5154
"PSModule/TypeNames" = $sourceModule.ExportedTypeFiles |
5255
ForEach-Object { (Select-Xml -XPath //Types/Type -Path $_).Node.Name }
56+
5357
}
5458
$PSJekyll.CurrentSite.Data
5559
# It is important to use [Ordered], otherwise, the order of the keys will be random.
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
param()
22

33
@"
4-
{% for aliasName in site.data.PSModuleAliasNames %}
5-
{% assign pageLink = site.pages | where: "url", "/{{aliasName}}" %}
6-
{% if pageLink %}
7-
* [{{ aliasName }}](/{{aliasName}})
8-
{% else %}
9-
* {{ aliasName }}
10-
{% endif %}
4+
| Alias | Command |
5+
|-|-|
6+
{% for alias in site.data.PSModule.Aliases %}
7+
| {{ alias.Name }} | [{{ alias.Definition }}](/{{alias.Definition}}) |
118
{% endfor %}
129
"@

0 commit comments

Comments
 (0)