Skip to content

Commit

Permalink
🚚 Rename config.toml to hugo.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
jpanther committed Feb 24, 2025
1 parent aeaae3c commit 7f912a5
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 34 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

- New `gist` shortcode as the built-in Hugo version has been deprecated
- New icon for `kofi` ([#976](https://github.com/jpanther/congo/pull/976))
- Privacy and Services params in bundled `config.toml` to provide sensible defaults for built-in Hugo shortcodes
- Privacy and Services params in bundled `hugo.toml` to provide sensible defaults for built-in Hugo shortcodes

### Changed

- Renamed `config.toml` to `hugo.toml` to align with the default Hugo naming convention
- Reduced file sizes of default favicons ([#983](https://github.com/jpanther/congo/pull/983))
- Upgrade to KaTeX v0.16.21 ([#977](https://github.com/jpanther/congo/pull/977), [#1016](https://github.com/jpanther/congo/pull/1016))
- Upgrade to Tailwind v3.4.17 ([#979](https://github.com/jpanther/congo/pull/979))
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

Congo is designed to be a powerful, lightweight theme for [Hugo](https://gohugo.io). It's built using Tailwind CSS with a clean and minimalist design that prioritises to your content.

🌏 [Demo site](https://jpanther.github.io/congo/)
📑 [Theme documentation](https://jpanther.github.io/congo/docs/)
🐛 [Bug reports & issues](https://github.com/jpanther/congo/issues)
🌏 [Demo site](https://jpanther.github.io/congo/)
📑 [Theme documentation](https://jpanther.github.io/congo/docs/)
🐛 [Bug reports & issues](https://github.com/jpanther/congo/issues)
💡 [Questions & feature requests](https://github.com/jpanther/congo/discussions)

![Screenshot](https://raw.githubusercontent.com/jpanther/congo/stable/images/screenshot.png)
Expand Down Expand Up @@ -67,7 +67,7 @@ Detailed instructions for each method can be found in the [Installation](https:/

3. Start your server using `hugo server` and the theme will be downloaded automatically.

4. In the root folder of your website, delete the `config.toml` file that was generated by Hugo. Copy the `*.toml` config files from the theme into your `config/_default/` folder.
4. 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.

> **Note:** Do not overwrite the `module.toml` file you created above!
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions exampleSite/content/docs/configuration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ The theme ships with a default configuration that gets you up and running with a
The default theme configuration is documented in each file so you can freely adjust the settings to meet your needs.

{{< alert >}}
As outlined in the [installation instructions]({{< ref "/docs/installation#set-up-theme-configuration-files" >}}), you should adjust your theme configuration by modifying the files in the `config/_default/` folder of your Hugo project and delete the `config.toml` file in your project root.
As outlined in the [installation instructions]({{< ref "/docs/installation#set-up-theme-configuration-files" >}}), you should adjust your theme configuration by modifying the files in the `config/_default/` folder of your Hugo project and delete the `hugo.toml` file in your project root.
{{< /alert >}}

## Site configuration

Standard Hugo configuration variables are respected throughout the theme, however there are some specific things that should be configured for the best experience.

The site configuration is managed through the `config/_default/config.toml` file. The table below outlines all the settings that the Congo takes advantage of.
The site configuration is managed through the `config/_default/hugo.toml` file. The table below outlines all the settings that the Congo takes advantage of.

Note that the variable names provided in this table use dot notation to simplify the TOML data structure (ie. `outputs.home` refers to `[outputs] home`).

Expand Down
6 changes: 3 additions & 3 deletions exampleSite/content/docs/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ The config files that ship with Congo contain all of the possible settings that

## Basic configuration

Before creating any content, there are a few things you should set for a new installation. Starting in the `config.toml` file, set the `baseURL` and `languageCode` parameters. The `languageCode` should be set to the main language that you will be using to author your content.
Before creating any content, there are a few things you should set for a new installation. Starting in the `hugo.toml` file, set the `baseURL` and `languageCode` parameters. The `languageCode` should be set to the main language that you will be using to author your content.

```toml
# config/_default/config.toml
# config/_default/hugo.toml

baseURL = "https://your_domain.com/"
languageCode = "en"
Expand All @@ -30,7 +30,7 @@ The next step is to configure the language settings. Although Congo supports mul
Locate the `languages.en.toml` file in the config folder. If your main language is English you can use this file as is. Otherwise, rename it so that it includes the correct language code in the filename. For example, for French, rename the file to `languages.fr.toml`.

{{< alert >}}
The language code in the language config filename should match the `languageCode` setting in `config.toml`.
The language code in the language config filename should match the `languageCode` setting in `hugo.toml`.
{{< /alert >}}

```toml
Expand Down
4 changes: 2 additions & 2 deletions exampleSite/content/docs/hosting-deployment/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ tags: ["hosting", "deployment", "docs", "github", "netlify", "render"]

There are many ways to deploy your Hugo website built with Congo. The theme is designed to be flexible in almost any deployment scenario.

Congo is built using relative URLs throughout the theme. This enables sites to easily be deployed to sub-folders and hosts like GitHub Pages. There's usually no special configuration required for this to work as long as the `baseURL` parameter has been configured in the `config.toml` file.
Congo is built using relative URLs throughout the theme. This enables sites to easily be deployed to sub-folders and hosts like GitHub Pages. There's usually no special configuration required for this to work as long as the `baseURL` parameter has been configured in the `hugo.toml` file.

The official Hugo [Hosting and Deployment](https://gohugo.io/hosting-and-deployment/) docs are the best place to learn how to deploy your site. The sections below contain some specific theme configuration details that can help you deploy smoothly with certain providers.

Expand Down Expand Up @@ -141,7 +141,7 @@ Hugo sites built with Congo still load very quickly, even with this feature disa

Using traditional web hosting, or deploying to your own web server, is as simple as building your Hugo site and transferring the files to your host.

Make sure that the `baseURL` parameter in `config.toml` is set to the full URL to the root of your website (including any sub domains or sub-folders).
Make sure that the `baseURL` parameter in `hugo.toml` is set to the full URL to the root of your website (including any sub domains or sub-folders).

Then build your site using `hugo` and copy the contents of the output directory to the root of your web server and you will be ready to go. By default, the output directory is named `public`.

Expand Down
6 changes: 3 additions & 3 deletions exampleSite/content/docs/installation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Then continue to [set up the theme configuration files](#set-up-theme-configurat

### Set up theme configuration files

In the root folder of your website, delete the `hugo.toml` (or `config.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 customise the theme to your needs.
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 customise the theme to your needs.

{{< alert >}}
**Note:** You should not overwrite the `module.toml` file if one already exists in your project!
Expand All @@ -112,15 +112,15 @@ Once you've copied the files, your config folder should look like this:

```shell
config/_default/
├─ config.toml
├─ hugo.toml
├─ markup.toml
├─ menus.toml
├─ module.toml # if you installed using Hugo Modules
└─ params.toml
```

{{< alert >}}
**Important:** If you didn't use Hugo Modules to install Congo, you must add the line `theme = "congo"` to the top of your `config.toml` file.
**Important:** If you didn't use Hugo Modules to install Congo, you must add the line `theme = "congo"` to the top of your `hugo.toml` file.
{{< /alert >}}

### Next steps
Expand Down
13 changes: 5 additions & 8 deletions exampleSite/content/docs/partials/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,14 @@ To enable support for Umami Analytics, insert the _tracking code token_ provided

### Google Analytics

Google Analytics support is provided through the internal Hugo partial. Simply provide the `googleAnalytics` key in the `config/_default/config.toml` file and the script will be added automatically.

Both version 3 (analytics.js) and version 4 (gtag.js) are supported, based on the configuration value provided:
Google Analytics support is provided through the internal Hugo partial. Simply provide the `services.googleAnalytics` key in the `config/_default/hugo.toml` file and the script will be added automatically.

```toml
# config/_default/config.toml
# config/_default/hugo.toml

# version 3
googleAnalytics = "UA-PROPERTY_ID"
# version 4
googleAnalytics = "G-MEASUREMENT_ID"
[services]
[services.googleAnalytics]
id = 'G-XXXXXXXXX'
```

### Custom analytics providers
Expand Down
22 changes: 11 additions & 11 deletions exampleSite/content/docs/version-2/upgrade/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,28 +99,28 @@ rtl = false

Using your preferred language, simply create this new file in `config/_default/` and then move the language-specific parameters from any existing config files over to this new file. The table below outlines the parameters that need to be moved.

| Parameter | Old location |
| ------------- | ------------- |
| `title` | `config.toml` |
| `description` | `params.toml` |
| `copyright` | `config.toml` |
| `dateFormat` | `params.toml` |
| `[author]` | `config.toml` |
| Parameter | Old location |
| ------------- | ---------------------------- |
| `title` | `config.toml` or `hugo.toml` |
| `description` | `params.toml` |
| `copyright` | `config.toml` or `hugo.toml` |
| `dateFormat` | `params.toml` |
| `[author]` | `config.toml` or `hugo.toml` |

Once the values have been moved to the new location, these parameters should be deleted from their original locations.

### Menus.toml

As the theme is now aware of languages, the `menus.toml` file should also be renamed to include a language code. Rename the existing `menus.toml` to `menus.[lang-code].toml`, where the language code matches the code used in the `languages.toml` file in the previous section.

### Config.toml
### Hugo.toml (formerly Config.toml)

The `config.toml` file now only contains base Hugo configuration values. Other than removing the language-specific strings above, there are only two changes to consider.
The `hugo.toml` file now only contains base Hugo configuration values. Other than removing the language-specific strings above, there are only two changes to consider.

If you're using a language other than English, provide a `defaultContentLanguage` value that matches the language code in the config file you created for your language. Secondly, to take advange of the new site search in Congo 2.0, an `[outputs]` block needs to be provided.

```toml
# config/_default/config.toml
# config/_default/hugo.toml

defaultContentLanguage = "en"

Expand Down Expand Up @@ -178,7 +178,7 @@ For the full list of supported parameters, refer to the [Configuration]({{< ref

All site assets, with the exception of favicons, now use Hugo Pipes to build an optimised version of your project. In order for the theme to locate your files, any previously static theme assets need to be moved to the Hugo assets folder. Primarily this is the author image and site logo:

`static/me.jpg` **&rarr;** `assets/me.jpg`
`static/me.jpg` **&rarr;** `assets/me.jpg`
`static/logo.jpg` **&rarr;** `assets/logo.jpg`

If you have provided an author image or site logo, simply move these assets from `static/` to `assets/`. If you use the same directory structure the theme will know where to find these files automatically. If you would like to provide a new path, update the `logo` and `author.image` config values accordingly.
Expand Down

0 comments on commit 7f912a5

Please sign in to comment.