Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Commit

Permalink
Non-default local port is now correctly added to Hugo baseURL
Browse files Browse the repository at this point in the history
  • Loading branch information
aral committed Nov 4, 2020
1 parent 5bbfee4 commit b22a81a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [15.4.2] - 2020-11-04

### Fixed

- When running Hugo sites locally from a non-default port, the port is now correctly added to the `baseURL`.

## [15.4.1] - 2020-11-04

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ class Site {
const sourcePath = path.join(this.pathToServe, file)
const destinationPath = `../.generated${mountPath}`

const localBaseURL = `https://localhost${mountPath}`
const localBaseURL = `https://localhost${this.port === 443 ? '' : `:${this.port}`}${mountPath}`
const globalBaseURL = `https://${Site.hostname}${mountPath}`
let baseURL = this.global ? globalBaseURL : localBaseURL

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@small-tech/site.js",
"version": "15.4.1",
"version": "15.4.2",
"description": "Small Web construction set.",
"keywords": [
"web server",
Expand Down

0 comments on commit b22a81a

Please sign in to comment.