Releases: small-tech/site.js
Best of both worlds
Breaking change
-
If you have an advanced routes file (routes.js) it is loaded prior to any DotJS routes. Previously, the presence of a advanced routes file meant that routes were only loaded from it and that any DotJS routes, if they existed, were ignored. This change means you can use DotJS in your sites and (instead of or), when you need to, define some of your routes using the full expressiveness of Express routes.
Although this is a breaking change in that it changes behaviour, the practical impact on existing sites should be minimal given that a project that was using advanced routing would not have had DotJS routes. The only place where this might impact you is if you forgot to delete some old DotJS routes and get surprised when they’re added to your application.
Added
-
In advanced routes (in routes.js) you now have access to the Site.js class (
app.Site
) and Site.js instance (app.site
) through the Expressapp
instance. -
In the statistics view, any routes that begin with /admin/… are shown as ‘Administration page’ to hide any cryptographically-secure paths that may be used as per convention.
16.1.0
Fixed
- Regression:
--sync-to
without--sync-from
no longer fails (https://source.small-tech.org/site.js/app/-/issues/254)
Improved
-
The addition of a generated folder now causes the server to restart. So, for example, if you’re going from a plain site to a Hugo site and you sync, you do not need to manually restart your production server. (https://source.small-tech.org/site.js/app/-/issues/261)
-
Sync now detects common erroneous invocations from well-known site subfolders (e.g., .hugo, .dynamic, etc.) and magically fixes the path (just like the serve command does for the path to serve). (https://source.small-tech.org/site.js/app/-/issues/262)
16.0.1
npx and npm global module fix
You can now run Site.js as a global npm module or via npx, e.g.,
npx @small-tech/[email protected]
Thanks to kapitaali for reporting this bug.
Other changes
- Minor: HTTP and WebSocket proxy messages are now easier to understand.
16.0.0
Upgrade Hugo and mkcert
The Hugo 0.78.0 upgrade has breaking changes for Hugo sites.
This release bundles the latest Hugo static site generator and mkcert:
-
Hugo version 0.78.0 (released November 3rd, 2020) via node-hugo version 2.0.0.
-
mkcert version 1.4.2 (released October 26th, 2020) via Auto Encrypt Localhost version 6.1.0.
Hugo 0.64.1 → 0.78.0 breaking changes
The previously-bundled version of Hugo was 0.64.1 from February 9th, 2020. There are breaking changes between these Hugo versions, so please read through the Hugo release notes.
We ran into the following two issues while upgrading our own sites:
- In the
[outputs]
section of your config.toml file, changetaxonomy
parameter totags
orcategories
. (See this issue.) - Change usage of parentheses in
if or
statements. (See this commit.)
Other changes
- Use new arm64 Hugo and mkcert binaries in Site.js arm64 releases.
- Improve the build script (rebuild node_modules on deploy for safety, auto-commit and push install script updates, auto-push release tag).
15.4.2
A Hugo fix
- When running Hugo sites locally from a non-default port, the port is now correctly added to the
baseURL
.
15.4.1
15.4.0
Lots of little things
This release implements a lot of small improvements, some of which have been longstanding.
Improved
General:
-
You can now run multiple local servers on your development machine (not on staging or production).
Running multiple local servers at different HTTPS ports no longer results in an error due to port 80 being unavailable for the HTTP Server that’s automatically started alongside. However, keep in mind that only your first server will get the features of that HTTP server, including HTTP to HTTPS redirects.
-
Running
site
without specifying a path while inside a special subfolder of your site (.dynamic
,.hugo
,.wildcard
,.db
) now magically does the right thing and serves the site root instead of the folder you’re in. If you really do want to serve one of these folders or a subfolder thereof, specifically state your intent by passing the current folder (.
) as an argument. (#217) -
Status command now displays daemon details if daemon is enabled (#36).
-
Status command now displays statistics URL if daemon is active (#232).
-
On Linux-like systems, the installation script now uses wget or curl to download the Site.js binary based on whichever is present (favouring wget), instead of expecting wget to be present and failing if it isn’t (#140).
-
Implement shorter custom ssh connection timeout for sync for when the host exists but you are not authorised to connect to it.
Previously, the timeout was the default TCP connection timeout of 120 seconds which would make it look like the process had hanged. The new timeout is 5 seconds, which provides timely feedback.
-
Version update messages are now easier to read and understand (#207).
-
Displays a graceful error message if an attempt is made to serve a file instead of a directory (#208).
-
Displays explanation of rsync error 12 along with advice for solving it (#85).
Security:
- Site.js will now refuse to serve the root or home directory for security reasons (#178).
- Site.js will now refuse to run if started from the root account for security reasons (#194).
Documentation:
- Document initial run
@hostname
error on Mac with stale DNS cache (#138). - Update Help output to add examples for update, start, stop, restart commands and match the readme (#137).
- Document that
.generated
folder should be added to.gitignore
(#197). - Document how
baseURL
handling works for generated Hugo content. (#200). - Update docs to include Mac install example for alpha/beta installs (#201).
- Improve Hugo documentation.
- General proof-read and update of the documentation (#196).
Added
-
--access-log-errors-only
option when starting a server (regular process or daemon). (#157)Displays only errors in the access log (HTTP status codes 4xx and 5xx). Successful access requests (1xx, 2xx, and 3xx) are not logged. This is useful during development if you feel overwhelmed by the output and miss other, non-access-related errors.
-
--access-log-disable
option when starting a server (regular process or daemon). (#157)Completely disable the access log. No access requests, not even errors will be logged. Be careful when using this in production as you might miss important errors.
-
Support for custom Hugo 404 pages (#237).
Create a 404.html page in your
layouts/
folder so that it gets created in your.generated
folder and it will be used instead of the default 404 page. If you have both a custom static 404 page (defined at /404/index.html) and a custom Hugo 404 page, the Hugo 404 page will take precedence. -
New npm build task:
update-nexe
.This task updates the Nexe base image for your platform, architecture, and version of Node.js. As you are basically building a modified version of Node.js this will take a while. The --all and --deploy options are not available on the build script when updating Nexe and will result in an error.
Fixed
- Completed incomplete basic getting started with Hugo example in the readme.
- Automatic rsync install no longer exits with error following successful installation (#97).
Note: Issue numbers refer to our internal issue tracker. This is the public mirror. Please open issues here.