Giter VIP home page Giter VIP logo

hugo-vsts-extension's Introduction

Generates a site using Hugo, a Fast and Flexible Website Generator.

Hugo logo here

Usage

The Build Task will automatically download the hugo executable, if the version is not already present on the build machine, and invoke it.

You can specify some common options.

  • Source: relative path from repo root of the Hugo sources, defaults to Build.SourcesDirectory, passed as --source flag.
  • Destination: path of Hugo generated site, typically Build.ArtifactStagingDirectory, passed as --destination flag.
  • Hugo Version: defines the Hugo version, use latest, 0.25.1, 0.24, but not v0.24 (pick valid values from Hugo Releases page). If the preferred version cannot be found, the latest released version will be used instead.
  • Extended Version: download the extended Hugo version (SCSS/SASS support).
  • Base URL: sets the hostname (and path) to the root, e.g. http://example.com/, passed as --baseURL flag.
  • Include Drafts: to include content marked as draft, passed as --buildDrafts flag.
  • 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.

Build Task Arguments screenshot here

A detailed walk through is here Building a Hugo Site with the Azure DevOps Extension

More Information on Hugo on this site.

The Hugo logos are copyright © Steve Francia 2013–2022.

Release Notes

2.0

  • New Cross-platform implementation.
  • Removed uglyURLs option, deprecated since Hugo 0.xx ???
  • Added additionalArgs option to allow custom arguments.

1.1.0

  • Fixes (ISSUE#5)
  • Added support for Extended version (Hugo 0.43 and later)

1.0.1

  • Use TLS 1.2 for GitHub API (PR#3)

1.0.0

  • Initial release

hugo-vsts-extension's People

Contributors

giuliov avatar matthewmcd avatar petersendev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

hugo-vsts-extension's Issues

Possible issue with Extended Version support

When running the Hugo generate task using the open source theme 'introduction', Azure Pipelines shows the following error:

error: failed to transform resource: POSTCSS: failed to transform "css/main.css" (text/css): PostCSS not found; install with "npm install postcss-cli". See https://gohugo.io/hugo-pipes/postcss/

Hugo Version is set to latest and the Extended checkbox is checked. When running Hugo manually, the above error is typically generated when one forgets to download the extended version of Hugo, but perhaps there is something else I'm doing wrong here?

[Error] Step task reference is invalid

Hey!

I'm trying to use the latest version of the task, but I'm getting the below error:

Step task reference is invalid. The task name HugoTask is ambiguous. Specify one of the following identifiers to resolve the ambiguity: giuliovdev.hugo-extension.hugo-build-task.HugoTask, giuliovdev.hugo-extension.hugo-build-task-v2.HugoTask

Zrzut ekranu 2022-01-16 o 23 18 49

- task: HugoTask@2
        inputs:
          source: './'
          destination: '$(Build.ArtifactStagingDirectory)'
          extendedVersion: true
          baseURL: ...

Could you help me with that? I tried to run that task on Ubuntu-latest and VS2017-Win2016 machines. Many thanks in advance!

Extension does not work with Hugo versions above v0.88.1

The extension finds the Windows 64 release by looking at if the name of the asset matches '*Windows*64*'.

$win64hugo = $release.assets | where { $_.name -like '*Windows*64*' }

Up until version 0.88.1 this only matched on hugo_<version>_Windows-64bit.zip but after version 0.89 it also matches on a new asset called hugo_<version>_Windows-ARM64.zip.

The logic for finding the download URL for the version should change to handle this new asset in the Hugo releases.

Build in VSTS is different from Local

Thanks for this extension!

I am trying to build a simple project as a test.
If I run hugo --enableGitInfo --i18n-warnings --verbose --baseURL https://photos.foo.com

On my local machine with hugo I get 50 pages and 33 static files. On the server I get 20 pages and 20 static files.

Any ideas why I would see different page counts?

Cannot convert value to type System.String

Something must have changed on VSTS. I don't think this repo has seen any commits since this error occured. Error message shown below. I tried leaving the source input box blank and with $(Build.SourcesDirectory). I'll try to look into it when I get a chance.

2018-07-13T04:22:18.3827699Z ##[section]Starting: Hugo generate 
2018-07-13T04:22:18.4068045Z ==============================================================================
2018-07-13T04:22:18.4068308Z Task         : Hugo
2018-07-13T04:22:18.4068578Z Description  : Generate a static web site using Hugo, a Fast and Flexible Website Generator
2018-07-13T04:22:18.4068793Z Version      : 1.0.1
2018-07-13T04:22:18.4068976Z Author       : Giulio Vian
2018-07-13T04:22:18.4069236Z Help         : [More Information on Task](https://github.com/giuliov/hugo-vsts-extension/README.md), for [Information on Hugo](https://gohugo.io/).
2018-07-13T04:22:18.4069551Z ==============================================================================
2018-07-13T04:22:26.3617317Z ##[error]Cannot process argument transformation on parameter 'SourceUrl'. Cannot convert value to type System.String.
2018-07-13T04:22:26.3647731Z ##[section]Finishing: Hugo generate 

Support for Linux

When i try to execute on Ubuntu i gotten this error:
##[error]The current operating system is not capable of running this task. That typically means the task was written for Windows only. For example, written for Windows Desktop PowerShell.

Add minify

Could you add the --minify flag to the hugo build command?

Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.

I'm getting this error on new DevOps builds... not sure if there are any existing guides on troubleshooting as I'm not sure where to start figuring out what could be causing this.

2021-01-25T02:50:43.8834939Z ##[section]Starting: Hugo generate 
2021-01-25T02:50:43.9048621Z ==============================================================================
2021-01-25T02:50:43.9049395Z Task         : Hugo
2021-01-25T02:50:43.9049854Z Description  : Generate a static web site using Hugo, a Fast and Flexible Website Generator
2021-01-25T02:50:43.9050545Z Version      : 1.1.1
2021-01-25T02:50:43.9050950Z Author       : Giulio Vian
2021-01-25T02:50:43.9051536Z Help         : [More Information on Task](https://github.com/giuliov/hugo-vsts-extension/README.md), for [Information on Hugo](https://gohugo.io/).
2021-01-25T02:50:43.9052288Z ==============================================================================
2021-01-25T02:55:11.2140326Z ##[error]Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
2021-01-25T02:55:11.2555183Z ##[section]Finishing: Hugo generate 

The request was aborted: Could not create SSL/TLS secure channel.

I am trying to build by Hugo static web using this extension and the following error. My best guess is it fails when it attempts to download Hugo executable.

******************************************************************************
Starting: Hugo generate
******************************************************************************
==============================================================================
Task         : Hugo
Description  : Generate a static web site using Hugo, a Fast and Flexible Website Generator
Version      : 1.0.0
Author       : Giulio Vian
Help         : [More Information on Task](https://github.com/giuliov/hugo-vsts-extension/README.md), for [Information on Hugo](https://gohugo.io/).
==============================================================================
The request was aborted: Could not create SSL/TLS secure channel.
******************************************************************************
Finishing: Hugo generate
******************************************************************************

Here are my settings:

screenshot_1

Is there any other information I can supply to help diagnose? Thank you.

[error]A supported task execution handler was not found.

I'm getting the below error on a Linux hosted agent. Is this extension supported on Linux agents?

2017-10-25T17:20:06.2153990Z ##[section]Starting: Hugo generate /
2017-10-25T17:20:06.2200410Z ==============================================================================
2017-10-25T17:20:06.2213770Z Task         : Hugo
2017-10-25T17:20:06.2227980Z Description  : Generate a static web site using Hugo, a Fast and Flexible Website Generator
2017-10-25T17:20:06.2241780Z Version      : 1.0.0
2017-10-25T17:20:06.2255580Z Author       : Giulio Vian
2017-10-25T17:20:06.2271520Z Help         : [More Information on Task](https://github.com/giuliov/hugo-vsts-extension/README.md), for [Information on Hugo](https://gohugo.io/).
2017-10-25T17:20:06.2287890Z ==============================================================================
2017-10-25T17:20:06.3361190Z ##[error]A supported task execution handler was not found. This error usually means the task does not carry an implementation that is compatible with your current operating system. Contact the task author for more details.
2017-10-25T17:20:06.3431470Z ##[section]Finishing: Hugo generate /

Error: Error building site: open D:\a\1\s\content: The system cannot find the file specified.

In my Azure DevOps pipeline, I have a Build pipeline. It contains two processes:

  1. Get sources
  2. Hugo Build

The "Get sources" process retrieves my Hugo repository content and appears to always have a successful checkout to D:/a/1/s/

The Hugo Build process has a Hugo generate and a Publish Artifact: public task.

The Hugo generate task uses the following settings:

  • Display name: Hugo generate
  • Source: $(Build.SourcesDirectory)
  • Destination: $(Build.ArtifactStagingDirectory)
  • Hugo Version: latest
  • Base URL: http://instantdreams.org

When Hugo generate runs, I receive the following error message:

##[section]Starting: Hugo generate
==============================================================================
Task         : Hugo
Description  : Generate a static web site using Hugo, a Fast and Flexible Website Generator
Version      : 1.1.1
Author       : Giulio Vian
Help         : [More Information on Task](https://github.com/giuliov/hugo-vsts-extension/README.md), for [Information on Hugo](https://gohugo.io/).
==============================================================================
##[command]"C:\Users\VSSADM~1\AppData\Local\Temp\hugotask_v0.55.6\hugo.exe"  --source D:\a\1\s --baseURL http://instantdreams.org --destination D:\a\1\a  --enableGitInfo --i18n-warnings --verbose
INFO 2019/06/17 22:41:11 No translation bundle found for default language "en"
INFO 2019/06/17 22:41:11 Translation func for language en not found, use default.
INFO 2019/06/17 22:41:11 i18n not initialized; if you need string translations, check that you have a bundle in /i18n that matches the site language or the default language.
INFO 2019/06/17 22:41:11 Using config file: 
Building sites … INFO 2019/06/17 22:41:11 syncing static files to D:\a\1\a\
Total in 5 ms
Error: Error building site: open D:\a\1\s\content: The system cannot find the file specified.
##[error]Process 'hugo.exe' exited with code '-1'.
##[section]Finishing: Hugo generate

Any help would be most welcome.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.