Skip to content

Commit bd51585

Browse files
author
James Brundage
committed
feat: Neocities types and formatting ( Fixes #7 )
1 parent 1a087d0 commit bd51585

File tree

7 files changed

+45
-0
lines changed

7 files changed

+45
-0
lines changed
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<#
2+
.SYNOPSIS
3+
Gets the creation time
4+
.DESCRIPTION
5+
Gets the creation time, as a `[DateTime]` object.
6+
#>
7+
$this.created_at -as [DateTime]
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<#
2+
.SYNOPSIS
3+
Gets the last update time
4+
.DESCRIPTION
5+
Gets the last update time, as a `[DateTime]` object.
6+
#>
7+
$this.updated_at -as [DateTime]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Write-FormatView -TypeName 'neocities.file' -Property Path, Size, CreatedAt, UpdatedAt -AutoSize
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<#
2+
.SYNOPSIS
3+
Gets the creation time
4+
.DESCRIPTION
5+
Gets the creation time, as a `[DateTime]` object.
6+
#>
7+
$this.created_at -as [DateTime]
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<#
2+
.SYNOPSIS
3+
Gets the last update time
4+
.DESCRIPTION
5+
Gets the last update time, as a `[DateTime]` object.
6+
#>
7+
$this.last_updated -as [DateTime]

Types/neocities.info/get_Url.ps1

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
param()
2+
if ($this.Domain) {
3+
"https://$($this.Domain)/"
4+
}
5+
elseif ($this.sitename) {
6+
"https://$($this.sitename).neocities.org/"
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Write-FormatView -TypeName 'neocities.info' -Property SiteName, Views, Hits, CreatedAt, UpdatedAt, Url -AutoSize -VirtualProperty @{
2+
SiteName = {
3+
if ($psStyle) {
4+
$PSStyle.FormatHyperlink($_.SiteName, $_.Url)
5+
} else {
6+
$_.SiteName
7+
}
8+
}
9+
}

0 commit comments

Comments
 (0)