Site Logo
Kayal
Cover Image

Getting Started πŸš€

Posted on 4 mins

Hugo Kayal Install

Install Hugo

Getting Started

Create a new Hugo site

Run the following command to create a new Hugo site in a directory named mywebsite.

hugo new site mywebsite

Note:

Once you’ve created a new site, follow the steps below to add the Kayal theme.

Download Kayal

There several different ways to install the Kayal theme into your Hugo website. From easiest to most difficult to install and maintain, they are:

If unsure, choose the Git submodule method.

Install as Git submodule

This method is the quickest and easiest for keeping the theme up-to-date. Besides Hugo and Go, you’ll also need to ensure you have Git installed on your local machine.

Change into the directory for your Hugo website (that you created above), initialise a new git repository and add Kayal as a submodule.

cd mywebsite
git init
git submodule add -b main https://github.com/mnjm/kayal.git themes/kayal

Then continue to set up the theme configuration files .

Install as Hugo Module

For this method, use Hugo to manage your themes. Make sure you have Go installed before proceeding.

  1. Download and install Go. Verify with go version (requires Go version 1.12 or later).

  2. From your Hugo project directory (that you created above), initialise modules for your website:

    # If you're managing your project on GitHub
    hugo mod init github.com/<username>/<repo-name>
    
    # If you're managing your project locally
    hugo mod init my-project
    
  3. Add the theme to your configuration by creating a new file config/_default/module.toml and adding the following:

    [[imports]]
    path = "github.com/mnjm/kayal/"
    
  4. Start your server using hugo server and the theme will be downloaded automatically.

  5. Continue to set up the theme configuration files .

Install manually
  1. Download the latest release of the theme source code. Download link
  2. Extract the archive, rename the folder to kayal and move it to the themes/ directory inside your Hugo project’s root folder.
  3. Continue to set up the theme configuration files .

Set up theme configuration files

In the root folder of your website, delete the hugo.toml file that was generated by Hugo. Copy the toml config files from the theme into your config/_default/ folder. This will ensure you have all the correct theme settings and will enable you to easily customize the theme to your needs.

Note: You should not overwrite the module.toml file if one already exists in your project!

Depending on how you installed the theme you will find the theme config files in different places:

Once you’ve copied the files, your config folder should look like this:

_default
β”œβ”€β”€ hugo.toml
β”œβ”€β”€ markup.toml
β”œβ”€β”€ menus.toml
└── params.toml
Important: If you didn’t use Hugo Modules to install Kayal, you must add the line theme = "kayal" to the top of your hugo.toml file.

Next steps

The basic Kayal installation is now complete. Continue to the Configuration section to learn more about configuring the theme.


Installing updates

Periodically, new releases may include fixes and new features. Update theme files on your website based on your initial installation method.

Update using git

Git submodules can be updated using the git command. Simply execute the following command and the latest version of the theme will be downloaded into your local repository:

git submodule update --remote --merge

Once the submodule has been updated, rebuild your site and check everything works as expected.

Update using Hugo

Hugo makes updating modules super easy. Simply change into your project directory and execute the following command:

hugo mod get -u

Hugo will automatically update any modules that are required for your project. It does this by inspecting your module.toml and go.mod files. If you have any issues with the update, check to ensure these files are still configured correctly.

Then simply rebuild your site and check everything works as expected.

Update manually

Updating Kayal manually requires you to download the latest copy of the theme and replace the old version in your project.

Note: Any local customisations you have made to the theme files will be lost during this process.

  1. Download the latest theme release here .
  2. Extract and move kayal to themes/ in your Hugo project.
  3. Rebuild your site and check everything works as expected.