initial commit
BIN
exampleSite/content/.DS_Store
vendored
Normal file
29
exampleSite/content/_index.md
Executable file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
title: "Welcome to Congo! :tada:"
|
||||
description: "This is a demo of the Congo theme for Hugo."
|
||||
---
|
||||
|
||||
{{< lead >}}
|
||||
A powerful, lightweight theme for Hugo built with Tailwind CSS.
|
||||
{{< /lead >}}
|
||||
|
||||
This is a demo site built entirely using Congo. It also contains a complete set of [theme documentation]({{< ref "docs" >}}). Congo is flexible and is great for both static page-based content (like this demo) or a traditional blog with a feed of recent posts.
|
||||
|
||||
<div class="flex px-4 py-2 mb-8 text-base rounded-md bg-primary-100 dark:bg-primary-900">
|
||||
<span class="flex items-center ltr:pr-3 rtl:pl-3 text-primary-400">
|
||||
{{< icon "triangle-exclamation" >}}
|
||||
</span>
|
||||
<span class="flex items-center justify-between grow dark:text-neutral-300">
|
||||
<span class="prose dark:prose-invert">This is a demo of the <code id="layout">page</code> layout.</span>
|
||||
<button
|
||||
id="switch-layout-button"
|
||||
class="px-4 !text-neutral !no-underline rounded-md bg-primary-600 hover:!bg-primary-500 dark:bg-primary-800 dark:hover:!bg-primary-700"
|
||||
>
|
||||
Switch layout ↻
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
Explore the [sample pages]({{< ref "samples" >}}) to get a feel for what Congo can do. If you like what you see, check out the project on [Github](https://github.com/jpanther/congo) or read the [Installation guide]({{< ref "docs/installation" >}}) to get started.
|
||||
|
||||
 on [Unsplash](https://unsplash.com/s/photos/vibrant-purple?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText).")
|
||||
BIN
exampleSite/content/docs/.DS_Store
vendored
Normal file
19
exampleSite/content/docs/_index.md
Executable file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
title: "Documentation"
|
||||
description: "Learn how to use Congo and its features."
|
||||
|
||||
cascade:
|
||||
showDate: false
|
||||
showAuthor: false
|
||||
invertPagination: true
|
||||
---
|
||||
|
||||
{{< lead >}}
|
||||
Simple, yet powerful. Learn how to use Congo and its features.
|
||||
{{< /lead >}}
|
||||
|
||||

|
||||
|
||||
This section contains everything you need to know about Congo. If you're new, check out the [Installation]({{< ref "docs/installation" >}}) guide to begin or visit the [Samples]({{< ref "samples" >}}) section to see what Congo can do.
|
||||
|
||||
---
|
||||
181
exampleSite/content/docs/advanced-customisation.md
Normal file
@@ -0,0 +1,181 @@
|
||||
---
|
||||
title: "Advanced Customisation"
|
||||
date: 2020-08-08
|
||||
draft: false
|
||||
description: "Learn how to build Congo manually."
|
||||
slug: "advanced-customisation"
|
||||
tags: ["advanced", "css", "docs"]
|
||||
---
|
||||
|
||||
There are many ways you can make advanced changes to Congo. Read below to learn more about what can be customised and the best way of achieving your desired result.
|
||||
|
||||
If you need further advice, post your questions on [GitHub Discussions](https://github.com/jpanther/congo/discussions).
|
||||
|
||||
## Hugo project structure
|
||||
|
||||
Before leaping into it, first a quick note about [Hugo project structure](https://gohugo.io/getting-started/directory-structure/) and best practices for managing your content and theme customisations.
|
||||
|
||||
{{< alert >}}
|
||||
**In summary:** Never directly edit the theme files. Only make customisations in your Hugo project's sub-directories, not in the themes directory itself.
|
||||
{{< /alert >}}
|
||||
|
||||
Congo is built to take advantage of all the standard Hugo practices. It is designed to allow all aspects of the theme to be customised and overriden without changing any of the core theme files. This allows for a seamless upgrade experience while giving you total control over the look and feel of your website.
|
||||
|
||||
In order to achieve this, you should never manually adjust any of the theme files directly. Whether you install using Hugo modules, as a git submodule or manually include the theme in your `themes/` directory, you should always leave these files intact.
|
||||
|
||||
The correct way to adjust any theme behaviour is by overriding files using Hugo's powerful [file lookup order](https://gohugo.io/templates/lookup-order/). In summary, the lookup order ensures any files you include in your project directory will automatically take precedence over any theme files.
|
||||
|
||||
For example, if you wanted to override the main article template in Congo, you can simply create your own `layouts/_default/single.html` file and place it in the root of your project. This file will then override the `single.html` from the theme without ever changing the theme itself. This works for any theme files - HTML templates, partials, shortcodes, config files, data, assets, etc.
|
||||
|
||||
As long as you follow this simple practice, you will always be able to update the theme (or test different theme versions) without worrying that you will lose any of your custom changes.
|
||||
|
||||
## Colour schemes
|
||||
|
||||
Congo ships with a number of colour schemes out of the box. To change the basic colour scheme, you can set the `colorScheme` theme parameter. Refer to the [Getting Started]({{< ref "getting-started#colour-schemes" >}}) section to learn more about the built-in schemes.
|
||||
|
||||
In addition to the default schemes, you can also create your own and re-style the entire website to your liking. Schemes are created by by placing a `<scheme-name>.css` file in the `assets/css/schemes/` folder. Once the file is created, simply refer to it by name in the theme configuration.
|
||||
|
||||
Congo defines a three-colour palette that is used throughout the theme. The three colours are defined as `neutral`, `primary` and `secondary` variants, each containing ten shades of colour.
|
||||
|
||||
Due to the way Tailwind CSS 3.0 calculates colour values with opacity, the colours specified in the scheme need to [conform to a particular format](https://github.com/adamwathan/tailwind-css-variable-text-opacity-demo) by providing the red, green and blue colour values.
|
||||
|
||||
```css
|
||||
:root {
|
||||
--color-primary-500: 139, 92, 246;
|
||||
}
|
||||
```
|
||||
|
||||
This example defines a CSS variable for the `primary-500` colour with a red value of `139`, green value of `92` and blue value of `246`.
|
||||
|
||||
Use one of the existing theme stylesheets as a template. You are free to define your own colours, but for some inspiration, check out the official [Tailwind colour palette reference](https://tailwindcss.com/docs/customizing-colors#color-palette-reference).
|
||||
|
||||
## Overriding the stylesheet
|
||||
|
||||
Sometimes you need to add a custom style to style your own HTML elements. Congo provides for this scenario by allowing you to override the default styles in your own CSS stylesheet. Simply create a `custom.css` file in your project's `assets/css/` folder.
|
||||
|
||||
The `custom.css` file will be minified by Hugo and loaded automatically after all the other theme styles which means anything in your custom file will take precedence over the defaults.
|
||||
|
||||
### Adjusting the font size
|
||||
|
||||
Changing the font size of your website is one example of overriding the default stylesheet. Congo makes this simple as it uses scaled font sizes throughout the theme which are derived from the base HTML font size. By default, Tailwind sets the default size to `12pt`, but it can be changed to whatever value you prefer.
|
||||
|
||||
Create a `custom.css` file using the [instructions above]({{< ref "#overriding-the-stylesheet" >}}) and add the following CSS declaration:
|
||||
|
||||
```css
|
||||
/* Increase the default font size */
|
||||
html {
|
||||
font-size: 13pt;
|
||||
}
|
||||
```
|
||||
|
||||
Simply by changing this one value, all the font sizes on your website will be adjusted to match this new size. Therefore, to increase the overall font sizes used, make the value greater than `12pt`. Similarly, to decrease the font sizes, make the value less than `12pt`.
|
||||
|
||||
## Building the theme CSS from source
|
||||
|
||||
If you'd like to make a major change, you can take advantage of Tailwind CSS's JIT compiler and rebuild the entire theme CSS from scratch. This is useful if you want to adjust the Tailwind configuration or add extra Tailwind classes to the main stylesheet.
|
||||
|
||||
{{< alert >}}
|
||||
**Note:** Building the theme manually is intended for advanced users.
|
||||
{{< /alert >}}
|
||||
|
||||
Let's step through how building the Tailwind CSS works.
|
||||
|
||||
### Tailwind configuration
|
||||
|
||||
In order to generate a CSS file that only contains the Tailwind classes that are actually being used the JIT compiler needs to scan through all the HTML templates and Markdown content files to check which styles are present in the markup. The compiler does this by looking at the `tailwind.config.js` file which is included in the root of the theme directory:
|
||||
|
||||
```js
|
||||
// themes/congo/tailwind.config.js
|
||||
|
||||
module.exports = {
|
||||
content: [
|
||||
"./layouts/**/*.html",
|
||||
"./content/**/*.{html,md}",
|
||||
"./themes/congo/layouts/**/*.html",
|
||||
"./themes/congo/content/**/*.{html,md}",
|
||||
],
|
||||
|
||||
// and more...
|
||||
};
|
||||
```
|
||||
|
||||
This default configuration has been included with these content paths so that you can easily generate your own CSS file without needing to modify it, provided you follow a particular project structure. Namely, **you have to include Congo in your project as a subdirectory at `themes/congo/`**. This means you cannot easily use Hugo Modules to install the theme and you must go down either the git submodule (recommended) or manual install routes. The [Installation docs]({{< ref "installation" >}}) explain how to install the theme using either of these methods.
|
||||
|
||||
### Project structure
|
||||
|
||||
In order to take advantage of the default configuration, your project should look something like this...
|
||||
|
||||
```shell
|
||||
.
|
||||
├── assets
|
||||
│ └── css
|
||||
│ └── compiled
|
||||
│ └── main.css # this is the file we will generate
|
||||
├── config # site config
|
||||
│ └── _default
|
||||
├── content # site content
|
||||
│ ├── _index.md
|
||||
│ ├── projects
|
||||
│ │ └── _index.md
|
||||
│ └── blog
|
||||
│ └── _index.md
|
||||
├── layouts # custom layouts for your site
|
||||
│ ├── partials
|
||||
│ │ └── extend-article-link.html
|
||||
│ ├── projects
|
||||
│ │ └── list.html
|
||||
│ └── shortcodes
|
||||
│ └── disclaimer.html
|
||||
└── themes
|
||||
└── congo # git submodule or manual theme install
|
||||
```
|
||||
|
||||
This example structure adds a new `projects` content type with its own custom layout along with a custom shortcode and extended partial. Provided the project follows this structure, all that's required is to recompile the `main.css` file.
|
||||
|
||||
### Install dependencies
|
||||
|
||||
In order for this to work you'll need to change into the `themes/congo/` directory and install the project dependencies. You'll need [npm](https://docs.npmjs.com/cli/v7/configuring-npm/install) on your local machine for this step.
|
||||
|
||||
```shell
|
||||
cd themes/congo
|
||||
npm install
|
||||
```
|
||||
|
||||
### Run the Tailwind compiler
|
||||
|
||||
With the dependencies installed all that's left is to use [Tailwind CLI](https://v2.tailwindcss.com/docs/installation#using-tailwind-cli) to invoke the JIT compiler. Navigate back to the root of your Hugo project and issue the following command:
|
||||
|
||||
```shell
|
||||
cd ../..
|
||||
./themes/congo/node_modules/tailwindcss/lib/cli.js -c ./themes/congo/tailwind.config.js -i ./themes/congo/assets/css/main.css -o ./assets/css/compiled/main.css --jit
|
||||
```
|
||||
|
||||
It's a bit of an ugly command due to the paths involved but essentially you're calling Tailwind CLI and passing it the location of the Tailwind config file (the one we looked at above), where to find the theme's `main.css` file and then where you want the compiled CSS file to be placed (it's going into the `assets/css/compiled/` folder of your Hugo project).
|
||||
|
||||
The config file will automatically inspect all the content and layouts in your project as well as all those in the theme and build a new CSS file that contains all the CSS required for your website. Due to the way Hugo handles file hierarchy, this file in your project will now automatically override the one that comes with the theme.
|
||||
|
||||
Each time you make a change to your layouts and need new Tailwind CSS styles, you can simply re-run the command and generate the new CSS file. You can also add `-w` to the end of the command to run the JIT compiler in watch mode.
|
||||
|
||||
### Make a build script
|
||||
|
||||
To fully complete this solution, you can simplify this whole process by adding aliases for these commands, or do what I do and add a `package.json` to the root of your project which contains the necessary scripts...
|
||||
|
||||
```js
|
||||
// package.json
|
||||
|
||||
{
|
||||
"name": "my-website",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"scripts": {
|
||||
"server": "hugo server -b http://localhost -p 8000",
|
||||
"dev": "NODE_ENV=development ./themes/congo/node_modules/tailwindcss/lib/cli.js -c ./themes/congo/tailwind.config.js -i ./themes/congo/assets/css/main.css -o ./assets/css/compiled/main.css --jit -w",
|
||||
"build": "NODE_ENV=production ./themes/congo/node_modules/tailwindcss/lib/cli.js -c ./themes/congo/tailwind.config.js -i ./themes/congo/assets/css/main.css -o ./assets/css/compiled/main.css --jit"
|
||||
},
|
||||
// and more...
|
||||
}
|
||||
```
|
||||
|
||||
Now when you want to work on designing your site, you can invoke `npm run dev` and the compiler will run in watch mode. When you're ready to deploy, run `npm run build` and you'll get a clean Tailwind CSS build.
|
||||
|
||||
🙋♀️ If you need help, feel free to ask a question on [GitHub Discussions](https://github.com/jpanther/congo/discussions).
|
||||
168
exampleSite/content/docs/configuration.md
Normal file
@@ -0,0 +1,168 @@
|
||||
---
|
||||
title: "Configuration"
|
||||
date: 2020-08-14
|
||||
draft: false
|
||||
description: "All the configuration variables available in Congo."
|
||||
slug: "configuration"
|
||||
tags: ["config", "docs"]
|
||||
---
|
||||
|
||||
Congo is a highly customisable theme and uses some of the latest Hugo features to simplify how it is configured.
|
||||
|
||||
The theme ships with a default configuration that gets you up and running with a basic blog or static website.
|
||||
|
||||
> Configuration files bundled with the theme are provided in TOML format as this is the default Hugo syntax. Feel free to convert your config to YAML or JSON if you wish.
|
||||
|
||||
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.
|
||||
{{< /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.
|
||||
|
||||
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`).
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
|Name|Default|Description|
|
||||
|---|---|---|
|
||||
|`theme`|`"congo"`|When using Hugo Modules this config value should be removed. For all other installation types, this must be set to `congo` for the theme to function.|
|
||||
|`baseURL`|_Not set_|The URL to the root of the website.|
|
||||
|`defaultContentLanguage`|`"en"`|This value determines the default language of theme components and content. Refer to the [language and i18n](#language-and-i18n) section below for supported language codes.|
|
||||
|`enableRobotsTXT`|`true`|When enabled, a `robots.txt` file will be created in the site root that allows search engines to crawl the entire site. If you prefer to provide your own pre-made `robots.txt`, set to `false` and place your file in the `static` directory. For complete control, you may provide a [custom layout]({{< ref "content-examples#custom-layouts" >}}) to generate this file.|
|
||||
|`paginate`|`10`|The number of articles listed on each page of the article listing.|
|
||||
|`summaryLength`|`0`|The number of words that are used to generate the article summary when one is not provided in the [front matter]({{< ref "front-matter" >}}). A value of `0` will use the first sentence. This value has no effect when summaries are hidden.|
|
||||
|`outputs.home`|`["HTML", "RSS", "JSON"]`|The output formats that are generated for the site. Congo requires HTML, RSS and JSON for all theme components to work correctly.|
|
||||
|`permalinks`|_Not set_|Refer to the [Hugo docs](https://gohugo.io/content-management/urls/#permalinks) for permalink configuration.|
|
||||
|`taxonomies`|_Not set_|Refer to the [Organising content]({{< ref "getting-started#organising-content" >}}) section for taxonomy configuration.|
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
## Language and i18n
|
||||
|
||||
Congo is optimised for full multilingual websites and theme assets are translated into several languages out of the box. The language configuration allows you to generate multiple versions of your content to provide a customised experience to your visitors in their native language.
|
||||
|
||||
The theme currently supports the following languages by default:
|
||||
|
||||
| Language | Code |
|
||||
| -------------------------------------- | ------- |
|
||||
| :gb: English | `en` |
|
||||
| :bangladesh: Bengali | `bn` |
|
||||
| :cn: Simplified Chinese (China) | `zh-cn` |
|
||||
| :taiwan: Traditional Chinese (Taiwan) | `zh-tw` |
|
||||
| :finland: Finnish | `fi` |
|
||||
| :fr: French | `fr` |
|
||||
| :de: German | `de` |
|
||||
| :israel: Hebrew | `he` |
|
||||
| :hungary: Hungarian | `hu` |
|
||||
| :it: Italian | `it` |
|
||||
| :jp: Japanese | `ja` |
|
||||
| :brazil: Portuguese (Brazil) | `pt-br` |
|
||||
| :portugal: Portuguese (Portugal) | `pt-pt` |
|
||||
| :romania: Romanian | `ro` |
|
||||
| :es: Spanish (Spain) | `es` |
|
||||
| :tr: Turkish | `tr` |
|
||||
|
||||
The default translations can be overridden by creating a custom file in `i18n/[code].yaml` that contains the translation strings. You can also use this method to add new languages. If you'd like to share a new translation with the community, please [open a pull request](https://github.com/jpanther/congo/pulls).
|
||||
|
||||
### Configuration
|
||||
|
||||
In order to be as flexible as possible, a language configuration file needs to be created for each language on the website. By default Congo includes an English language configuration at `config/_default/languages.en.toml`.
|
||||
|
||||
The default file can be used as a template to create additional languages, or renamed if you wish to author your website in a language other than English. Simply name the file using the format `languages.[language-code].toml`.
|
||||
|
||||
{{< alert >}}
|
||||
**Note:** Ensure the `defaultContentLanguage` parameter in the [site configuration](#site-configuration) matches the language code in your language config filename.
|
||||
{{< /alert >}}
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
|Name|Default|Description|
|
||||
|---|---|---|
|
||||
|`languageCode`|`"en"`|The Hugo language code for this file. It can be a top-level language (ie. `en`) or a sub-variant (ie. `en-au`) and should match the language code in the filename. Hugo expects this value to always be in lowercase. For proper HTML compliance, set the `isoCode` parameter which is case-sensitive.|
|
||||
|`languageName`|`"English"`|The name of the language.|
|
||||
|`displayName`|`"EN"`|The name used when the language appears on the website.|
|
||||
|`isoCode`|`"en"`|The ISO language code for HTML metadata purposes. It can be a top-level language (ie. `en`) or a sub-variant (ie. `en-AU`).|
|
||||
|`weight`|`1`|The weight determines the order of languages when building multilingual sites.|
|
||||
|`rtl`|`false`|Whether or not this is a RTL language. Set to `true` to reflow content from right-to-left. Congo fully supports using RTL and LTR languages at the same time and will dynamically adjust to both.|
|
||||
|`dateFormat`|`"2 January 2006"`|How dates are formatted in this language. Refer to the [Hugo docs](https://gohugo.io/functions/format/#gos-layout-string) for acceptable formats.|
|
||||
|`title`|`"Congo"`|The title of the website. This will be displayed in the site header and footer.|
|
||||
|`description`|_Not set_|The website description. This will be used in the site metadata.|
|
||||
|`copyright`|_Not set_|A Markdown string containing the copyright message to be displayed in the site footer. If none is provided, Congo will automatically generate a copyright string using the site `title`.|
|
||||
|`author.name`|_Not set_|The author's name. This will be displayed in article footers, and on the homepage when the profile layout is used.|
|
||||
|`author.image`|_Not set_|Path to the image file of the author. The image should be a 1:1 aspect ratio and placed in the site's `assets/` folder.|
|
||||
|`author.headline`|_Not set_|A Markdown string containing the author's headline. It will be displayed on the profile homepage under the author's name.|
|
||||
|`author.bio`|_Not set_|A Markdown string containing the author's bio. It will be displayed in article footers.|
|
||||
|`author.links`|_Not set_|The links to display alongside the author's details. The config file contains example links which can simply be uncommented to enable. The order that the links are displayed is determined by the order they appear in the array. Custom links can be added by providing corresponding SVG icon assets in `assets/icons/`.|
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
### Menus
|
||||
|
||||
Congo also supports language-specific menu configurations. Menu config files follow the same naming format as the languages file. Simply provide the language code in the file name to tell Hugo which language the file relates to.
|
||||
|
||||
Menu config files are named with the format `menus.[language-code].toml`. Always ensure that the language code used in the menus configuration matches the languages configuration.
|
||||
|
||||
The [Getting Started]({{< ref "getting-started#menus" >}}) section explains more about the structure of this file. You can also refer to the [Hugo menu docs](https://gohugo.io/content-management/menus/) for more configuration examples.
|
||||
|
||||
## Theme parameters
|
||||
|
||||
Congo provides a large number of configuration parameters that control how the theme functions. The table below outlines every available parameter in the `config/_default/params.toml` file.
|
||||
|
||||
Many of the article defaults here can be overridden on a per article basis by specifying it in the front matter. Refer to the [Front Matter]({{< ref "front-matter" >}}) section for further details.
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
|Name|Default|Description|
|
||||
|---|---|---|
|
||||
|`colorScheme`|`"congo"`|The theme colour scheme to use. Valid values are `congo` (default), `avocado`, `ocean`, `fire` and `slate`. Refer to the [Colour Schemes]({{< ref "getting-started#colour-schemes" >}}) section for more details.|
|
||||
|`defaultAppearance`|`"light"`|The default theme appearance, either `light` or `dark`.|
|
||||
|`autoSwitchAppearance`|`true`|Whether the theme appearance automatically switches based upon the visitor's operating system preference. Set to `false` to force the site to always use the `defaultAppearance`.|
|
||||
|`enableSearch`|`false`|Whether site search is enabled. Set to `true` to enable search functionality. Note that the search feature depends on the `outputs.home` setting in the [site configuration](#site-configuration) being set correctly.|
|
||||
|`enableCodeCopy`|`false`|Whether copy-to-clipboard buttons are enabled for `<code>` blocks. The `highlight.noClasses` parameter must be set to `false` for code copy to function correctly. Read more about [other configuration files](#other-configuration-files) below.|
|
||||
|`logo`|_Not set_|The relative path to the site logo file within the `assets/` folder. The logo file should be provided at 2x resolution and supports any image dimensions.|
|
||||
|`mainSections`|_Not set_|The sections that should be displayed in the recent articles list. If not provided the section with the greatest number of articles is used.|
|
||||
|`robots`|_Not set_|String that indicates how robots should handle your site. If set, it will be output in the page head. Refer to [Google's docs](https://developers.google.com/search/docs/advanced/robots/robots_meta_tag#directives) for valid values.|
|
||||
|`header.layout`|`"basic"`|The layout of the page header and menu. Valid values are `basic`, `hamburger` or `custom`. When set to `custom`, you must provide your own layout by creating a `/layouts/partials/header/custom.html` file.|
|
||||
|`footer.showCopyright`|`true`|Whether or not to show the copyright string in the site footer. Note that the string itself can be customised using the `copyright` parameter in the [languages configuration](#language-and-i18n).|
|
||||
|`footer.showThemeAttribution`|`true`|Whether or not to show the "powered by" theme attribution in the site footer. If you choose to disable this message, please consider attributing the theme somewhere else on your site (for example, on your about page).|
|
||||
|`footer.showAppearanceSwitcher`|`false`|Whether or not to show the appearance switcher in the site footer. The browser's local storage is used to persist the visitor's preference.|
|
||||
|`footer.showScrollToTop`|`true`|When set to `true` the scroll to top arrow is displayed.|
|
||||
|`homepage.layout`|`"page"`|The layout of the homepage. Valid values are `page`, `profile` or `custom`. When set to `custom`, you must provide your own layout by creating a `/layouts/partials/home/custom.html` file. Refer to the [Homepage Layout]({{< ref "homepage-layout" >}}) section for more details.|
|
||||
|`homepage.showRecent`|`false`|Whether or not to display the recent articles list on the homepage.|
|
||||
|`article.showDate`|`true`|Whether or not article dates are displayed.|
|
||||
|`article.showDateUpdated`|`false`|Whether or not the dates articles were updated are displayed.|
|
||||
|`article.showAuthor`|`true`|Whether or not the author box is displayed in the article footer.|
|
||||
|`article.showBreadcrumbs`|`false`|Whether or not breadcrumbs are displayed in the article header.|
|
||||
|`article.showDraftLabel`|`true`|Whether or not the draft indicator is shown next to articles when site is built with `--buildDrafts`.|
|
||||
|`article.showEdit`|`false`|Whether or not the link to edit the article content should be displayed.|
|
||||
|`article.editURL`|_Not set_|When `article.showEdit` is active, the URL for the edit link.|
|
||||
|`article.editAppendPath`|`true`|When `article.showEdit` is active, whether or not the path to the current article should be appended to the URL set at `article.editURL`.|
|
||||
|`article.showHeadingAnchors`|`true`|Whether or not heading anchor links are displayed alongside headings within articles.|
|
||||
|`article.showPagination`|`true`|Whether or not the next/previous article links are displayed in the article footer.|
|
||||
|`article.invertPagination`|`false`|Whether or not to flip the direction of the next/previous article links.|
|
||||
|`article.showReadingTime`|`true`|Whether or not article reading times are displayed.|
|
||||
|`article.showTableOfContents`|`false`|Whether or not the table of contents is displayed on articles.|
|
||||
|`article.showTaxonomies`|`false`|Whether or not the taxonomies related to this article are displayed.|
|
||||
|`article.showWordCount`|`false`|Whether or not article word counts are displayed.|
|
||||
|`article.showComments`|`false`|Whether or not the [comments partial]({{< ref "partials#comments" >}}) is included after the article footer.|
|
||||
|`article.sharingLinks`|_Not set_|Which sharing links to display at the end of each article. When not provided, or set to `false` no links will be displayed.|
|
||||
|`list.showBreadcrumbs`|`false`|Whether or not breadcrumbs are displayed in the header on list pages.|
|
||||
|`list.showTableOfContents`|`false`|Whether or not the table of contents is displayed on list pages.|
|
||||
|`list.showSummary`|`false`|Whether or not article summaries are displayed on list pages. If a summary is not provided in the [front matter]({{< ref "front-matter" >}}), one will be auto generated using the `summaryLength` parameter in the [site configuration](#site-configuration).|
|
||||
|`list.groupByYear`|`true`|Whether or not articles are grouped by year on list pages.|
|
||||
|`sitemap.excludedKinds`|`["taxonomy", "term"]`|Kinds of content that should be excluded from the generated `/sitemap.xml` file. Refer to the [Hugo docs](https://gohugo.io/templates/section-templates/#page-kinds) for acceptable values.|
|
||||
|`taxonomy.showTermCount`|`true`|Whether or not the number of articles within a taxonomy term is displayed on the taxonomy listing.|
|
||||
|`fathomAnalytics.site`|_Not set_|The site code generated by Fathom Analytics for the website. Refer to the [Analytics docs]({{< ref "partials#analytics" >}}) for more details.|
|
||||
|`fathomAnalytics.domain`|_Not set_|If using a custom domain with Fathom Analytics, provide it here to serve `script.js` from the custom domain.|
|
||||
|`verification.google`|_Not set_|The site verification string provided by Google to be included in the site metadata.|
|
||||
|`verification.bing`|_Not set_|The site verification string provided by Bing to be included in the site metadata.|
|
||||
|`verification.pinterest`|_Not set_|The site verification string provided by Pinterest to be included in the site metadata.|
|
||||
|`verification.yandex`|_Not set_|The site verification string provided by Yandex to be included in the site metadata.|
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
## Other configuration files
|
||||
|
||||
The theme also includes a `markup.toml` configuration file. This file contains some important parameters that ensure that Hugo is correctly configured to generate sites built with Congo.
|
||||
|
||||
Always ensure this file is present in the config directory and that the required values are set. Failure to do so may cause certain features to fucntion incorrectly and could result in unintended behaviour.
|
||||
316
exampleSite/content/docs/content-examples.md
Normal file
@@ -0,0 +1,316 @@
|
||||
---
|
||||
title: "Content Examples"
|
||||
date: 2020-08-09
|
||||
draft: false
|
||||
description: "All the partials available in Congo."
|
||||
slug: "content-examples"
|
||||
tags: ["content", "example"]
|
||||
---
|
||||
|
||||
If you've been reading the documentation in order, you should now know about all the features and configurations available in Congo. This page is designed to pull everything together and offer some worked examples that you might like to use in your Hugo project.
|
||||
|
||||
{{< alert >}}
|
||||
**Tip:** If you're new to Hugo, be sure to check out the [official docs](https://gohugo.io/content-management/page-bundles/) to learn more about the concept of page bundles and resources.
|
||||
{{< /alert >}}
|
||||
|
||||
The examples on this page can all be adapted to different scenarios but hopefully give you some ideas about how to approach formatting a particular content item for your individual project.
|
||||
|
||||
## Branch pages
|
||||
|
||||
Branch page bundles in Hugo cover items like the homepage, section listings, and taxonomy pages. The important thing to remember about branch bundles is that the filename for this content type is **`_index.md`**.
|
||||
|
||||
Congo will honour the front matter parameters specified in branch pages and these will override the default settings for that particular page. For example, setting the `title` parameter in a branch page will allow overriding the page title.
|
||||
|
||||
### Homepage
|
||||
|
||||
| | |
|
||||
| ------------ | -------------------- |
|
||||
| **Layout:** | `layouts/index.html` |
|
||||
| **Content:** | `content/_index.md` |
|
||||
|
||||
The homepage in Congo is special in that it's overarching design is controlled by the homepage layout config parameter. You can learn more about this in the [Homepage Layout]({{< ref "homepage-layout" >}}) section.
|
||||
|
||||
If you want to add custom content to this page, you simply need to create a `content/_index.md` file. Anything in this file will then be included in your homepage.
|
||||
|
||||
**Example:**
|
||||
|
||||
```yaml
|
||||
---
|
||||
title: "Welcome to Congo!"
|
||||
description: "This is a demo of adding content to the homepage."
|
||||
---
|
||||
Welcome to my website! I'm really happy you stopped by.
|
||||
```
|
||||
|
||||
_This example sets a custom title and adds some additional text to the body of the page. Any Markdown formatted text is acceptable, including shortcodes, images and links._
|
||||
|
||||
### List pages
|
||||
|
||||
| | |
|
||||
| ------------ | ---------------------------- |
|
||||
| **Layout:** | `layouts/_default/list.html` |
|
||||
| **Content:** | `content/../_index.md` |
|
||||
|
||||
List pages group all the pages within into a section and provide a way for visitors to reach each page. A blog or portfolio are examples of a list page as they group together posts or projects.
|
||||
|
||||
Creating a list page is as simple as making a sub-directory in the content folder. For example, to create a "Projects" section, you would create `content/projects/`. Then create a Markdown file for each of your projects.
|
||||
|
||||
A list page will be generated by default, however to customise the content, you should also create an `_index.md` page in this new directory.
|
||||
|
||||
```shell
|
||||
.
|
||||
└── content
|
||||
└── projects
|
||||
├── _index.md # /projects
|
||||
├── first-project.md # /projects/first-project
|
||||
└── another-project
|
||||
├── index.md # /projects/another-project
|
||||
└── project.jpg
|
||||
```
|
||||
|
||||
Hugo will generate URLs for the pages in your projects folder accordingly.
|
||||
|
||||
Just like the homepage, content in the `_index.md` file will be output into the generated list index. Congo will then list any pages in this section below the content.
|
||||
|
||||
**Example:**
|
||||
|
||||
```yaml
|
||||
---
|
||||
title: "Projects"
|
||||
description: "Learn about some of my projects."
|
||||
cascade:
|
||||
showReadingTime: false
|
||||
---
|
||||
This section contains all my current projects.
|
||||
```
|
||||
|
||||
_In this example, the special `cascade` parameter is being used to hide the reading time on any sub-pages within this section. By doing this, any project pages will not have their reading time showing. This is a great way to override default theme parameters for an entire section without having to include them in every individual page._
|
||||
|
||||
The [samples section]({{< ref "samples" >}}) of this site is an example of a list page.
|
||||
|
||||
### Taxonomy pages
|
||||
|
||||
| | |
|
||||
| ---------------- | -------------------------------- |
|
||||
| **List layout:** | `layouts/_default/taxonomy.html` |
|
||||
| **Term layout:** | `layouts/_default/term.html` |
|
||||
| **Content:** | `content/../_index.md` |
|
||||
|
||||
Taxonomy pages come in two forms - taxonomy lists and taxonomy terms. Lists display a listing of each of the terms within a given taxonomy, while terms display a list of pages that are related to a given term.
|
||||
|
||||
The terminology can get a little confusing so let's explore an example using a taxonomy named `animals`.
|
||||
|
||||
Firstly, to use taxonomies in Hugo, they have to be configured. This is done by creating a config file at `config/_default/taxonomies.toml` and defining the taxonomy name.
|
||||
|
||||
```toml
|
||||
# config/_default/taxonomies.toml
|
||||
|
||||
animal = "animals"
|
||||
```
|
||||
|
||||
Hugo expects taxonomies to be listed using their singular and plural forms, so we add the singular `animal` equals the plural `animals` to create our example taxonomy.
|
||||
|
||||
Now that our `animals` taxonomy exists, it needs to be added to individual content items. It's as simple as inserting it into the front matter:
|
||||
|
||||
```yaml
|
||||
---
|
||||
title: "Into the Lion's Den"
|
||||
description: "This week we're learning about lions."
|
||||
animals: ["lion", "cat"]
|
||||
---
|
||||
```
|
||||
|
||||
This has now created two _terms_ within our `animals` taxonomy - `lion` and `cat`.
|
||||
|
||||
Although it's not obvious at this point, Hugo will now be generating list and term pages for this new taxonomy. By default the listing can be accessed at `/animals/` and the term pages can be found at `/animals/lion/` and `/animals/cat/`.
|
||||
|
||||
The list page will list all the terms contained within the taxonomy. In this example, navigating to `/animals/` will show a page that has links for "lion" and "cat" which take visitors to the individual term pages.
|
||||
|
||||
The term pages will list all the pages contained within that term. These term lists are essentially the same as normal [list pages](#list-pages) and behave in much the same way.
|
||||
|
||||
In order to add custom content to taxonomy pages, simply create `_index.md` files in the content folder using the taxonomy name as the sub-directory name.
|
||||
|
||||
```shell
|
||||
.
|
||||
└── content
|
||||
└── animals
|
||||
├── _index.md # /animals
|
||||
└── lion
|
||||
└── _index.md # /animals/lion
|
||||
```
|
||||
|
||||
Anything in these content files will now be placed onto the generated taxonomy pages. As with other content, the front matter variables can be used to override defaults. In this way you could have a tag named `lion` but override the `title` to be "Lion".
|
||||
|
||||
To see how this looks in reality, check out the [tags taxonomy listing]({{< ref "tags" >}}) on this site.
|
||||
|
||||
## Leaf pages
|
||||
|
||||
| | |
|
||||
| ------------------------- | ------------------------------- |
|
||||
| **Layout:** | `layouts/_default/single.html` |
|
||||
| **Content (standalone):** | `content/../page-name.md` |
|
||||
| **Content (bundled):** | `content/../page-name/index.md` |
|
||||
|
||||
Leaf pages in Hugo are basically standard content pages. They are defined as pages that don't contain any sub-pages. These could be things like an about page, or an individual blog post that lives in the blog section of the website.
|
||||
|
||||
The most important thing to remember about leaf pages is that unlike branch pages, leaf pages should be named `index.md` _without_ an underscore. Leaf pages are also special in that they can be grouped together at the top level of the section and named with a unique name.
|
||||
|
||||
```shell
|
||||
.
|
||||
└── content
|
||||
└── blog
|
||||
├── first-post.md # /blog/first-post
|
||||
├── second-post.md # /blog/second-post
|
||||
└── third-post
|
||||
├── index.md # /blog/third-post
|
||||
└── image.jpg
|
||||
```
|
||||
|
||||
When including assets in a page, like an image, a page bundle should be used. Page bundles are created using a sub-directory with an `index.md` file. Grouping the assets with the content in its own directory is important as many of the shortcodes and other theme logic assumes that resources are bundled alongside pages.
|
||||
|
||||
**Example:**
|
||||
|
||||
```yaml
|
||||
---
|
||||
title: "My First Blog Post"
|
||||
date: 2022-01-25
|
||||
description: "Welcome to my blog!"
|
||||
summary: "Learn more about me and why I am starting this blog."
|
||||
tags: ["welcome", "new", "about", "first"]
|
||||
---
|
||||
_This_ is the content of my blog post.
|
||||
```
|
||||
|
||||
Leaf pages have a wide variety of [front matter]({{< ref "front-matter" >}}) parameters that can be used to customise how they are displayed.
|
||||
|
||||
### External links
|
||||
|
||||
Congo has a special feature that allows links to external pages to appear alongside articles in the article listings. This is useful if you have content on third party websites like Medium, or research papers that you'd like to link to, without replicating the content in your Hugo site.
|
||||
|
||||
In order to create an external link article, some special front matter needs to be set:
|
||||
|
||||
```yaml
|
||||
---
|
||||
title: "My Medium post"
|
||||
date: 2022-01-25
|
||||
externalUrl: "https://medium.com/"
|
||||
summary: "I wrote a post on Medium."
|
||||
showReadingTime: false
|
||||
_build:
|
||||
render: "false"
|
||||
list: "local"
|
||||
---
|
||||
```
|
||||
|
||||
Along with the normal front matter parameters like `title` and `summary`, the `externalUrl` parameter is used to tell Congo that this is not an ordinary article. The URL provided here will be where visitors are directed when they select this article.
|
||||
|
||||
Additionally, we use a special Hugo front matter parameter `_build` to prevent a normal page for this content being generated - there's no point generating a page since we're linking to an external URL!
|
||||
|
||||
The theme includes an archetype to make generating these external link articles simple. Just specify `-k external` when making new content.
|
||||
|
||||
```shell
|
||||
hugo new -k external posts/my-post.md
|
||||
```
|
||||
|
||||
### Simple pages
|
||||
|
||||
| | |
|
||||
| ----------------- | ------------------------------ |
|
||||
| **Layout:** | `layouts/_default/simple.html` |
|
||||
| **Front Matter:** | `layout: "simple"` |
|
||||
|
||||
Congo also includes a special layout for simple pages. The simple layout is a full-width template that just places Markdown content into the page without any special theme features.
|
||||
|
||||
The only features available in the simple layout are breadcrumbs and sharing links. However, the behaviour of these can still be controlled using the normal page [front matter]({{< ref "front-matter" >}}) variables.
|
||||
|
||||
To enable the simple layout on a particular page, add the `layout` front matter variable with a value of `"simple"`:
|
||||
|
||||
```yaml
|
||||
---
|
||||
title: "My landing page"
|
||||
date: 2022-03-08
|
||||
layout: "simple"
|
||||
---
|
||||
This page content is now full-width.
|
||||
```
|
||||
|
||||
## Custom layouts
|
||||
|
||||
One of the benefits of Hugo is that it makes it easy to create custom layouts for the whole site, individual sections or pages.
|
||||
|
||||
Layouts follow all the normal Hugo templating rules and more information is available in the [official Hugo docs](https://gohugo.io/templates/introduction/).
|
||||
|
||||
### Overriding default layouts
|
||||
|
||||
Each of the content types discussed above lists the layout file that is used to generate each type of page. If this file is created in your local project it will override the theme template and thus can be used to customise the default style of the website.
|
||||
|
||||
For example, creating a `layouts/_default/single.html` file will allow the layout of leaf pages to be completely customised.
|
||||
|
||||
### Custom section layouts
|
||||
|
||||
It is also simple to create custom layouts for individual content sections. This is useful when you want to make a section that lists a certain type of content using a particular style.
|
||||
|
||||
Let's step through an example that creates a custom "Projects" page that lists projects using a special layout.
|
||||
|
||||
In order to do this, structure your content using the normal Hugo content rules and create a section for your projects. Additionally, create a new layout for the projects section by using the same directory name as the content and adding a `list.html` file.
|
||||
|
||||
```shell
|
||||
.
|
||||
└── content
|
||||
│ └── projects
|
||||
│ ├── _index.md
|
||||
│ ├── first-project.md
|
||||
│ └── second-project.md
|
||||
└── layouts
|
||||
└── projects
|
||||
└── list.html
|
||||
```
|
||||
|
||||
This `list.html` file will now override the default list template, but only for the `projects` section. Before we look at this file, lets first look at the individual project files.
|
||||
|
||||
```yaml
|
||||
---
|
||||
title: "Congo"
|
||||
date: 2021-08-11
|
||||
icon: "github"
|
||||
description: "A theme for Hugo built with Tailwind CSS."
|
||||
topics: ["Hugo", "Web", "Tailwind"]
|
||||
externalUrl: "https://github.com/jpanther/congo/"
|
||||
---
|
||||
```
|
||||
|
||||
_In this example we are assigning some metadata for each project that we can then use in our list template. There's no page content, but there's nothing stopping you from including it. It's your own custom template after all!_
|
||||
|
||||
With the projects defined, now we can create a list template that outputs the details of each project.
|
||||
|
||||
```go
|
||||
{{ define "main" }}
|
||||
<section class="mt-8">
|
||||
{{ range .Pages }}
|
||||
<article class="pb-6">
|
||||
<a class="flex" href="{{ .Params.externalUrl }}">
|
||||
<div class="mr-3 text-3xl text-neutral-300">
|
||||
<span class="relative inline-block align-text-bottom">
|
||||
{{ partial "icon.html" .Params.icon }}
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="flex text-xl font-semibold">
|
||||
{{ .Title }}
|
||||
</h3>
|
||||
<p class="text-sm text-neutral-400">
|
||||
{{ .Description }}
|
||||
</p>
|
||||
</div>
|
||||
</a>
|
||||
</article>
|
||||
{{ end }}
|
||||
</section>
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
Although this is quite a straightforward example, you can see that it steps through each of the pages in this section (ie. each project), and then outputs HTML links to each project alongside an icon. The metadata in the front matter for each project is used to determine which information is displayed.
|
||||
|
||||
Keep in mind that you'll need to ensure the relevant styles and classes are available, which may require the Tailwind CSS to be recompiled. This is discussed in more detail in the [Advanced Customisation]({{< ref "advanced-customisation" >}}) section.
|
||||
|
||||
When making custom templates like this one, it's always easiest to take a look at how the default Congo template works and then use that as a guide. Remember, the [Hugo docs](https://gohugo.io/templates/introduction/) are a great resource to learn more about creating templates too.
|
||||
42
exampleSite/content/docs/front-matter.md
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
title: "Front Matter"
|
||||
date: 2020-08-12
|
||||
draft: false
|
||||
description: "All the front matter variables available in Congo."
|
||||
slug: "front-matter"
|
||||
tags: ["front matter", "config", "docs"]
|
||||
---
|
||||
|
||||
In addition to the [default Hugo front matter parameters](https://gohugo.io/content-management/front-matter/#front-matter-variables), Congo adds a number of additional options to customise the presentation of individual articles. All the available theme front matter parameters are listed below.
|
||||
|
||||
Front matter parameter default values are inherited from the theme's [base configuration]({{< ref "configuration" >}}), so you only need to specify these parameters in your front matter when you want to override the default.
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
|Name|Default|Description|
|
||||
|---|---|---|
|
||||
|`title`|_Not set_|The name of the article.|
|
||||
|`description`|_Not set_|The text description for the article. It is used in the HTML metadata.|
|
||||
|`externalUrl`|_Not set_|If this article is published on a third-party website, the URL to this article. Providing a URL will prevent a content page being generated and any references to this article will link directly to the third-party website.|
|
||||
|`editURL`|`article.editURL`|When `showEdit` is active, the URL for the edit link.|
|
||||
|`editAppendPath`|`article.editAppendPath`|When `showEdit` is active, whether or not the path to the current article should be appended to the URL set at `editURL`.|
|
||||
|`groupByYear`|`list.groupByYear`|Whether or not articles are grouped by year on list pages.|
|
||||
|`menu`|_Not set_|When a value is provided, a link to this article will appear in the named menus. Valid values are `main` or `footer`.|
|
||||
|`robots`|_Not set_|String that indicates how robots should handle this article. If set, it will be output in the page head. Refer to [Google's docs](https://developers.google.com/search/docs/advanced/robots/robots_meta_tag#directives) for valid values.|
|
||||
|`sharingLinks`|`article.sharingLinks`|Which sharing links to display at the end of this article. When not provided, or set to `false` no links will be displayed.|
|
||||
|`showAuthor`|`article.showAuthor`|Whether or not the author box is displayed in the article footer.|
|
||||
|`showBreadcrumbs`|`article.showBreadcrumbs` or `list.showBreadcrumbs`|Whether the breadcrumbs are displayed in the article or list header.|
|
||||
|`showDate`|`article.showDate`|Whether or not the article date is displayed. The date is set using the `date` parameter.|
|
||||
|`showDateUpdated`|`article.showDateUpdated`|Whether or not the date the article was updated is displayed. The date is set using the `lastmod` parameter.|
|
||||
|`showEdit`|`article.showEdit`|Whether or not the link to edit the article content should be displayed.|
|
||||
|`showHeadingAnchors`|`article.showHeadingAnchors`|Whether or not heading anchor links are displayed alongside headings within this article.|
|
||||
|`showPagination`|`article.showPagination`|Whether or not the next/previous article links are displayed in the article footer.|
|
||||
|`invertPagination`|`article.invertPagination`|Whether or not to flip the direction of the next/previous article links.|
|
||||
|`showReadingTime`|`article.showReadingTime`|Whether or not the article reading time is displayed.|
|
||||
|`showTaxonomies`|`article.showTaxonomies`|Whether or not the taxonomies that relate to this article are displayed.|
|
||||
|`showTableOfContents`|`article.showTableOfContents`|Whether or not the table of contents is displayed on this article.|
|
||||
|`showWordCount`|`article.showWordCount`|Whether or not the article word count is displayed.|
|
||||
|`showComments`|`article.showComments`|Whether or not the [comments partial]({{< ref "partials#comments" >}}) is included after the article footer.|
|
||||
|`showSummary`|`list.showSummary`|Whether or not the article summary should be displayed on list pages.|
|
||||
|`summary`|Auto generated using `summaryLength` (see [site configuration]({{< ref "configuration#site-configuration" >}}))|When `showSummary` is enabled, this is the Markdown string to be used as the summary for this article.|
|
||||
|`xml`|`true` unless excluded by `sitemap.excludedKinds`|Whether or not this article is included in the generated `/sitemap.xml` file.|
|
||||
<!-- prettier-ignore-end -->
|
||||
164
exampleSite/content/docs/getting-started.md
Normal file
@@ -0,0 +1,164 @@
|
||||
---
|
||||
title: "Getting Started"
|
||||
date: 2020-08-15
|
||||
draft: false
|
||||
description: "All the front matter variables available in Congo."
|
||||
slug: "getting-started"
|
||||
tags: ["installation", "docs"]
|
||||
---
|
||||
|
||||
{{< alert >}}
|
||||
This section assumes you have already [installed the Congo theme]({{< ref "docs/installation" >}}).
|
||||
{{< /alert >}}
|
||||
|
||||
The config files that ship with Congo contain all of the possible settings that the theme recognises. By default, many of these are commented out but you can simply uncomment them to activate or change a specific feature.
|
||||
|
||||
## 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.
|
||||
|
||||
```toml
|
||||
# config/_default/config.toml
|
||||
|
||||
baseURL = "https://your_domain.com/"
|
||||
languageCode = "en"
|
||||
```
|
||||
|
||||
The next step is to configure the language settings. Although Congo supports multilingual setups, for now, just configure the main language.
|
||||
|
||||
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 >}}
|
||||
Note that the language code in the language config filename should match the `languageCode` setting in `config.toml`.
|
||||
{{< /alert >}}
|
||||
|
||||
```toml
|
||||
# config/_default/languages.en.toml
|
||||
|
||||
title = "My awesome website"
|
||||
|
||||
[author]
|
||||
name = "My name"
|
||||
image = "img/author.jpg"
|
||||
headline = "A generally awesome human"
|
||||
bio = "A little bit about me"
|
||||
links = [
|
||||
{ twitter = "https://twitter.com/username" }
|
||||
]
|
||||
```
|
||||
|
||||
The `[author]` configuration determines how the author information is displayed on the website. The image should be placed in the site's `assets/` folder. Links will be displayed in the order they are listed.
|
||||
|
||||
If you need extra detail, further information about each of these configuration options, is covered in the [Configuration]({{< ref "configuration" >}}) section.
|
||||
|
||||
## Colour schemes
|
||||
|
||||
Congo ships with a number of colour schemes out of the box. To change the scheme, simply set the `colorScheme` theme parameter. Valid options are `congo` (default), `avocado`, `fire`, `ocean` and `slate`.
|
||||
|
||||
```toml
|
||||
# config/_default/params.toml
|
||||
|
||||
colorScheme = "congo"
|
||||
```
|
||||
|
||||
Congo defines a three-colour palette that is used throughout the theme. Each main colour contains ten shades which are based upon the colours that are included in [Tailwind](https://tailwindcss.com/docs/customizing-colors#color-palette-reference).
|
||||
|
||||
#### Congo (default)
|
||||
|
||||
{{< swatches "#71717a" "#8b5cf6" "#d946ef" >}}
|
||||
|
||||
#### Avocado
|
||||
|
||||
{{< swatches "#78716c" "#84cc16" "#10b981" >}}
|
||||
|
||||
#### Fire
|
||||
|
||||
{{< swatches "#78716c" "#f97316" "#f43f5e" >}}
|
||||
|
||||
#### Ocean
|
||||
|
||||
{{< swatches "#64748b" "#3b82f6" "#06b6d4" >}}
|
||||
|
||||
#### Slate
|
||||
|
||||
{{< swatches "#6B7280" "#64748b" "#6B7280" >}}
|
||||
|
||||
Although these are the default schemes, you can also create your own. Refer to the [Advanced Customisation]({{< ref "advanced-customisation#colour-schemes" >}}) section for details.
|
||||
|
||||
## Organising content
|
||||
|
||||
By default, Congo doesn't force you to use a particular content type. In doing so you are free to define your content as you wish. You might prefer _pages_ for a static site, _posts_ for a blog, or _projects_ for a portfolio.
|
||||
|
||||
Here's a quick overview of a basic Congo project. All content is placed within the `content` folder:
|
||||
|
||||
```shell
|
||||
.
|
||||
├── assets
|
||||
│ └── img
|
||||
│ └── author.jpg
|
||||
├── config
|
||||
│ └── _default
|
||||
├── content
|
||||
│ ├── _index.md
|
||||
│ ├── about.md
|
||||
│ └── posts
|
||||
│ ├── _index.md
|
||||
│ ├── first-post.md
|
||||
│ └── another-post
|
||||
│ ├── aardvark.jpg
|
||||
│ └── index.md
|
||||
└── themes
|
||||
└── congo
|
||||
```
|
||||
|
||||
It's important to have a firm grasp of how Hugo expects content to be organised as the theme is designed to take full advantage of Hugo page bundles. Be sure to read the [official Hugo docs](https://gohugo.io/content-management/organization/) for more information.
|
||||
|
||||
Congo is also flexible when it comes to taxonomies. Some people prefer to use _tags_ and _categories_ to group their content, others prefer to use _topics_.
|
||||
|
||||
Hugo defaults to using posts, tags and categories out of the box and this will work fine if that's what you want. If you wish to customise this, however, you can do so by creating a `taxonomies.toml` configuration file:
|
||||
|
||||
```toml
|
||||
# config/_default/taxonomies.toml
|
||||
|
||||
topic = "topics"
|
||||
```
|
||||
|
||||
This will replace the default _tags_ and _categories_ with _topics_. Refer to the [Hugo Taxonomy docs](https://gohugo.io/content-management/taxonomies/) for more information on naming taxonomies.
|
||||
|
||||
When you create a new taxonomy, you will need to adjust the navigation links on the website to point to the correct sections, which is covered below.
|
||||
|
||||
## Menus
|
||||
|
||||
Congo has two menus that can be customised to suit the content and layout of your site. The `main` menu appears in the site header and the `footer` menu appears at the bottom of the page just above the copyright notice.
|
||||
|
||||
Both menus are configured in the `menus.en.toml` file. Similarly to the languages config file, if you wish to use another language, rename this file and replace `en` with the language code you wish to use.
|
||||
|
||||
```toml
|
||||
# config/_default/menus.toml
|
||||
|
||||
[[main]]
|
||||
name = "Blog"
|
||||
pageRef = "posts"
|
||||
weight = 10
|
||||
|
||||
[[main]]
|
||||
name = "Topics"
|
||||
pageRef = "topics"
|
||||
weight = 20
|
||||
|
||||
[[footer]]
|
||||
name = "Privacy"
|
||||
url = "https://external-link"
|
||||
```
|
||||
|
||||
The `name` parameter specifies the text that is used in the menu link. You can also optionally provide a `title` which fills the HTML title attribute for the link.
|
||||
|
||||
The `pageRef` parameter allows you to easily reference Hugo content pages and taxonomies. It is the quickest way to configure the menu as you can simply refer to any Hugo content item and it will automatically build the correct link. To link to external URLs, the `url` parameter can be used.
|
||||
|
||||
Menu links will be sorted from lowest to highest `weight`, and then alphabetically by `name`.
|
||||
|
||||
Both menus are completely optional and can be commented out if not required. Use the template provided in the file as a guide.
|
||||
|
||||
## Detailed configuration
|
||||
|
||||
The steps above are the bare minimum configuration. If you now run `hugo server` you will be presented with a blank Congo website. Detailed configuration is covered in the [Configuration]({{< ref "configuration" >}}) section.
|
||||
BIN
exampleSite/content/docs/homepage-layout/home-page.jpg
Normal file
|
After Width: | Height: | Size: 241 KiB |
BIN
exampleSite/content/docs/homepage-layout/home-profile-list.jpg
Normal file
|
After Width: | Height: | Size: 103 KiB |
BIN
exampleSite/content/docs/homepage-layout/home-profile.jpg
Normal file
|
After Width: | Height: | Size: 78 KiB |
52
exampleSite/content/docs/homepage-layout/index.md
Normal file
@@ -0,0 +1,52 @@
|
||||
---
|
||||
title: "Homepage Layout"
|
||||
date: 2020-08-13
|
||||
draft: false
|
||||
description: "Configuring the homepage layout in the Congo theme."
|
||||
slug: "homepage-layout"
|
||||
tags: ["homepage", "layouts", "docs"]
|
||||
---
|
||||
|
||||
Congo provides a fully flexible homepage layout. There are two main templates to choose from with additional settings to adjust the design. Alternatively, you can also provide your own template and have complete control over the homepage content.
|
||||
|
||||
The layout of the homepage is controlled by the `homepage.layout` setting in the `params.toml` configuration file. Additionally, all layouts have the option to include a listing of [recent articles](#recent-articles).
|
||||
|
||||
## Page layout
|
||||
|
||||
The default layout is the page layout. It's simply a normal content page that displays your Markdown content. It's great for static websites and provides a lot of flexibility.
|
||||
|
||||

|
||||
|
||||
To enable the page layout, set `homepage.layout = "page"` in the `params.toml` configuration file.
|
||||
|
||||
## Profile layout
|
||||
|
||||
The profile layout is great for personal websites and blogs. It puts the author's details front and centre by providing an image and links to social profiles.
|
||||
|
||||

|
||||
|
||||
The author information is provided in the languages configuration file. Refer to the [Getting Started]({{< ref "getting-started" >}}) and [Language Configuration]({{< ref "configuration##language-and-i18n" >}}) sections for parameter details.
|
||||
|
||||
Additionally, any Markdown content that is provided in the homepage content will be placed below the author profile. This allows extra flexibility for displaying a bio or other custom content using shortcodes.
|
||||
|
||||
To enable the profile layout, set `homepage.layout = "profile"` in the `params.toml` configuration file.
|
||||
|
||||
## Custom layout
|
||||
|
||||
If the built-in homepage layouts aren't sufficient for your needs, you have the option to provide your own custom layout. This allows you to have total control over the page content and essentially gives you a blank slate to work with.
|
||||
|
||||
To enable the custom layout, set `homepage.layout = "custom"` in the `params.toml` configuration file.
|
||||
|
||||
With the configuration value set, create a new `custom.html` file and place it in `layouts/partials/home/custom.html`. Now whatever is in the `custom.html` file will be placed in the content area of the site homepage. You may use whatever HTML, Tailwind, or Hugo templating functions you wish to define your layout.
|
||||
|
||||
To include [recent articles](#recent-articles) on the custom layout, use the `recent-articles.html` partial.
|
||||
|
||||
As an example, the [homepage]({{< ref "/" >}}) on this site uses the custom layout to allow toggling between the profile and page layouts. Visit the [GitHub repo](https://github.com/jpanther/congo/blob/dev/exampleSite/layouts/partials/home/custom.html) to see how it works.
|
||||
|
||||
## Recent articles
|
||||
|
||||
All homepage layouts have the option of displaying recent articles below the main page content. To enable this, simply set the `homepage.showRecent` setting to `true` in the `params.toml` configuration file.
|
||||
|
||||

|
||||
|
||||
The articles listed in this section are derived from the `mainSections` setting which allows for whatever content types you are using on your website. For instance, if you had content sections for _posts_ and _projects_ you could set this setting to `["posts", "projects"]` and all the articles in these two sections would be used to populate the recent list. The theme expects this setting to be an array so if you only use one section for all your content, you should set this accordingly: `["blog"]`.
|
||||
|
After Width: | Height: | Size: 44 KiB |
146
exampleSite/content/docs/hosting-deployment/index.md
Normal file
@@ -0,0 +1,146 @@
|
||||
---
|
||||
title: "Hosting & Deployment"
|
||||
date: 2020-08-07
|
||||
draft: false
|
||||
description: "Learn how to deploy a Congo site."
|
||||
slug: "hosting-deployment"
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
**Choose your provider:**
|
||||
|
||||
- [GitHub Pages](#github-pages)
|
||||
- [Netlify](#netlify)
|
||||
- [Render](#render)
|
||||
- [Cloudflare Pages](#cloudflare-pages)
|
||||
- [Shared hosting, VPS or private web server](#shared-hosting-vps-or-private-web-server)
|
||||
|
||||
---
|
||||
|
||||
## GitHub Pages
|
||||
|
||||
GitHub allows hosting on [GitHub Pages](https://docs.github.com/en/pages/getting-started-with-github-pages/about-github-pages) using Actions. To enable this functionality, enable Pages on your repo and create a new Actions workflow to build and deploy your site.
|
||||
|
||||
The file needs to be in YAML format, placed within the `.github/workflows/` directory of your GitHub repository and named with a `.yml` extension.
|
||||
|
||||
{{< alert >}}
|
||||
**Important:** Ensure you set the correct branch name under `branches` and in the deploy step `if` parameter to the source branch used in your project.
|
||||
{{< /alert >}}
|
||||
|
||||
```yaml
|
||||
# .github/workflows/gh-pages.yml
|
||||
|
||||
name: GitHub Pages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build-deploy:
|
||||
runs-on: ubuntu-20.04
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Hugo
|
||||
uses: peaceiris/actions-hugo@v2
|
||||
with:
|
||||
hugo-version: "latest"
|
||||
|
||||
- name: Build
|
||||
run: hugo --minify
|
||||
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
if: ${{ github.ref == 'refs/heads/main' }}
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_branch: gh-pages
|
||||
publish_dir: ./public
|
||||
```
|
||||
|
||||
Push the config file to GitHub and the action should automatically run. It may fail the first time and you'll need to visit the **Settings > Pages** section of your GitHub repo to check the source is correct. It should be set to use the `gh-pages` branch.
|
||||
|
||||
{{< screenshot src="github-pages-source.jpg" alt="Screen capture of GitHub Pages source" >}}
|
||||
|
||||
Once the settings are configured, re-run the action and the site should build and deploy correctly. You can consult the actions log to check everything deployed successfully.
|
||||
|
||||
## Netlify
|
||||
|
||||
To deploy to [Netlify](https://www.netlify.com), create a new continuous deployment site and link it to your source code. The build settings can be left blank in the Netlify UI. You will only need to configure the domain you'll be using.
|
||||
|
||||
{{< screenshot src="netlify-build-settings.jpg" alt="Screen capture of Netlify build settings" >}}
|
||||
|
||||
Then in the root of your site repository, create a `netlify.toml` file:
|
||||
|
||||
```toml
|
||||
# netlify.toml
|
||||
|
||||
[build]
|
||||
command = "hugo mod get -u && hugo --gc --minify -b $URL"
|
||||
publish = "public"
|
||||
|
||||
[build.environment]
|
||||
NODE_ENV = "production"
|
||||
GO_VERSION = "1.16"
|
||||
TZ = "UTC" # Set to preferred timezone
|
||||
|
||||
[context.production.environment]
|
||||
HUGO_VERSION = "0.100.2"
|
||||
HUGO_ENV = "production"
|
||||
|
||||
[context.deploy-preview.environment]
|
||||
HUGO_VERSION = "0.100.2"
|
||||
```
|
||||
|
||||
This configuration assumes you are deploying Congo as a Hugo module. If you have installed the theme using another method, change the build command to simply `hugo --gc --minify -b $URL`.
|
||||
|
||||
When you push the config file to your repo, Netlify should automatically deploy your site. You can check the deploy logs in the Netlify UI to check for any errors.
|
||||
|
||||
## Render
|
||||
|
||||
Deploying to [Render](https://render.com) is very straightforward and all configuration is via the Render UI.
|
||||
|
||||
Create a new **Static Site** and link it to your project's code repository. Then simply configure the build command to be `hugo --gc --minify` and publish directory to be `public`.
|
||||
|
||||
{{< screenshot src="render-settings.jpg" alt="Screen capture of Render settings" >}}
|
||||
|
||||
The site will automatically build and deploy whenever you push a change to your repo.
|
||||
|
||||
## Cloudflare Pages
|
||||
|
||||
Cloudflare offers the [Pages](https://pages.cloudflare.com/) service that can host Hugo blogs. It builds the site from a git repository and then hosts it on Cloudflare's CDN. Follow their [Hugo deployment guide](https://developers.cloudflare.com/pages/framework-guides/deploy-a-hugo-site) to get started.
|
||||
|
||||
The Rocket Loader™ feature offered by Cloudflare tries to speed up rendering of web pages with JavaScript, but it breaks the appearance switcher in the theme. It can also cause an annoying light/dark screen flash when browsing your site due to scripts loading in the wrong order.
|
||||
|
||||
This problem can be fixed by disabling it:
|
||||
|
||||
- Go to the [Cloudflare dashboard](https://dash.cloudflare.com)
|
||||
- Click on your domain name in the list
|
||||
- Click _Optimization_ in the _Speed_ section
|
||||
- Scroll down to _Rocket Loader™_ and disable it
|
||||
|
||||
Hugo sites built with Congo still load very quickly, even with this feature disabled.
|
||||
|
||||
## Shared hosting, VPS or private web server
|
||||
|
||||
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).
|
||||
|
||||
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`.
|
||||
|
||||
_If you need a hosting provider, check out [Vultr](https://www.vultr.com/?ref=8957394-8H) or [DigitalOcean](https://m.do.co/c/36841235e565). Signing up using these affiliate links will give you up to $100 in free credit so you can try the service._
|
||||
|
After Width: | Height: | Size: 72 KiB |
BIN
exampleSite/content/docs/hosting-deployment/render-settings.jpg
Normal file
|
After Width: | Height: | Size: 94 KiB |
177
exampleSite/content/docs/installation.md
Normal file
@@ -0,0 +1,177 @@
|
||||
---
|
||||
title: "Installation"
|
||||
date: 2020-08-16
|
||||
draft: false
|
||||
description: "How to install the Congo theme."
|
||||
slug: "installation"
|
||||
tags: ["installation", "docs"]
|
||||
---
|
||||
|
||||
Simply follow the standard Hugo [Quick Start](https://gohugo.io/getting-started/quick-start/) procedure to get up and running quickly.
|
||||
|
||||
Detailed installation instructions can be found below. Instructions for [updating the theme](#installing-updates) are also available.
|
||||
|
||||
## Installation
|
||||
|
||||
These instructions will get you up and running using Hugo and Congo from a completely blank state. Most of the dependencies mentioned in this guide can be installed using the package manager of choice for your platform.
|
||||
|
||||
### Install Hugo
|
||||
|
||||
If you haven't used Hugo before, you will need to [install it onto your local machine](https://gohugo.io/getting-started/installing). You can check if it's already installed by running the command `hugo version`.
|
||||
|
||||
{{< alert >}}
|
||||
Make sure you are using **Hugo version 0.87.0** or later as the theme takes advantage of some of the latest Hugo features.
|
||||
{{< /alert >}}
|
||||
|
||||
You can find detailed installation instructions for your platform in the [Hugo docs](https://gohugo.io/getting-started/installing).
|
||||
|
||||
### Create a new site
|
||||
|
||||
Run the command `hugo new site mywebsite` to create a new Hugo site in a directory named `mywebsite`.
|
||||
|
||||
Note that you can name the project directory whatever you choose, but the instructions below will assume it's named `mywebsite`. If you use a different name, be sure to substitute it accordingly.
|
||||
|
||||
### Download the Congo theme
|
||||
|
||||
There several different ways to install the Congo theme into your Hugo website. From easiest to most difficult to install and maintain, they are:
|
||||
|
||||
- [Hugo module](#install-using-hugo) (recommended)
|
||||
- [Git submodule](#install-using-git)
|
||||
- [Manual file copy](#install-manually)
|
||||
|
||||
If you're unsure, choose the Hugo module method.
|
||||
|
||||
#### Install using Hugo
|
||||
|
||||
This method is the quickest and easiest for keeping the theme up-to-date. Hugo uses **Go** to initialise and manage modules so you need to ensure you have `go` installed before proceeding.
|
||||
|
||||
1. [Download](https://golang.org/dl/) and install Go. You can check if it's already installed by using the command `go version`.
|
||||
|
||||
{{< alert >}}
|
||||
Make sure you are using **Go version 1.12** or later as Hugo requires this for modules to work correctly.
|
||||
{{< /alert >}}
|
||||
|
||||
2. From your Hugo project directory (that you created above), initialise modules for your website:
|
||||
|
||||
```shell
|
||||
# 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:
|
||||
|
||||
```toml
|
||||
[[imports]]
|
||||
path = "github.com/jpanther/congo/v2"
|
||||
```
|
||||
|
||||
4. Start your server using `hugo server` and the theme will be downloaded automatically.
|
||||
5. Continue to [set up the theme configuration files](#set-up-theme-configuration-files).
|
||||
|
||||
#### Install using git
|
||||
|
||||
For this method you'll 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 Congo as a submodule.
|
||||
|
||||
```bash
|
||||
cd mywebsite
|
||||
git init
|
||||
git submodule add -b stable https://github.com/jpanther/congo.git themes/congo
|
||||
```
|
||||
|
||||
Then continue to [set up the theme configuration files](#set-up-theme-configuration-files).
|
||||
|
||||
#### Install manually
|
||||
|
||||
1. Download the latest release of the theme source code.
|
||||
|
||||
{{< button href="https://github.com/jpanther/congo/releases/latest" target="_blank" >}}Download from Github{{< /button >}}
|
||||
|
||||
2. Extract the archive, rename the folder to `congo` 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).
|
||||
|
||||
### Set up theme configuration files
|
||||
|
||||
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. 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!
|
||||
{{< /alert >}}
|
||||
|
||||
Depending on how you installed the theme you will find the theme config files in different places:
|
||||
|
||||
- **Hugo Modules:** In the Hugo cache directory, or [download a copy](https://minhaskamal.github.io/DownGit/#/home?url=https://github.com/jpanther/congo/tree/stable/config/_default) from GitHub
|
||||
- **Git submodule or Manual install:** `themes/congo/config/_default`
|
||||
|
||||
Once you've copied the files, your config folder should look like this:
|
||||
|
||||
```shell
|
||||
config/_default/
|
||||
├─ config.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.
|
||||
{{< /alert >}}
|
||||
|
||||
### Next steps
|
||||
|
||||
The basic Congo installation is now complete. Continue to the [Getting Started]({{< ref "getting-started" >}}) section to learn more about configuring the theme.
|
||||
|
||||
---
|
||||
|
||||
## Installing updates
|
||||
|
||||
From time to time there will be [new releases](https://github.com/jpanther/congo/releases) posted that apply fixes and add new functionality to the theme. In order to take advantage of these changes, you will need to update the theme files on your website.
|
||||
|
||||
How you go about this will depend on the installation method you chose when the theme was originally installed. Instructions for each method can be found below.
|
||||
|
||||
- [Hugo module](#update-using-hugo)
|
||||
- [Git submodule](#update-using-git)
|
||||
- [Manual file copy](#update-manually)
|
||||
|
||||
### Update using Hugo
|
||||
|
||||
Hugo makes updating modules super easy. Simply change into your project directory and execute the following command:
|
||||
|
||||
```shell
|
||||
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 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:
|
||||
|
||||
```shell
|
||||
git submodule update --remote --merge
|
||||
```
|
||||
|
||||
Once the submodule has been updated, rebuild your site and check everything works as expected.
|
||||
|
||||
### Update manually
|
||||
|
||||
Updating Congo manually requires you to download the latest copy of the theme and replace the old version in your project.
|
||||
|
||||
{{< alert >}}
|
||||
Note that any local customisations you have made to the theme files will be lost during this process.
|
||||
{{< /alert >}}
|
||||
|
||||
1. Download the latest release of the theme source code.
|
||||
|
||||
{{< button href="https://github.com/jpanther/congo/releases/latest" target="_blank" >}}Download from Github{{< /button >}}
|
||||
|
||||
2. Extract the archive, rename the folder to `congo` and move it to the `themes/` directory inside your Hugo project's root folder. You will need to overwrite the existing directory to replace all the theme files.
|
||||
|
||||
3. Rebuild your site and check everything works as expected.
|
||||
100
exampleSite/content/docs/partials.md
Normal file
@@ -0,0 +1,100 @@
|
||||
---
|
||||
title: "Partials"
|
||||
date: 2020-08-10
|
||||
draft: false
|
||||
description: "All the partials available in Congo."
|
||||
slug: "partials"
|
||||
tags: ["partials", "analytics", "privacy", "comments", "favicons", "icon", "docs"]
|
||||
---
|
||||
|
||||
## Analytics
|
||||
|
||||
Congo provides built-in support for Fathom Analytics and Google Analytics. Fathom is a paid alternative to Google Analytics that respects user privacy. If you're interested you can use this affiliate link to [receive $10 credit](https://usefathom.com/ref/RLAJSV) and try the service.
|
||||
|
||||
### Fathom Analytics
|
||||
|
||||
To enable Fathom Analytics support, simply provide your Fathom site code in the `config/_default/params.toml` file. If you also use the custom domain feature of Fathom and would like to serve their script from your domain, you can also additionally provide the `domain` configuration value. If you don't provide a `domain` value, the script will load directly from Fathom DNS.
|
||||
|
||||
```toml
|
||||
# config/_default/params.toml
|
||||
|
||||
[fathomAnalytics]
|
||||
site = "ABC12345"
|
||||
domain = "llama.yoursite.com"
|
||||
```
|
||||
|
||||
### 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:
|
||||
|
||||
```toml
|
||||
# config/_default/config.toml
|
||||
|
||||
# version 3
|
||||
googleAnalytics = "UA-PROPERTY_ID"
|
||||
# version 4
|
||||
googleAnalytics = "G-MEASUREMENT_ID"
|
||||
```
|
||||
|
||||
### Custom analytics providers
|
||||
|
||||
If you wish to use a different analytics provider on your website you can also override the analytics partial and provide your own script. Simply create the file `layouts/partials/analytics.html` in your project and it will automatically include it in the `<head>` of the website.
|
||||
|
||||
## Comments
|
||||
|
||||
To add comments to your articles, Congo includes support for a comments partial that is included at the base of each article page. Simply provide a `layouts/partials/comments.html` which contains the code required to display your chosen comments.
|
||||
|
||||
You can use either the built-in Hugo Disqus template, or provide your own custom code. Refer to the [Hugo docs](https://gohugo.io/content-management/comments/) for further information.
|
||||
|
||||
Once the partial has been provided, finer control over where comments are displayed is then managed using the `showComments` parameter. This value can be set at the theme level in the `params.toml` [config file]({{< ref "configuration#theme-parameters" >}}), or on a per-article basis by including it in the [front matter]({{< ref "front-matter" >}}). The parameter defaults to `false` so it must be set to `true` in one of these locations in order for comments to be displayed.
|
||||
|
||||
## Favicons
|
||||
|
||||
Congo provides a default set of blank favicons to get started but you can provide your own assets to override them. The easiest way to obtain new favicon assets is to generate them using a third-party provider like [favicon.io](https://favicon.io).
|
||||
|
||||
Icon assets should be placed directly in the `static/` folder of your website and named as per the listing below. If you use [favicon.io](https://favicon.io), these will be the filenames that are automatically generated for you, but you can provide your own assets if you wish.
|
||||
|
||||
```shell
|
||||
static/
|
||||
├─ android-chrome-192x192.png
|
||||
├─ android-chrome-512x512.png
|
||||
├─ apple-touch-icon.png
|
||||
├─ favicon-16x16.png
|
||||
├─ favicon-32x32.png
|
||||
├─ favicon.ico
|
||||
└─ site.webmanifest
|
||||
```
|
||||
|
||||
Alternatively, you can also completely override the default favicon behaviour and provide your own favicon HTML tags and assets. Simply provide a `layouts/partials/favicons.html` file in your project and this will be injected into the site `<head>` in place of the default assets.
|
||||
|
||||
## Icon
|
||||
|
||||
Similar to the [icon shortcode]({{< ref "shortcodes#icon" >}}), you can include icons in your own templates and partials by using Congo's `icon.html` partial. The partial takes one parameter which is the name of the icon to be included.
|
||||
|
||||
**Example:**
|
||||
|
||||
```go
|
||||
{{ partial "icon.html" "github" }}
|
||||
```
|
||||
|
||||
Icons are populated using Hugo pipelines which makes them very flexible. Congo includes a number of built-in icons for social, links and other purposes. Check the [icon samples]({{< ref "samples/icons" >}}) page for a full list of supported icons.
|
||||
|
||||
Custom icons can be added by providing your own icon assets in the `assets/icons/` directory of your project. The icon can then be referenced in the partial by using the SVG filename without the `.svg` extension.
|
||||
|
||||
Icons can also be used in article content by calling the [icon shortcode]({{< ref "shortcodes#icon" >}}).
|
||||
|
||||
## Extensions
|
||||
|
||||
Congo also provides for a number of extension partials that allow for expanding upon base functionality.
|
||||
|
||||
### Article link
|
||||
|
||||
If you wish to insert additional code after article links, create a `layouts/partials/extend-article-link.html` file. This is especially powerful when combined with the [`badge`]({{< ref "shortcodes#badge" >}}) shortcode which can be used to highlight metadata for certain articles.
|
||||
|
||||
### Head and Footer
|
||||
|
||||
The theme allows for inserting additional code directly into the `<head>` and `<footer>` sections of the template. These can be useful for providing scripts or other logic that isn't part of the theme.
|
||||
|
||||
Simply create either `layouts/partials/extend-head.html` or `layouts/partials/extend-footer.html` and these will automatically be included in your website build. Both partials are injected as the last items in `<head>` and `<footer>` so they can be used to override theme defaults.
|
||||
BIN
exampleSite/content/docs/screenshot.png
Normal file
|
After Width: | Height: | Size: 1.2 MiB |
BIN
exampleSite/content/docs/shortcodes/abstract.jpg
Normal file
|
After Width: | Height: | Size: 40 KiB |
227
exampleSite/content/docs/shortcodes/index.md
Normal file
@@ -0,0 +1,227 @@
|
||||
---
|
||||
title: "Shortcodes"
|
||||
date: 2020-08-11
|
||||
draft: false
|
||||
description: "All the shortcodes available in Congo."
|
||||
slug: "shortcodes"
|
||||
tags: ["shortcodes", "mermaid", "icon", "lead", "docs"]
|
||||
---
|
||||
|
||||
In addition to all the [default Hugo shortcodes](https://gohugo.io/content-management/shortcodes/), Congo adds a few extras for additional functionality.
|
||||
|
||||
## Alert
|
||||
|
||||
`alert` outputs its contents as a stylised message box within your article. It's useful for drawing attention to important information that you don't want the reader to miss.
|
||||
|
||||
The input is written in Markdown so you can format it however you please.
|
||||
|
||||
By default, the alert is presented with an exclaimation triangle icon. To change the icon, include the icon name in the shortcode. Check out the [icon shortcode](#icon) for more details on using icons.
|
||||
|
||||
**Example:**
|
||||
|
||||
```md
|
||||
{{</* alert */>}}
|
||||
**Warning!** This action is destructive!
|
||||
{{</* /alert */>}}
|
||||
|
||||
{{</* alert "twitter" */>}}
|
||||
Don't forget to [follow me](https://twitter.com/jpanther) on Twitter.
|
||||
{{</* /alert */>}}
|
||||
```
|
||||
|
||||
{{< alert >}}
|
||||
**Warning!** This action is destructive!
|
||||
{{< /alert >}}
|
||||
|
||||
{{< alert "twitter" >}}
|
||||
Don't forget to [follow me](https://twitter.com/jpanther) on Twitter.
|
||||
{{< /alert >}}
|
||||
|
||||
## Badge
|
||||
|
||||
`badge` outputs a styled badge component which is useful for displaying metadata.
|
||||
|
||||
**Example:**
|
||||
|
||||
```md
|
||||
{{</* badge */>}}
|
||||
New article!
|
||||
{{</* /badge */>}}
|
||||
```
|
||||
|
||||
{{< badge >}}
|
||||
New article!
|
||||
{{< /badge >}}
|
||||
|
||||
## Button
|
||||
|
||||
`button` outputs a styled button component which can be used to highlight a primary action. It has two optional variables `href` and `target` which can be used to specify the URL and target of the link.
|
||||
|
||||
**Example:**
|
||||
|
||||
```md
|
||||
{{</* button href="#button" target="_self" */>}}
|
||||
Call to action
|
||||
{{</* /button */>}}
|
||||
```
|
||||
|
||||
{{< button href="#button" target="_self" >}}
|
||||
Call to action
|
||||
{{< /button >}}
|
||||
|
||||
## Chart
|
||||
|
||||
`chart` uses the Chart.js library to embed charts into articles using simple structured data. It supports a number of [different chart styles](https://www.chartjs.org/docs/latest/samples/) and everything can be configured from within the shortcode. Simply provide the chart parameters between the shortcode tags and Chart.js will do the rest.
|
||||
|
||||
Refer to the [official Chart.js docs](https://www.chartjs.org/docs/latest/general/) for details on syntax and supported chart types.
|
||||
|
||||
**Example:**
|
||||
|
||||
```js
|
||||
{{</* chart */>}}
|
||||
type: 'bar',
|
||||
data: {
|
||||
labels: ['Tomato', 'Blueberry', 'Banana', 'Lime', 'Orange'],
|
||||
datasets: [{
|
||||
label: '# of votes',
|
||||
data: [12, 19, 3, 5, 2, 3],
|
||||
}]
|
||||
}
|
||||
{{</* /chart */>}}
|
||||
```
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
{{< chart >}}
|
||||
type: 'bar',
|
||||
data: {
|
||||
labels: ['Tomato', 'Blueberry', 'Banana', 'Lime', 'Orange'],
|
||||
datasets: [{
|
||||
label: '# of votes',
|
||||
data: [12, 19, 3, 5, 3],
|
||||
}]
|
||||
}
|
||||
{{< /chart >}}
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
You can see some additional Chart.js examples on the [charts samples]({{< ref "charts" >}}) page.
|
||||
|
||||
## Figure
|
||||
|
||||
Congo includes a `figure` shortcode for adding images to content. The shortcode replaces the base Hugo functionality in order to provide additional performance benefits.
|
||||
|
||||
When a provided image is a page resource, it will be optimised using Hugo Pipes and scaled in order to provide images appropriate to different device resolutions. If a static asset or URL to an external image is provided, it will be included as-is without any image processing by Hugo.
|
||||
|
||||
The `figure` shortcode accepts six parameters:
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
|Parameter|Description|
|
||||
|---|---|
|
||||
|`src`| **Required.** The local path/filename or URL of the image. When providing a path and filename, the theme will attempt to locate the image using the following lookup order: Firstly, as a [page resource](https://gohugo.io/content-management/page-resources/) bundled with the page; then an asset in the `assets/` directory; then finally, a static image in the `static/` directory.|
|
||||
|`alt`|[Alternative text description](https://moz.com/learn/seo/alt-text) for the image.|
|
||||
|`caption`|Markdown for the image caption, which will be displayed below the image.|
|
||||
|`class`|Additional CSS classes to apply to the image.|
|
||||
|`href`|URL that the image should be linked to.|
|
||||
|`default`|Special parameter to revert to default Hugo `figure` behaviour. Simply provide `default=true` and then use normal [Hugo shortcode syntax](https://gohugo.io/content-management/shortcodes/#figure).|
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
Congo also supports automatic conversion of images included using standard Markdown syntax. Simply use the following format and the theme will handle the rest:
|
||||
|
||||
```md
|
||||

|
||||
```
|
||||
|
||||
**Example:**
|
||||
|
||||
```md
|
||||
{{</* figure
|
||||
src="abstract.jpg"
|
||||
alt="Abstract purple artwork"
|
||||
caption="Photo by [Jr Korpa](https://unsplash.com/@jrkorpa) on [Unsplash](https://unsplash.com/)"
|
||||
*/>}}
|
||||
|
||||
<!-- OR -->
|
||||
|
||||
 on [Unsplash](https://unsplash.com/)")
|
||||
```
|
||||
|
||||
{{< figure src="abstract.jpg" alt="Abstract purple artwork" caption="Photo by [Jr Korpa](https://unsplash.com/@jrkorpa) on [Unsplash](https://unsplash.com/)" >}}
|
||||
|
||||
## Icon
|
||||
|
||||
`icon` outputs an SVG icon and takes the icon name as its only parameter. The icon is scaled to match the current text size.
|
||||
|
||||
**Example:**
|
||||
|
||||
```md
|
||||
{{</* icon "github" */>}}
|
||||
```
|
||||
|
||||
**Output:** {{< icon "github" >}}
|
||||
|
||||
Icons are populated using Hugo pipelines which makes them very flexible. Congo includes a number of built-in icons for social, links and other purposes. Check the [icon samples]({{< ref "samples/icons" >}}) page for a full list of supported icons.
|
||||
|
||||
Custom icons can be added by providing your own icon assets in the `assets/icons/` directory of your project. The icon can then be referenced in the shortcode by using the SVG filename without the `.svg` extension.
|
||||
|
||||
Icons can also be used in partials by calling the [icon partial]({{< ref "partials#icon" >}}).
|
||||
|
||||
## Katex
|
||||
|
||||
The `katex` shortcode can be used to add mathematical expressions to article content using the KaTeX package. Refer to the online reference of [supported TeX functions](https://katex.org/docs/supported.html) for the available syntax.
|
||||
|
||||
To include mathematical expressions in an article, simply place the shortcode anywhere with the content. It only needs to be included once per article and KaTeX will automatically render any markup on that page. Both inline and block notation are supported.
|
||||
|
||||
Inline notation can be generated by wrapping the expression in `\\(` and `\\)` delimiters. Alternatively, block notation can be generated using `$$` delimiters.
|
||||
|
||||
**Example:**
|
||||
|
||||
```md
|
||||
{{</* katex */>}}
|
||||
\\(f(a,b,c) = (a^2+b^2+c^2)^3\\)
|
||||
```
|
||||
|
||||
{{< katex >}}
|
||||
\\(f(a,b,c) = (a^2+b^2+c^2)^3\\)
|
||||
|
||||
Check out the [mathematical notation samples]({{< ref "mathematical-notation" >}}) page for more examples.
|
||||
|
||||
## Lead
|
||||
|
||||
`lead` is used to bring emphasis to the start of an article. It can be used to style an introduction, or to call out an important piece of information. Simply wrap any Markdown content in the `lead` shortcode.
|
||||
|
||||
**Example:**
|
||||
|
||||
```md
|
||||
{{</* lead */>}}
|
||||
When life gives you lemons, make lemonade.
|
||||
{{</* /lead */>}}
|
||||
```
|
||||
|
||||
{{< lead >}}
|
||||
When life gives you lemons, make lemonade.
|
||||
{{< /lead >}}
|
||||
|
||||
## Mermaid
|
||||
|
||||
`mermaid` allows you to draw detailed diagrams and visualisations using text. It uses Mermaid under the hood and supports a wide variety of diagrams, charts and other output formats.
|
||||
|
||||
Simply write your Mermaid syntax within the `mermaid` shortcode and let the plugin do the rest.
|
||||
|
||||
Refer to the [official Mermaid docs](https://mermaid-js.github.io/) for details on syntax and supported diagram types.
|
||||
|
||||
**Example:**
|
||||
|
||||
```md
|
||||
{{</* mermaid */>}}
|
||||
graph LR;
|
||||
A[Lemons]-->B[Lemonade];
|
||||
B-->C[Profit]
|
||||
{{</* /mermaid */>}}
|
||||
```
|
||||
|
||||
{{< mermaid >}}
|
||||
graph LR;
|
||||
A[Lemons]-->B[Lemonade];
|
||||
B-->C[Profit]
|
||||
{{< /mermaid >}}
|
||||
|
||||
You can see some additional Mermaid examples on the [diagrams and flowcharts samples]({{< ref "diagrams-flowcharts" >}}) page.
|
||||
96
exampleSite/content/docs/version-2/_index.md
Normal file
@@ -0,0 +1,96 @@
|
||||
---
|
||||
title: "What's New in 2.0 ✨"
|
||||
date: 2022-01-19
|
||||
draft: false
|
||||
description: "Discover what's new in Congo version 2.0."
|
||||
tags: ["new", "docs"]
|
||||
---
|
||||
|
||||
{{< lead >}}
|
||||
Congo 2.0 is packed with tons of new features and optimisations.
|
||||
{{< /lead >}}
|
||||
|
||||
The original aim of Congo was to develop a theme that was simple and lightweight. Version 2 takes this one step further and makes the theme even more powerful while still maintaining its lightweight footprint.
|
||||
|
||||
Continue reading below to discover what's new. When you're ready to upgrade, check out the [guide to upgrading]({{< ref "upgrade" >}}).
|
||||
|
||||
## Tailwind CSS 3.0
|
||||
|
||||
Tailwind CSS is at the heart of Congo and this new release contains the very latest [Tailwind CSS version 3](https://tailwindcss.com/blog/tailwindcss-v3). It brings with it performance optimisations and support for some great new CSS features.
|
||||
|
||||
{{< youtube "TmWIrBPE6Bc" >}}
|
||||
|
||||
Implementing this new version has also removed some Tailwind plugin dependencies from the theme, allowing the overall footprint to remain lightweight.
|
||||
|
||||
## Multilingual support
|
||||
|
||||
A highly requested feature, Congo is now multilingual! If you publish your content in multiple languages, the site will be built with all the translations available.
|
||||
|
||||
<div class="text-2xl text-center" style="font-size: 2.8rem">:gb: :de: :fr: :es: :cn: :brazil: :tr: :bangladesh:</div>
|
||||
|
||||
Thanks to submissions from the community, Congo has already been translated into [eight languages](https://github.com/jpanther/congo/tree/dev/i18n) with more to be added over time. By the way, [pull requests](https://github.com/jpanther/congo/pulls) for new languages are always welcome!
|
||||
|
||||
## RTL language support
|
||||
|
||||
One of the benefits of the new Tailwind and Multilingual features is the ability to add RTL language support. When enabled, the entire site will reflow content from right-to-left. Every element in the theme has been restyled to ensure it looks great in this mode which aids authors who wish to generate content in RTL languages.
|
||||
|
||||
RTL is controlled on a per-language basis so you can mix and match both RTL and LTR content in your projects and the theme will respond accordingly.
|
||||
|
||||
## Automatic image resizing
|
||||
|
||||
A big change in Congo 2.0 is the addition of automatic image resizing. Using the power of Hugo Pipes, images in Markdown content are now automatically scaled to different output sizes. These are then presented using HTML `srcset` attributes enabling optimised file sizes to be served to your site visitors.
|
||||
|
||||

|
||||
|
||||
```html
|
||||
<!-- Markdown:  -->
|
||||
<img
|
||||
srcset="
|
||||
/image_320x0_resize_q75_box.jpg 320w,
|
||||
/image_635x0_resize_q75_box.jpg 635w,
|
||||
/image_1024x0_resize_q75_box.jpg 1024w,
|
||||
/image_1270x0_resize_q75_box.jpg 2x"
|
||||
src="/image_635x0_resize_q75_box.jpg"
|
||||
alt="My image"
|
||||
/>
|
||||
```
|
||||
|
||||
Best of all there's nothing you need to change! Simply insert standard Markdown image syntax and let the theme do the rest. If you want a little more control, the `figure` shortcode has been completely rewritten to provide the same resizing benefits.
|
||||
|
||||
## Performance improvements
|
||||
|
||||
This update packs performance improvements throughout. A key objective for this release was to improve Lighthouse scores and Congo now scores a perfect 100 on all four metrics.
|
||||
|
||||
{{< screenshot src="lighthouse.jpg" >}}
|
||||
|
||||
There's too many individual changes to highlight them here but the results speak for themselves. If you want to dig deeper, you can [view the Lighthouse report](lighthouse.html). Real world performance will vary based upon server configuration.
|
||||
|
||||
## Site search
|
||||
|
||||
Powered by [Fuse.js](https://fusejs.io), site search allows visitors to quickly and easily find your content. All searches are performed client-side meaning there's nothing to configure on the server and queries are performed super fast. Simply enable the feature in your site configuration and you're all set. Oh, and it also supports full keyboard navigation!
|
||||
|
||||
## Tables of contents
|
||||
|
||||
A highly requested feature, Congo now supports tables of contents on article pages. You can see it in action on this page. The contents are fully responsive and will adjust to take advantage of the space available at different screen resolutions.
|
||||
|
||||
Available on a global or per article basis, the table of contents can be fully customised using standard Hugo configuration values, allowing you to adjust the behaviour to suit your project.
|
||||
|
||||
## Accessibility improvements
|
||||
|
||||
From adding ARIA descriptions to more items or simply adjusting the contrast of certain text elements, this release is the most accessible yet.
|
||||
|
||||
Version 2 also introduces "skip to content" and "scroll to top" links that enable quick navigation. There's also keyboard shortcuts for enabling items like search without reaching for the mouse.
|
||||
|
||||
The new image resizing features also provide full control over `alt` and `title` elements enabling an accessible experience for all visitors.
|
||||
|
||||
## A whole lot more
|
||||
|
||||
There's countless other minor changes to explore. From being able to display taxonomies on articles and list pages, to using the new `headline` author parameter to customise your homepage. There's also improved JSON-LD strucured data which further optimises SEO performance. Plus the entire theme has had extra polish to ensure a consistent design language.
|
||||
|
||||
:rocket: Check out the [full changelog](https://github.com/jpanther/congo/blob/dev/CHANGELOG.md) to learn more.
|
||||
|
||||
## Next steps
|
||||
|
||||
If you're ready to upgrade, read the [upgrading from version 1 guide]({{< ref "upgrade" >}}) to get started. If you're new to Congo, check out the [Installation guide]({{< ref "docs/installation" >}}) to begin a new project.
|
||||
|
||||
---
|
||||
BIN
exampleSite/content/docs/version-2/image-resizing.png
Normal file
|
After Width: | Height: | Size: 247 KiB |
11700
exampleSite/content/docs/version-2/lighthouse.html
Normal file
BIN
exampleSite/content/docs/version-2/lighthouse.jpg
Normal file
|
After Width: | Height: | Size: 63 KiB |
198
exampleSite/content/docs/version-2/upgrade/index.md
Normal file
@@ -0,0 +1,198 @@
|
||||
---
|
||||
title: "Upgrading from Congo 1.x"
|
||||
date: 2022-01-20
|
||||
draft: false
|
||||
description: "Discover what's new in Congo version 2.0."
|
||||
tags: ["new", "docs"]
|
||||
---
|
||||
|
||||
Although Congo 2.0 contains a large number of changes, the theme has been designed to minimise the effort required to upgrade to the latest release.
|
||||
|
||||
That said, there are some changes that require adjustments to existing sites that are built with Congo version 1.x. This guide will step you through the process and highlight things you need to consider.
|
||||
|
||||
## Step 1: Upgrade Hugo
|
||||
|
||||
{{< alert >}}
|
||||
Congo 2.0 requires a minimum of **Hugo v0.87.0 or later**
|
||||
{{< /alert >}}
|
||||
|
||||
Congo is built to take advantage of some of the latest Hugo features. You should regularly keep your Hugo installation up to date to avoid any issues.
|
||||
|
||||
You can check your current version using the command `hugo version`. Visit the [Hugo docs](https://gohugo.io/getting-started/installing/) for information on obtaining a newer release for your platform.
|
||||
|
||||
## Step 2: Upgrade Congo
|
||||
|
||||
The process for upgrading Congo will depend on how you include the theme in your project. Instructions for each method can be found below.
|
||||
|
||||
- [Upgrade using Hugo](#upgrade-using-hugo)
|
||||
- [Upgrade using git](#upgrade-using-git)
|
||||
- [Upgrade manually](#upgrade-manually)
|
||||
|
||||
### Upgrade using Hugo
|
||||
|
||||
To upgrade a go module to a new major release, the `modules.toml` and `go.mod` files need to be updated. In each file, update the path to the theme from `github.com/jpanther/congo` to `github.com/jpanther/congo/v2`.
|
||||
|
||||
Then change into your project directory and execute the following command:
|
||||
|
||||
```shell
|
||||
hugo mod get -u
|
||||
```
|
||||
|
||||
Note that in some circumstances there may be issues with this step due to the way that Hugo locally caches modules. If the command above doesn't work, try using `hugo mod clean` to clear out the local cache and re-download any modules.
|
||||
|
||||
Once the theme has been upgraded, continue to the [next section](#step-3-theme-configuration).
|
||||
|
||||
### Upgrade using git
|
||||
|
||||
Git submodules can be upgraded using the `git` command. Simply execute the following command and the latest version of the theme will be downloaded into your local repository:
|
||||
|
||||
```shell
|
||||
git submodule update --remote --merge
|
||||
```
|
||||
|
||||
Once the submodule has been upgraded, continue to the [next section](#step-3-theme-configuration).
|
||||
|
||||
### Upgrade manually
|
||||
|
||||
Updating Congo manually requires you to download the latest copy of the theme and replace the old version in your project.
|
||||
|
||||
{{< alert >}}
|
||||
Note that any local customisations you have made to the theme files will be lost during this process.
|
||||
{{< /alert >}}
|
||||
|
||||
1. Download the latest release of the theme source code.
|
||||
|
||||
{{< button href="https://github.com/jpanther/congo/releases/latest" target="_blank" >}}Download from Github{{< /button >}}
|
||||
|
||||
2. Extract the archive, rename the folder to `congo` and move it to the `themes/` directory inside your Hugo project's root folder. You will need to overwrite the existing directory to replace all the theme files.
|
||||
|
||||
3. Continue to the [next section](#step-3-theme-configuration).
|
||||
|
||||
## Step 3: Theme configuration
|
||||
|
||||
Congo 2.0 introduces a number of new theme configuration parameters. Although the theme will adapt to existing version 1 configurations, in order to take advantage of some of the newer theme features, you will need to adjust your existing configuration.
|
||||
|
||||
The simplest way to do this is to take a copy of the theme's default configuration and compare it to your existing files. The process is outlined in greater detail below.
|
||||
|
||||
### Languages.toml
|
||||
|
||||
In order to provide multilingual support, language-specific theme parameters have been moved to a new config file `languages.[lang-code].toml`. The theme comes with a template `languages.en.toml` file which can be used as a guide.
|
||||
|
||||
{{< alert >}}
|
||||
This step is optional if you do not need multilingual support, although completing it now will make future theme upgrades easier.
|
||||
{{< /alert >}}
|
||||
|
||||
The languages config file follows this structure:
|
||||
|
||||
```toml
|
||||
# config/_default/languagues.en.toml
|
||||
|
||||
languageCode = "en"
|
||||
languageName = "English"
|
||||
displayName = "EN"
|
||||
htmlCode = "en"
|
||||
weight = 1
|
||||
rtl = false
|
||||
|
||||
# Language-specific parameters go here
|
||||
```
|
||||
|
||||
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` |
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
|
||||
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
|
||||
|
||||
defaultContentLanguage = "en"
|
||||
|
||||
enableRobotsTXT = true
|
||||
paginate = 10
|
||||
summaryLength = 0
|
||||
|
||||
[outputs]
|
||||
home = ["HTML", "RSS", "JSON"]
|
||||
```
|
||||
|
||||
### Markup.toml
|
||||
|
||||
Congo 2.0 adds support for tables of contents on article pages. Although Hugo ships with default settings for generating contents listings, you can adjust this behaviour by adding a new `[tableOfContents]` block to your `markup.toml` file.
|
||||
|
||||
The recommended settings are as follows, which includes any headings in the Markdown content at levels 2, 3 and 4:
|
||||
|
||||
```toml
|
||||
# config/_default/markup.toml
|
||||
|
||||
[tableOfContents]
|
||||
startLevel = 2
|
||||
endLevel = 4
|
||||
```
|
||||
|
||||
### Params.toml
|
||||
|
||||
A number of new theme parameters have been introduced in Congo 2.0. Some minor changes are requried to existing configurations. Remember, the theme will always revert to a sensible default if a parameter is not provided.
|
||||
|
||||
The way that dark mode works in Congo has been changed to allow greater flexibility around configuration. The old `darkMode` and `darkToggle` parameters have been **removed and replaced** by three new parameters. These new options operate independently of each other, making it possible to force the appearance while still allowing the user to override.
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
| New parameter | Type | Default | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `defaultAppearance` | String | `"light"` | Default theme appearance; either `light` or `dark`.<br>:warning: _Setting this to `light` replicates the old `darkMode = false` setting, while `dark` replicates `darkMode = true`._ |
|
||||
| `autoSwitchAppearance` | Boolean | `true` | Whether the theme appearance automatically switches based upon the operating system preference. Set to `false` to force the site to always use the `defaultAppearance`. <br>:warning: _Setting this to `true` replicates the old `darkMode = "auto"` setting._ |
|
||||
| `showAppearanceSwitcher` | Boolean | `false` | Whether the theme appearance switcher is dispalyed in the site footer. <br>:warning: _This parameter replaces `darkToggle`._ |
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
The following table outlines some other key **new parameters** that control new features in version 2:
|
||||
|
||||
| New parameter | Type | Default |
|
||||
| ----------------------------- | ------- | ------- |
|
||||
| `enableSearch` | Boolean | `false` |
|
||||
| `showScrollToTop` | Boolean | `true` |
|
||||
| `article.showTaxonomies` | Boolean | `false` |
|
||||
| `article.showTableOfContents` | Boolean | `false` |
|
||||
| `list.showTableOfContents` | Boolean | `false` |
|
||||
|
||||
For the full list of supported parameters, refer to the [Configuration]({{< ref "docs/configuration" >}}) docs.
|
||||
|
||||
## Step 4: Move assets
|
||||
|
||||
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` **→** `assets/me.jpg`
|
||||
`static/logo.jpg` **→** `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.
|
||||
|
||||
Note that this step does not apply to any assets in your project that are actually static. For example, a PDF file that you link directly to from within an article is a static asset. These files should remain in the `static/` directory to ensure they are copied to the output folder when Hugo builds the site.
|
||||
|
||||
## Step 5: Check content
|
||||
|
||||
The behavior of the `figure` shortcode is different in version 2. If you are using `figure` in your content and have advanced use cases, you may need to adjust the parameters you are providing.
|
||||
|
||||
Consult the [shortcode docs]({{< ref "docs/shortcodes#figure" >}}) to learn more about supported parameters.
|
||||
|
||||
## Step 6: Rebuild
|
||||
|
||||
Now that all the configuration changes are complete, it's time to rebuild the site. Run `hugo`, or your build command, and check that everything works as expected.
|
||||
|
||||
If you come across any errors, check the configuration is correct and refer to the [full documentation]({{< ref "docs" >}}) for further guidance. Remember, the example config files bundled with the theme contain all the default parameters and are a great starting point.
|
||||
|
||||
🙋♀️ If you still need help, feel free to ask your question on [GitHub Discussions](https://github.com/jpanther/congo/discussions).
|
||||
18
exampleSite/content/samples/_index.md
Executable file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
title: "Content Samples"
|
||||
description: "See what's possible with Congo."
|
||||
|
||||
cascade:
|
||||
showEdit: false
|
||||
showSummary: true
|
||||
---
|
||||
|
||||
{{< lead >}}
|
||||
Congo brings your content to life. :heart_eyes:
|
||||
{{< /lead >}}
|
||||
|
||||
This section contains some demo pages that show how Congo renders different types of content. You can also see an example [taxonomy listing]({{< ref "tags" >}}) page.
|
||||
|
||||
_**Sidenote:** This page is just a standard Congo article listing and Hugo has been configured to generate a `samples` content type and display article summaries._
|
||||
|
||||
---
|
||||
85
exampleSite/content/samples/charts.md
Executable file
@@ -0,0 +1,85 @@
|
||||
---
|
||||
title: "Charts"
|
||||
date: 2019-03-06
|
||||
description: "Guide to Chart.js usage in Congo"
|
||||
summary: "Congo includes Chart.js for powerful charts and data visualisations."
|
||||
tags: ["chart", "sample", "graph", "shortcodes"]
|
||||
---
|
||||
|
||||
Congo includes support for Chart.js using the `chart` shortcode. Simply wrap the chart markup within the shortcode. Congo automatically themes charts to match the configured `colorScheme` parameter, however the colours can be customised using normal Chart.js syntax.
|
||||
|
||||
Refer to the [chart shortcode]({{< ref "docs/shortcodes#chart" >}}) docs for more details.
|
||||
|
||||
The examples below are a small selection taken from the [official Chart.js docs](https://www.chartjs.org/docs/latest/samples). You can also [view the page source](https://raw.githubusercontent.com/jpanther/congo/dev/exampleSite/content/samples/charts.md) on GitHub to see the markup.
|
||||
|
||||
## Bar chart
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
{{< chart >}}
|
||||
type: 'bar',
|
||||
data: {
|
||||
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
|
||||
datasets: [{
|
||||
label: 'My First Dataset',
|
||||
data: [65, 59, 80, 81, 56, 55, 40],
|
||||
backgroundColor: [
|
||||
'rgba(255, 99, 132, 0.2)',
|
||||
'rgba(255, 159, 64, 0.2)',
|
||||
'rgba(255, 205, 86, 0.2)',
|
||||
'rgba(75, 192, 192, 0.2)',
|
||||
'rgba(54, 162, 235, 0.2)',
|
||||
'rgba(153, 102, 255, 0.2)',
|
||||
'rgba(201, 203, 207, 0.2)'
|
||||
],
|
||||
borderColor: [
|
||||
'rgb(255, 99, 132)',
|
||||
'rgb(255, 159, 64)',
|
||||
'rgb(255, 205, 86)',
|
||||
'rgb(75, 192, 192)',
|
||||
'rgb(54, 162, 235)',
|
||||
'rgb(153, 102, 255)',
|
||||
'rgb(201, 203, 207)'
|
||||
],
|
||||
borderWidth: 1
|
||||
}]
|
||||
}
|
||||
{{< /chart >}}
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
## Line chart
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
{{< chart >}}
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
|
||||
datasets: [{
|
||||
label: 'My First Dataset',
|
||||
data: [65, 59, 80, 81, 56, 55, 40],
|
||||
tension: 0.2
|
||||
}]
|
||||
}
|
||||
{{< /chart >}}
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
## Doughnut chart
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
{{< chart >}}
|
||||
type: 'doughnut',
|
||||
data: {
|
||||
labels: ['Red', 'Blue', 'Yellow'],
|
||||
datasets: [{
|
||||
label: 'My First Dataset',
|
||||
data: [300, 50, 100],
|
||||
backgroundColor: [
|
||||
'rgba(255, 99, 132, 0.7)',
|
||||
'rgba(54, 162, 235, 0.7)',
|
||||
'rgba(255, 205, 86, 0.7)'
|
||||
],
|
||||
borderWidth: 0,
|
||||
hoverOffset: 4
|
||||
}]
|
||||
}
|
||||
{{< /chart >}}
|
||||
<!-- prettier-ignore-end -->
|
||||
92
exampleSite/content/samples/diagrams-flowcharts.md
Executable file
@@ -0,0 +1,92 @@
|
||||
---
|
||||
title: "Diagrams and Flowcharts"
|
||||
date: 2019-03-06
|
||||
description: "Guide to Mermaid usage in Congo"
|
||||
summary: "It's easy to add diagrams and flowcharts to articles using Mermaid."
|
||||
tags: ["mermaid", "sample", "diagram", "shortcodes"]
|
||||
---
|
||||
|
||||
Mermaid diagrams are supported in Congo using the `mermaid` shortcode. Simply wrap the diagram markup within the shortcode. Congo automatically themes Mermaid diagrams to match the configured `colorScheme` parameter.
|
||||
|
||||
Refer to the [mermaid shortcode]({{< ref "docs/shortcodes#mermaid" >}}) docs for more details.
|
||||
|
||||
The examples below are a small selection taken from the [official Mermaid docs](https://mermaid-js.github.io/mermaid/). You can also [view the page source](https://raw.githubusercontent.com/jpanther/congo/dev/exampleSite/content/samples/diagrams-flowcharts.md) on GitHub to see the markup.
|
||||
|
||||
## Flowchart
|
||||
|
||||
{{< mermaid >}}
|
||||
graph TD
|
||||
A[Christmas] -->|Get money| B(Go shopping)
|
||||
B --> C{Let me think}
|
||||
B --> G[/Another/]
|
||||
C ==>|One| D[Laptop]
|
||||
C -->|Two| E[iPhone]
|
||||
C -->|Three| F[Car]
|
||||
subgraph Section
|
||||
C
|
||||
D
|
||||
E
|
||||
F
|
||||
G
|
||||
end
|
||||
{{< /mermaid >}}
|
||||
|
||||
## Sequence diagram
|
||||
|
||||
{{< mermaid >}}
|
||||
sequenceDiagram
|
||||
autonumber
|
||||
par Action 1
|
||||
Alice->>John: Hello John, how are you?
|
||||
and Action 2
|
||||
Alice->>Bob: Hello Bob, how are you?
|
||||
end
|
||||
Alice->>+John: Hello John, how are you?
|
||||
Alice->>+John: John, can you hear me?
|
||||
John-->>-Alice: Hi Alice, I can hear you!
|
||||
Note right of John: John is perceptive
|
||||
John-->>-Alice: I feel great!
|
||||
loop Every minute
|
||||
John-->Alice: Great!
|
||||
end
|
||||
{{< /mermaid >}}
|
||||
|
||||
## Class diagram
|
||||
|
||||
{{< mermaid >}}
|
||||
classDiagram
|
||||
Animal "1" <|-- Duck
|
||||
Animal <|-- Fish
|
||||
Animal <--o Zebra
|
||||
Animal : +int age
|
||||
Animal : +String gender
|
||||
Animal: +isMammal()
|
||||
Animal: +mate()
|
||||
class Duck{
|
||||
+String beakColor
|
||||
+swim()
|
||||
+quack()
|
||||
}
|
||||
class Fish{
|
||||
-int sizeInFeet
|
||||
-canEat()
|
||||
}
|
||||
class Zebra{
|
||||
+bool is_wild
|
||||
+run()
|
||||
}
|
||||
{{< /mermaid >}}
|
||||
|
||||
## Entity relationship diagram
|
||||
|
||||
{{< mermaid >}}
|
||||
erDiagram
|
||||
CUSTOMER }|..|{ DELIVERY-ADDRESS : has
|
||||
CUSTOMER ||--o{ ORDER : places
|
||||
CUSTOMER ||--o{ INVOICE : "liable for"
|
||||
DELIVERY-ADDRESS ||--o{ ORDER : receives
|
||||
INVOICE ||--|{ ORDER : covers
|
||||
ORDER ||--|{ ORDER-ITEM : includes
|
||||
PRODUCT-CATEGORY ||--|{ PRODUCT : contains
|
||||
PRODUCT ||--o{ ORDER-ITEM : "ordered in"
|
||||
{{< /mermaid >}}
|
||||
19
exampleSite/content/samples/emoji.md
Executable file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
title: "Emoji :parachute:"
|
||||
date: 2019-03-05
|
||||
description: "Guide to Emoji usage in Congo"
|
||||
summary: "📖🏞️🧗🏽🐉🧙🏽♂️🧚🏽👸"
|
||||
tags: ["emoji", "sample"]
|
||||
---
|
||||
|
||||
Emoji is supported throughout Congo by default. Emoji can be used in titles, menu items and article content.
|
||||
|
||||
{{< alert >}}
|
||||
**Note:** The rendering of these glyphs depends on the browser and the platform. To style the emoji you can either use a third party emoji font or a font stack.
|
||||
{{< /alert >}}
|
||||
|
||||
Emoji replacements are automatic throughout Congo, so you can use shorthand codes in your content and front matter and they will be converted to their corresponding symbols at build time.
|
||||
|
||||
**Example:** `see_no_evil` :see_no_evil:, `hear_no_evil` :hear_no_evil:, `speak_no_evil` :speak_no_evil:.
|
||||
|
||||
The [Emoji cheat sheet](http://www.emoji-cheat-sheet.com/) is a useful reference for emoji shorthand codes.
|
||||
14
exampleSite/content/samples/external.md
Executable file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
title: "An External Article"
|
||||
date: 2019-01-24
|
||||
externalUrl: "https://jamespanther.com/writings/i-switched-from-google-analytics-to-fathom-analytics/"
|
||||
summary: "The `externalUrl` front matter parameter can link to any URL."
|
||||
showReadingTime: false
|
||||
_build:
|
||||
render: "false"
|
||||
list: "local"
|
||||
---
|
||||
|
||||
This page uses the `externalUrl` front matter parameter to link to an article outside of this Hugo website.
|
||||
|
||||
It's great for things like linking to posts on Medium or to research papers you may have hosted on third party websites.
|
||||
75
exampleSite/content/samples/icons.md
Normal file
@@ -0,0 +1,75 @@
|
||||
---
|
||||
title: "Icons"
|
||||
date: 2020-08-14
|
||||
lastmod: 2022-03-09
|
||||
draft: false
|
||||
description: "Icon support in Congo."
|
||||
slug: "icons"
|
||||
tags: ["icons", "sample", "shortcodes"]
|
||||
showDateUpdated: true
|
||||
---
|
||||
|
||||
Congo has built-in support for a number of [FontAwesome 6](https://fontawesome.com/icons) icons. These can be included in your website through either the [icon partial]({{< ref "docs/partials#icon" >}}) or [icon shortcode]({{< ref "docs/shortcodes#icon" >}}).
|
||||
|
||||
Additionally, custom icons are also fully supported. Simply provide your own SVG icon assets by placing them in the `assets/icons/` directory in the root of your project. Any icons in the icons directory will then be available to use throughout the theme.
|
||||
|
||||
The full list of built-in icons and their corresponding names can referenced below.
|
||||
|
||||
| Icon name | Preview |
|
||||
| -------------------- | --------------------------------- |
|
||||
| amazon | {{< icon amazon >}} |
|
||||
| apple | {{< icon apple >}} |
|
||||
| bars | {{< icon bars >}} |
|
||||
| blogger | {{< icon blogger >}} |
|
||||
| bug | {{< icon bug >}} |
|
||||
| check | {{< icon check >}} |
|
||||
| circle-info | {{< icon circle-info >}} |
|
||||
| codepen | {{< icon codepen >}} |
|
||||
| comment | {{< icon comment >}} |
|
||||
| dev | {{< icon dev >}} |
|
||||
| dribbble | {{< icon dribbble >}} |
|
||||
| edit | {{< icon edit >}} |
|
||||
| email | {{< icon email >}} |
|
||||
| facebook | {{< icon facebook >}} |
|
||||
| flickr | {{< icon flickr >}} |
|
||||
| foursquare | {{< icon foursquare >}} |
|
||||
| github | {{< icon github >}} |
|
||||
| gitlab | {{< icon gitlab >}} |
|
||||
| google | {{< icon google >}} |
|
||||
| hashnode | {{< icon hashnode >}} |
|
||||
| instagram | {{< icon instagram >}} |
|
||||
| keybase | {{< icon keybase >}} |
|
||||
| kickstarter | {{< icon kickstarter >}} |
|
||||
| lastfm | {{< icon lastfm >}} |
|
||||
| lightbulb | {{< icon lightbulb >}} |
|
||||
| link | {{< icon link >}} |
|
||||
| linkedin | {{< icon linkedin >}} |
|
||||
| list | {{< icon list >}} |
|
||||
| mastodon | {{< icon mastodon >}} |
|
||||
| medium | {{< icon medium >}} |
|
||||
| microsoft | {{< icon microsoft >}} |
|
||||
| moon | {{< icon moon >}} |
|
||||
| orcid | {{< icon orcid >}} |
|
||||
| patreon | {{< icon patreon >}} |
|
||||
| pencil | {{< icon pencil >}} |
|
||||
| pinterest | {{< icon pinterest >}} |
|
||||
| reddit | {{< icon reddit >}} |
|
||||
| researchgate | {{< icon researchgate >}} |
|
||||
| search | {{< icon search >}} |
|
||||
| skull-crossbones | {{< icon skull-crossbones >}} |
|
||||
| slack | {{< icon slack >}} |
|
||||
| snapchat | {{< icon snapchat >}} |
|
||||
| soundcloud | {{< icon soundcloud >}} |
|
||||
| stack-overflow | {{< icon stack-overflow >}} |
|
||||
| steam | {{< icon steam >}} |
|
||||
| sun | {{< icon sun >}} |
|
||||
| tag | {{< icon tag >}} |
|
||||
| telegram | {{< icon telegram >}} |
|
||||
| tiktok | {{< icon tiktok >}} |
|
||||
| triangle-exclamation | {{< icon triangle-exclamation >}} |
|
||||
| tumblr | {{< icon tumblr >}} |
|
||||
| twitch | {{< icon twitch >}} |
|
||||
| twitter | {{< icon twitter >}} |
|
||||
| whatsapp | {{< icon whatsapp >}} |
|
||||
| xmark | {{< icon xmark >}} |
|
||||
| youtube | {{< icon youtube >}} |
|
||||
145
exampleSite/content/samples/markdown.md
Executable file
@@ -0,0 +1,145 @@
|
||||
---
|
||||
title: "Markdown"
|
||||
date: 2019-03-11
|
||||
description: "Sample article showcasing basic Markdown syntax and formatting for HTML elements."
|
||||
tags: ["markdown", "css", "html", "sample"]
|
||||
---
|
||||
|
||||
This article offers a sample of basic Markdown formatting that can be used in Congo, also it shows how some basic HTML elements are decorated.
|
||||
|
||||
<!--more-->
|
||||
|
||||
## Headings
|
||||
|
||||
The following HTML `<h1>`—`<h6>` elements represent six levels of section headings. `<h1>` is the highest section level while `<h6>` is the lowest.
|
||||
|
||||
# H1
|
||||
|
||||
## H2
|
||||
|
||||
### H3
|
||||
|
||||
#### H4
|
||||
|
||||
##### H5
|
||||
|
||||
###### H6
|
||||
|
||||
## Paragraph
|
||||
|
||||
Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat.
|
||||
|
||||
Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat.
|
||||
|
||||
## Blockquotes
|
||||
|
||||
The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a `footer` or `cite` element, and optionally with in-line changes such as annotations and abbreviations.
|
||||
|
||||
### Blockquote without attribution
|
||||
|
||||
> Tiam, ad mint andaepu dandae nostion secatur sequo quae.
|
||||
> **Note** that you can use _Markdown syntax_ within a blockquote.
|
||||
|
||||
### Blockquote with attribution
|
||||
|
||||
> Don't communicate by sharing memory, share memory by communicating.<br>
|
||||
> — <cite>Rob Pike[^1]</cite>
|
||||
|
||||
[^1]: The above quote is excerpted from Rob Pike's [talk `about` nothing](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015.
|
||||
|
||||
## Tables
|
||||
|
||||
Tables aren't part of the core Markdown spec, but Hugo supports supports them out-of-the-box.
|
||||
|
||||
| Name | Age |
|
||||
| ----- | --- |
|
||||
| Bob | 27 |
|
||||
| Alice | 23 |
|
||||
|
||||
### Inline Markdown within tables
|
||||
|
||||
| Italics | Bold | Code |
|
||||
| --------- | -------- | ------ |
|
||||
| _italics_ | **bold** | `code` |
|
||||
|
||||
## Code Blocks
|
||||
|
||||
### Code block with backticks
|
||||
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Example HTML5 Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test</p>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
### Code block indented with four spaces
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Example HTML5 Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
### Code block with Hugo's internal highlight shortcode
|
||||
|
||||
{{< highlight html "linenos=table,hl_lines=4 7-9" >}}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Example HTML5 Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test</p>
|
||||
</body>
|
||||
</html>
|
||||
{{< /highlight >}}
|
||||
|
||||
## List Types
|
||||
|
||||
### Ordered List
|
||||
|
||||
1. First item
|
||||
2. Second item
|
||||
3. Third item
|
||||
|
||||
### Unordered List
|
||||
|
||||
- List item
|
||||
- Another item
|
||||
- And another item
|
||||
|
||||
### Nested list
|
||||
|
||||
- Fruit
|
||||
- Apple
|
||||
- Orange
|
||||
- Banana
|
||||
- Dairy
|
||||
- Milk
|
||||
- Cheese
|
||||
|
||||
## Other Elements — abbr, sub, sup, kbd, mark
|
||||
|
||||
<abbr title="Graphics Interchange Format">GIF</abbr> is a bitmap image format.
|
||||
|
||||
H<sub>2</sub>O
|
||||
|
||||
X<sup>n</sup> + Y<sup>n</sup> = Z<sup>n</sup>
|
||||
|
||||
Press <kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>Delete</kbd> to end the session.
|
||||
|
||||
Most <mark>salamanders</mark> are nocturnal, and hunt for insects, worms, and other small creatures.
|
||||
46
exampleSite/content/samples/mathematical-notation.md
Executable file
@@ -0,0 +1,46 @@
|
||||
---
|
||||
title: Mathematical notation
|
||||
date: 2019-03-08
|
||||
description: A brief sample of mathematical notation in Congo.
|
||||
tags: ["sample", "katex", "maths", "shortcodes"]
|
||||
---
|
||||
|
||||
KaTeX can be used to render mathematical notation within articles.
|
||||
|
||||
<!--more-->
|
||||
|
||||
{{< katex >}}
|
||||
|
||||
Congo will only bundle the KaTeX assets into your project if you make use of mathematical notation. In order for this to work, simply include the [`katex` shortcode]({{< ref "docs/shortcodes#katex" >}}) within the article. Any KaTeX syntax on that page will then be automatically rendered.
|
||||
|
||||
Use the online reference of [supported TeX functions](https://katex.org/docs/supported.html) for the available syntax.
|
||||
|
||||
## Inline notation
|
||||
|
||||
Inline notation can be generated by wrapping the expression in `\\(` and `\\)` delimiters.
|
||||
|
||||
**Example:**
|
||||
|
||||
```tex
|
||||
% KaTeX inline notation
|
||||
Inline notation: \\(\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…\\)
|
||||
```
|
||||
|
||||
Inline notation: \\(\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…\\)
|
||||
|
||||
## Block notation
|
||||
|
||||
Alternatively, block notation can be generated using `$$` delimiters. This will output the expression in its own HTML block.
|
||||
|
||||
**Example:**
|
||||
|
||||
```tex
|
||||
% KaTeX block notation
|
||||
$$
|
||||
\varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } }
|
||||
$$
|
||||
```
|
||||
|
||||
$$
|
||||
\varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } }
|
||||
$$
|
||||
39
exampleSite/content/samples/placeholder-text.md
Executable file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
title: "Placeholder Text"
|
||||
date: "2019-03-09"
|
||||
lastmod: "2022-01-24"
|
||||
draft: true
|
||||
description: "Lorem Ipsum Dolor Si Amet"
|
||||
tags: ["markdown", "text", "sample", "latin"]
|
||||
showDateUpdated: true
|
||||
xml: false
|
||||
---
|
||||
|
||||
Lorem est tota propiore conpellat pectoribus de pectora summo. <!--more-->Redit teque digerit hominumque toris verebor lumina non cervice subde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc caluere tempus inhospita parcite confusaque translucet patri vestro qui optatis lumine cognoscere flos nubis! Fronde ipsamque patulos Dryopen deorum.
|
||||
|
||||
1. Exierant elisi ambit vivere dedere
|
||||
2. Duce pollice
|
||||
3. Eris modo
|
||||
4. Spargitque ferrea quos palude
|
||||
|
||||
Rursus nulli murmur; hastile inridet ut ab gravi sententia! Nomine potitus silentia flumen, sustinet placuit petis in dilapsa erat sunt. Atria tractus malis.
|
||||
|
||||
1. Comas hunc haec pietate fetum procerum dixit
|
||||
2. Post torum vates letum Tiresia
|
||||
3. Flumen querellas
|
||||
4. Arcanaque montibus omnes
|
||||
5. Quidem et
|
||||
|
||||
## Vagus elidunt
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" overflow="visible" viewBox="0 0 496 373" height="186" width="248"><g fill="none"><path stroke="#000" stroke-width="2" d="M.599 372.348L495.263 1.206M.312.633l494.95 370.853M.312 372.633L247.643.92M248.502.92l246.76 370.566M330.828 123.869V1.134M330.396 1.134L165.104 124.515"></path><path stroke="#ED1C24" stroke-width="2" d="M275.73 41.616h166.224v249.05H275.73zM54.478 41.616h166.225v249.052H54.478z"></path><path stroke="#000" stroke-width="2" d="M.479.375h495v372h-495zM247.979.875v372"></path><ellipse cx="498.729" cy="177.625" rx="2" ry="1.25"></ellipse><ellipse cx="247.229" cy="377.375" rx="2" ry="1.25"></ellipse></g></svg>
|
||||
|
||||
[The Van de Graaf Canon](https://en.wikipedia.org/wiki/Canons_of_page_construction#Van_de_Graaf_canon)
|
||||
|
||||
### Mane refeci capiebant unda mulcebat
|
||||
|
||||
Victa caducifer, malo vulnere contra dicere aurato, ludit regale, voca! Retorsit colit est profanae esse virescere furit nec; iaculi matertera et visa est, viribus. Divesque creatis, tecta novat collumque vulnus est, parvas. **Faces illo pepulere** tempus adest. Tendit flamma, ab opes virum sustinet, sidus sequendo urbis.
|
||||
|
||||
Iubar proles corpore raptos vero auctor imperium; sed et huic: manus caeli Lelegas tu lux. Verbis obstitit intus oblectamina fixis linguisque ausus sperare Echionides cornuaque tenent clausit possit. Omnia putatur. Praeteritae refert ausus; ferebant e primus lora nutat, vici quae mea ipse. Et iter nil spectatae vulnus haerentia iuste et exercebat, sui et.
|
||||
|
||||
Eurytus Hector, materna ipsumque ut Politen, nec, nate, ignari, vernum cohaesit sequitur. Vel **mitis temploque** vocatus, inque alis, _oculos nomen_ non silvis corpore coniunx ne displicet illa. Crescunt non unus, vidit visa quantum inmiti flumina mortis facto sic: undique a alios vincula sunt iactata abdita! Suspenderat ego fuit tendit: luna, ante urbem Propoetides **parte**.
|
||||
35
exampleSite/content/samples/rich-content.md
Executable file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
title: "Rich Content"
|
||||
date: 2019-03-10
|
||||
description: "A brief description of Hugo Shortcodes"
|
||||
summary: "This is an _example_ of a **rich** content summary."
|
||||
tags: ["shortcodes", "privacy", "sample", "gist", "twitter", "youtube", "vimeo"]
|
||||
---
|
||||
|
||||
Hugo ships with several [built-in shortcodes](https://gohugo.io/content-management/shortcodes/#use-hugos-built-in-shortcodes) for rich content, along with a [privacy config](https://gohugo.io/about/hugo-and-gdpr/) and a set of _simple shortcodes_ that enable static and no-JS versions of various social media embeds.
|
||||
|
||||
## YouTube
|
||||
|
||||
Below is an example using the built-in `youtube` shortcode.
|
||||
|
||||
{{< youtube ZJthWmvUzzc >}}
|
||||
|
||||
## Twitter
|
||||
|
||||
This example uses the `twitter_simple` shortcode to output a Tweet. It requires two named parameters `user` and `id`.
|
||||
|
||||
{{< twitter_simple user="DesignReviewed" id="1085870671291310081" >}}
|
||||
|
||||
Alternatively, the `tweet` shortcode can be used to embed a fully marked up Twitter card.
|
||||
|
||||
## Gist
|
||||
|
||||
The `gist` shortcode can be used to embed a GitHub Gist. It requires two unnamed parameters: the username and ID of the Gist.
|
||||
|
||||
{{< gist jpanther a873e1219ffeaa80a926bbe8255f348e >}}
|
||||
|
||||
## Vimeo
|
||||
|
||||
The `vimeo_simple` shortcode will embed a Vimeo video.
|
||||
|
||||
{{< vimeo_simple 48912912 >}}
|
||||
BIN
exampleSite/content/squid.jpg
Normal file
|
After Width: | Height: | Size: 222 KiB |
9
exampleSite/content/tags/_index.md
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
title: Tags
|
||||
---
|
||||
|
||||
Congo has full support for Hugo taxonomies and will adapt to any taxonomy set up. Taxonomy listings like this one also support custom content to be displayed above the list of terms.
|
||||
|
||||
This area could be used to add some extra decriptive text to each taxonomy. Check out the [advanced tag]({{< ref "advanced" >}}) below to see how to take this concept even further.
|
||||
|
||||
---
|
||||
7
exampleSite/content/tags/advanced/_index.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
title: advanced
|
||||
---
|
||||
|
||||
This is the advanced tag. Just like other listing pages in Congo, you can add custom content to individual taxonomy terms and it will be displayed at the top of the term listing. :rocket:
|
||||
|
||||
You can also use these content pages to define Hugo metadata like titles and descriptions that will be used for SEO and other purposes.
|
||||
42
exampleSite/content/users.md
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
title: "Users"
|
||||
date: 2020-08-14
|
||||
draft: false
|
||||
description: "Some real-life Congo examples."
|
||||
slug: "users"
|
||||
tags: ["users", "sample"]
|
||||
showDate: false
|
||||
showAuthor: false
|
||||
showReadingTime: false
|
||||
showEdit: false
|
||||
---
|
||||
|
||||
{{< lead >}}
|
||||
Real websites that are built with Congo.
|
||||
{{< /lead >}}
|
||||
|
||||
| Website | Details |
|
||||
| ---------------------------------------------------------------------- | ---------------------------- |
|
||||
| [jamespanther.com](https://jamespanther.com) | Personal site - Theme author |
|
||||
| [srisco.dev](https://srisco.dev) | Personal site |
|
||||
| [antoinesoetewey.com](https://antoinesoetewey.com/) | Personal site |
|
||||
| [leif.io](https://leif.io/) | Personal site and Tech blog |
|
||||
| [dr460nf1r3.org](https://dr460nf1r3.org/) | Personal site and Blog |
|
||||
| [OCram85.com](https://ocram85.com) | Personal site and Blog |
|
||||
| [mackiser.github.io](https://mackiser.github.io) | Personal site and Blog |
|
||||
| [jamesmillner.dev](https://jamesmillner.dev) | Personal site and Blog |
|
||||
| [jeremic.ca](https://jeremic.ca) | Personal site and Blog |
|
||||
| [rohn.tech](https://rohn.tech) | Personal site |
|
||||
| [klimafreundlicher-kochen.de](https://www.klimafreundlicher-kochen.de) | Food blog (in German) |
|
||||
| [seyslee.github.io](https://seyslee.github.io) | Tech blog (in Korean) |
|
||||
| [datanalyze.be](https://datanalyze.be/) | Professional site |
|
||||
| [sneaky-potato.github.io](https://sneaky-potato.github.io/) | Professional site and Blog |
|
||||
| [kelset.dev](https://kelset.dev) | Personal site |
|
||||
| [docteurelsavancaster.com](https://docteurelsavancaster.com/) | Professional site |
|
||||
| [ruihao-li.github.io](https://ruihao-li.github.io/) | Personal site and Blog |
|
||||
| [phalanxhead.dev](https://phalanxhead.dev) | Personal site and Blog |
|
||||
| [Bible Multi Apps](https://hotlittlewhitedog.gitlab.io/biblemulti) | Personal site and Blog |
|
||||
| [Jh123x](https://jh123x.com/) | Personal site and Blog |
|
||||
| [sforzando LLC. and Inc.](https://sfz.dev/) | Corporate site and Blog |
|
||||
|
||||
**Congo user?** To add your site to this list, [submit a pull request](https://github.com/jpanther/congo/blob/dev/exampleSite/content/users.md).
|
||||