Developers love Hugo because of its astonishing speed.
Content editors love Hokus because it brings the same speed benefit while hiding the complexity of editing raw files to edit a website.
When you save your content, you can see your updated website in your browser almost instantly.
Hokus is a multi-platform desktop application (Windows, macOS, and Linux are supported). Because it runs on your computer, you can use it even when you are offline.
Unlike Netlify, Hokus does not assume any infrastructure vendor, meaning that you are free to move your website to another host without losing the user interface you are used to.
This tutorial will show how to install Hokus, run a website locally and then move it to the cloud easily with Platform.sh.
Steps
-
You have the option to create and deploy directly on Platform.sh from the Repository
-
You have the option to fork the project and integrate it with Github and Platform.sh
-
Download the project with a
git clone
from the Git Repository that you wish.
-
Cick in new Site, plus on the left button to create a new project.
-
Now we have a Site configured, let’s use it! (keep in mind that Hokus will assume a default configuration for your website and to add more fields to your forms, or new forms, you need to edit the file hokus.toml).
Select the website you just created and select the workspace “source” Click source → click select → then in sidebar.
-
On the left, you’ll see both the
Post
andMain Config
option. If your current post is not showing, beware of the folder structure. We also have the option to customize it with thehokus.toml
file. On this repository we have the posts under thepost
structure; therefore, we went in thecollections
and changed the folder line:folder = "content/post/"
-
Now it’s time to run your website locally. ON the right sidebar, click in the “play” icon, and select the default option. Your browser will open showing your website!
-
Click in the Posts button. You have the option to create, edit and delete posts.Open an existing post or create a new one.
-
All the posts work with Markdown, so you can add bullets or pictures with Markdown After editing the post, click on the Save button (bottom right corner). Your changes will update your website in your browser instantly!
-
Are you happy with what you have? Let’s move it to the cloud with Platform.sh. We need to set the application file and the route that you can see respectively.
File: .platform.app.yaml
# .platform.app.yaml
# The name of this application, which must be unique within a project.
name: 'app'
# The type key specifies the language and version for your application.
type: golang:1.14
# The hooks that will be triggered when the package is deployed.
hooks:
# Build hooks can modify the application files on disk but not access any services like databases.
build: !include
type: string
path: build.sh
# The size of the persistent disk of the application (in MB).
disk: 5120
# The configuration of the application when it is exposed to the web.
web:
locations:
'/':
# The public directory of the application relative to its root.
root: 'public'
index: ['index.html']
scripts: false
allow: true
expires: 1d
File `.platform/routes.yaml`
"https://{default}/":
type: upstream
upstream: "app:http"
-
The last step is to push your changes to a remote repository.
git push origin master
-
Done, Hugo, Hokus, and Platform.sh at your service!