Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacing invalid category for the extension, schema has changed #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ You can specify some common options.
- **Include Expired**: to include expired content, passed as `--buildExpired` flag.
- **Include Future**: to include content with publishdate in the future, passed as `--buildFuture` flag.
- **Use Ugly URLs**: to use `/filename.html` instead of `/filename/`, passed as `--uglyURLs` flag.
- **Minify**: to minify the output, passed as `--minify` flag.
- **Additional Args**: to add [additional parameters](https://gohugo.io/commands/hugo/) for hugo.

![Build Task Arguments screenshot here](images/BuildTaskArguments.png)

Expand All @@ -26,6 +28,11 @@ The Hugo logos are copyright © Steve Francia 2013–2018.

# Release Notes

## 1.2.0

- Adding --minify switch
- Adding additional parameters as text input

## 1.1.0

- Fixes ([ISSUE#5](https://github.com/giuliov/hugo-vsts-extension/issues/5))
Expand Down
5 changes: 4 additions & 1 deletion hugo-task/HugoTask.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ try {
[bool]$buildExpired = Get-VstsInput -Name BuildExpired -AsBool
[bool]$buildFuture = Get-VstsInput -Name BuildFuture -AsBool
[bool]$uglyURLs = Get-VstsInput -Name UglyURLs -AsBool
[bool]$minify = Get-VstsInput -Name Minify -AsBool
[string]$additionalFlags = Get-VstsInput -Name AdditionalFlags


Assert-VstsPath -LiteralPath $source -PathType Container

Expand All @@ -33,7 +36,7 @@ try {
return
}
[string]$hugoExePath = Get-HugoExecutable -SourceUrl $versionInfo.DownloadURL -Version $versionInfo.Version
Invoke-Hugo -hugoExePath $hugoExePath -source $source -destination $destination -baseURL $baseURL -buildDrafts $buildDrafts -buildExpired $buildExpired -buildFuture $buildFuture -uglyURLs $uglyURLs
Invoke-Hugo -hugoExePath $hugoExePath -source $source -destination $destination -baseURL $baseURL -buildDrafts $buildDrafts -buildExpired $buildExpired -buildFuture $buildFuture -uglyURLs $uglyURLs -minify $minify -additionalFlags $additionalFlags


} finally {
Expand Down
7 changes: 5 additions & 2 deletions hugo-task/Invoke-Hugo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ function Invoke-Hugo {
[bool]$buildDrafts,
[bool]$buildExpired,
[bool]$buildFuture,
[bool]$uglyURLs
[bool]$uglyURLs,
[bool]$minify,
[string]$additionalFlags
)

Trace-VstsEnteringInvocation $MyInvocation
Expand All @@ -29,10 +31,11 @@ function Invoke-Hugo {
if ($buildExpired) { $flags += " --buildExpired" }
if ($buildFuture) { $flags += " --buildFuture" }
if ($uglyURLs) { $flags += " --uglyURLs" }
if ($minify) { $flags += " --minify" }

$implicitFlags = " --enableGitInfo --i18n-warnings --verbose"

Invoke-VstsTool -FileName $hugoExePath -Arguments "${flags} ${implicitFlags}" -RequireExitCodeZero
Invoke-VstsTool -FileName $hugoExePath -Arguments "${flags} ${implicitFlags} ${additionalFlags}" -RequireExitCodeZero
#Invoke-Expression "${hugoExePath} ${flags} ${implicitFlags}"

} finally {
Expand Down
20 changes: 18 additions & 2 deletions hugo-task/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"demands": [],
"version": {
"Major": 1,
"Minor": 1,
"Patch": 1
"Minor": 2,
"Patch": 0
},
"minimumAgentVersion": "2.105.7",
"instanceNameFormat": "Hugo generate $(source)",
Expand Down Expand Up @@ -96,6 +96,22 @@
"defaultValue": "false",
"required": false,
"helpMarkDown": "If true, use /filename.html instead of /filename/."
},
{
"name": "minify",
"type": "boolean",
"label": "Minify",
"defaultValue": "false",
"required": false,
"helpMarkDown": "If true, output will be minified."
},
{
"name": "additionalFlags",
"type": "string",
"label": "Additional Flags",
"defaultValue": "",
"required": false,
"helpMarkDown": "Additional flags, see https://gohugo.io/commands/hugo/"
}
],
"execution": {
Expand Down
Binary file modified images/BuildTaskArguments.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 2 additions & 5 deletions vss-extension.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifestVersion": 1,
"id": "hugo-extension",
"version": "1.1.2",
"version": "1.2.0",
"name": "Hugo",
"publisher": "giuliovdev",
"description": "Generates a static web site using Hugo, a Fast and Flexible Website Generator.",
Expand All @@ -10,9 +10,6 @@
"id": "Microsoft.VisualStudio.Services"
}
],
"galleryFlags": [
"Public"
],
"icons": {
"default": "img/hugo-128x128.png"
},
Expand All @@ -21,7 +18,7 @@
"vso.release_execute"
],
"categories": [
"Build and release"
"Azure Pipelines"
],
"tags": [
"hugo",
Expand Down