Skip to content

Commit

Permalink
feat: PSJekyll.Site.set_Domain ( Fixes #62 )
Browse files Browse the repository at this point in the history
  • Loading branch information
James Brundage committed Oct 5, 2024
1 parent bf31022 commit f797a84
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Types/PSJekyll.Site/set_Domain.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<#
.SYNOPSIS
Sets the domain name of the site.
.DESCRIPTION
Sets the domain name of the Jekyll site.
This will create a CNAME file in the root of the site.
#>
param([string]$cname)
$cNamePath = Join-Path $this.Directory "CNAME"
New-Item -ItemType File -Path $cNamePath -Force -Value $cname
$tryToResolveCName = try {
[Net.Dns]::Resolve($cname)
} catch {
Write-Warning "Could not resolve the domain name '$cname'."
}

0 comments on commit f797a84

Please sign in to comment.