diff --git a/.gitignore b/.gitignore index 7ead5ada..5706be1b 100644 --- a/.gitignore +++ b/.gitignore @@ -140,3 +140,4 @@ hugo.linux # End of https://www.toptal.com/developers/gitignore/api/hugo exampleSite/public/ +TODO diff --git a/README.md b/README.md index b44a105f..6ceb5aa5 100644 --- a/README.md +++ b/README.md @@ -2,140 +2,90 @@ Congo is designed to be a fast, lightweight theme for Hugo. It's based upon Tailwind CSS with a clean and minimalist design. +🌏 [Demo site](https://jpanther.github.io/Congo/) +📑 [Theme documentation](https://jpanther.github.io/Congo/docs/) + +![Screenshot](https://raw.githubusercontent.com/jpanther/Congo/stable/images/screenshot.png) + ## Features -- Built with [Tailwind CSS JIT](https://tailwindcss.com/docs/just-in-time-mode) for minified stylesheets without any excess code -- Theme can be easily edited using simple [Tailwind colour definitions and styles](https://tailwindcss.com/docs) -- Dark mode support (auto-switching based upon browser) -- Highly customisable [configuration](#configuration) -- Custom content types and menus -- Custom taxonomies -- SVG social icons from [FontAwesome 5](https://fontawesome.com/) -- SEO friendly -- [Fathom Analytics](https://usefathom.com/ref/RLAJSV) and Google Analytics -- Favicons support - Generate using [favicon.io](https://favicon.io) -- [Comments support](https://gohugo.io/content-management/comments/) +- Built with Tailwind CSS JIT for minified stylesheets without any excess code +- Fully responsive layout +- Dark mode (auto-switching based upon browser) +- Highly customisable configuration +- Multiple homepage layouts +- Flexible with any content types, taxonomies and menus +- Ability to link to posts on third-party websites +- Diagrams and visualisations using Mermaid JS +- SVG icons from FontAwesome 5 +- Heading anchors, Buttons, Badges and more +- HTML and Emoji support in articles +- SEO friendly with links for sharing to social media +- RSS feeds +- Fathom Analytics and Google Analytics support +- Favicons support +- Comments support +- Advanced customisation using simple Tailwind colour definitions and styles +- [Fully documented](https://jpanther.github.io/Congo/docs/) + +--- ## Installation -Simply follow the standard Hugo [Quick Start](https://gohugo.io/getting-started/quick-start/) procedure to get up and running quickly. - -Detailed instructions can be found below. - -### 1. Install Hugo - -You can find specific instructions for your platform in the official [Hugo docs](https://gohugo.io/getting-started/installing.). - -Make sure you are using **Hugo version 0.86.1** or later as the theme takes advantage of some of the latest Hugo features. - -### 2. Create a new site - -Run the command `hugo new site mywebsite` to create a new Hugo site in a folder named `mywebsite`. - -### 3. Download the Congo theme +This is a simplified set of instructions and assumes a basic understanding of building Hugo sites and installing themes. For detailed instructions, refer to the full [theme documentation](https://jpanther.github.io/Congo/docs/). There are a couple of ways to install the Congo theme into your Hugo website. The git method is the easiest to keep the theme up-to-date, but you can also download and install manually if you don't have git available. -#### Install using git +### Install using git Change into the directory for your Hugo website, initialise a new repository and add Congo as a submodule. ```bash cd mywebsite git init -git submodule add https://github.com/jpanther/Congo.git themes/congo +git submodule add -b stable https://github.com/jpanther/Congo.git themes/congo ``` -_**Note:** You need to substitute `mywebsite` for the correct folder name you used in Step 2._ +### Install manually -#### Install manually +Download the latest release of the theme from: [https://github.com/jpanther/Congo/releases](https://github.com/jpanther/Congo/releases) -Download the latest version of the theme from: [https://github.com/jpanther/Congo/archive/master.zip](https://github.com/jpanther/Congo/archive/master.zip) +Extract the archive, rename the folder to `congo` and move it to the `themes/` directory inside your Hugo project. -Extract the archive and you should have a folder named `Congo-master`. +### Set up your configuration files -Rename the folder to `congo` and move it to the `themes/` directory inside your `mywebsite` folder. - -_**Note:** You need to substitute `mywebsite` for the correct folder name you used in Step 2._ - -### 4. Add Congo to your configuration file - -Open the `config.toml` file in the root of your website and add `theme = "congo"` +In the root folder of your website, delete the `config.toml` file that was generated by Hugo. Copy the entire `config` folder from `themes/congo/config/` into the root of your website. This will ensure you have all the correct theme settings and will enable you to easily customise the theme. You're now all set up to use Congo. From here you can add some content and start the Hugo server. -Refer to the Hugo docs for more information or read the next section to learn more about configuring the theme. - ## Configuration -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. This default configuration can be found in the `themes/congo/config/_default/` folder. - -> 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 as you wish. - -The default theme configuration can be overridden on a per-setting basis by copying the relevant setting from the `themes/congo/config/_default/` to your `config.toml` file in the root of your website. Any settings in your config file will take precedence over the theme defaults. - -### Getting started - -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. +For all the theme options and detailed configuration instructions, refer to the [Congo docs](https://jpanther.github.io/Congo/docs/). A few things you need to set for a new installation: ```toml -# config.toml +# config/_default/config.toml -theme = "congo" baseURL = "https://your_domain.com" languageCode = "en-AU" title = "My awesome website" ``` -It's also useful to add an author configuration by copying the settings from the `themes/congo/config/_default/author.toml` file. You can also add links to your profiles here to enable them in the theme. +It's also useful to set the author configuration in the `config/_default/author.toml` file. You can also add links to your profiles here to enable them in the theme. ```toml -# config.toml +# config/_default/author.toml [author] name = "Your name" -twitter = "https://twitter.com/username" +links = [ + { twitter = "https://twitter.com/username" } +] ``` -### 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. - -The same logic applies to taxonomies. Some people prefer to use _tags_ and _categories_, 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 the following files: - -```toml -# config.toml - -[taxonomies] -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 new sections: - -```toml -# config.toml - -[[menu.main]] - name = "Blog" - pageRef = "/posts/" - weight = 10 - -[[menu.main]] - name = "Topics" - pageRef = "/topics/" - weight = 20 -``` - -## Customising the theme +## Advanced customisation There are a couple of ways you can make style changes to Congo. @@ -190,6 +140,8 @@ npm run dev Now whenever you make a change, the (non-minified) CSS files will be rebuilt automatically. This mode is useful to run when using `hugo server` to preview your site during development. Remember to perform a full build before publishing your website. +--- + ## Contributing Congo is still very much a work in progress. I intend to keep adding features and making changes as required. @@ -199,3 +151,5 @@ Congo is still very much a work in progress. I intend to keep adding features an Feel free to get in touch with any issues or suggestions for new features you'd like to see. Please use GitHub issues for all bug reports and suggestions to help keep everything in one spot. If you're able to fix a bug or implement a new feature, I welcome PRs for this purpose. + +All development occurs on the `dev` branch and new PRs should be forked from here. diff --git a/assets/css/main.css b/assets/css/main.css index bec0ac1d..daf510e1 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -9,20 +9,22 @@ /* Heading anchors */ .prose .heading-anchor { - @apply absolute top-0 w-6 no-underline opacity-0 -left-6; + @apply absolute top-0 no-underline opacity-0; + width: 1.1em; + left: -1.1em; } .prose .heading-anchor:hover { - @apply underline bg-transparent opacity-100 text-primary-600; + @apply underline bg-transparent text-primary-600; } -.prose h2:focus > .heading-anchor, +.prose .heading-anchor:hover, +.prose .heading-anchor:focus, .prose h2:hover > .heading-anchor, -.prose h3:focus > .heading-anchor, .prose h3:hover > .heading-anchor, -.prose h4:focus > .heading-anchor, .prose h4:hover > .heading-anchor { @apply opacity-100; } +/* Prose escape hatch */ .no-prose > p { @apply mt-0 last:mb-0; } diff --git a/assets/icons/codepen.svg b/assets/icons/codepen.svg new file mode 100644 index 00000000..7a39ecd2 --- /dev/null +++ b/assets/icons/codepen.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/dev.svg b/assets/icons/dev.svg new file mode 100644 index 00000000..547b4111 --- /dev/null +++ b/assets/icons/dev.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/discord.svg b/assets/icons/discord.svg new file mode 100644 index 00000000..29d8307f --- /dev/null +++ b/assets/icons/discord.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/dribbble.svg b/assets/icons/dribbble.svg new file mode 100644 index 00000000..8965a0af --- /dev/null +++ b/assets/icons/dribbble.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/email.svg b/assets/icons/email.svg new file mode 100644 index 00000000..8b72d6f8 --- /dev/null +++ b/assets/icons/email.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/exclamation-triangle-solid.svg b/assets/icons/exclamation-triangle.svg similarity index 100% rename from assets/icons/exclamation-triangle-solid.svg rename to assets/icons/exclamation-triangle.svg diff --git a/assets/icons/facebook.svg b/assets/icons/facebook.svg new file mode 100644 index 00000000..649b4945 --- /dev/null +++ b/assets/icons/facebook.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/github-brands.svg b/assets/icons/github.svg similarity index 100% rename from assets/icons/github-brands.svg rename to assets/icons/github.svg diff --git a/assets/icons/gitlab.svg b/assets/icons/gitlab.svg new file mode 100644 index 00000000..abc7faed --- /dev/null +++ b/assets/icons/gitlab.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/instagram.svg b/assets/icons/instagram.svg new file mode 100644 index 00000000..53ab3119 --- /dev/null +++ b/assets/icons/instagram.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/keybase-brands.svg b/assets/icons/keybase.svg similarity index 100% rename from assets/icons/keybase-brands.svg rename to assets/icons/keybase.svg diff --git a/assets/icons/lastfm.svg b/assets/icons/lastfm.svg new file mode 100644 index 00000000..f0302e72 --- /dev/null +++ b/assets/icons/lastfm.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/link.svg b/assets/icons/link.svg new file mode 100644 index 00000000..586901d4 --- /dev/null +++ b/assets/icons/link.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/linkedin-brands.svg b/assets/icons/linkedin.svg similarity index 100% rename from assets/icons/linkedin-brands.svg rename to assets/icons/linkedin.svg diff --git a/assets/icons/mastodon.svg b/assets/icons/mastodon.svg new file mode 100644 index 00000000..4257e7c6 --- /dev/null +++ b/assets/icons/mastodon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/medium.svg b/assets/icons/medium.svg new file mode 100644 index 00000000..c5da4f83 --- /dev/null +++ b/assets/icons/medium.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/reddit.svg b/assets/icons/reddit.svg new file mode 100644 index 00000000..83ae62dd --- /dev/null +++ b/assets/icons/reddit.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/slack.svg b/assets/icons/slack.svg new file mode 100644 index 00000000..3c8e9003 --- /dev/null +++ b/assets/icons/slack.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/snapchat.svg b/assets/icons/snapchat.svg new file mode 100644 index 00000000..6e37c24d --- /dev/null +++ b/assets/icons/snapchat.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/soundcloud.svg b/assets/icons/soundcloud.svg new file mode 100644 index 00000000..01198684 --- /dev/null +++ b/assets/icons/soundcloud.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/steam.svg b/assets/icons/steam.svg new file mode 100644 index 00000000..0bfb16d8 --- /dev/null +++ b/assets/icons/steam.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tiktok.svg b/assets/icons/tiktok.svg new file mode 100644 index 00000000..0fcd7b10 --- /dev/null +++ b/assets/icons/tiktok.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/twitch.svg b/assets/icons/twitch.svg new file mode 100644 index 00000000..198dc64e --- /dev/null +++ b/assets/icons/twitch.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/twitter-brands.svg b/assets/icons/twitter.svg similarity index 100% rename from assets/icons/twitter-brands.svg rename to assets/icons/twitter.svg diff --git a/assets/icons/youtube.svg b/assets/icons/youtube.svg new file mode 100644 index 00000000..f59312a0 --- /dev/null +++ b/assets/icons/youtube.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/config/_default/author.toml b/config/_default/author.toml index 3daffe10..5aa0e4f9 100644 --- a/config/_default/author.toml +++ b/config/_default/author.toml @@ -1,9 +1,34 @@ +# -- Site Author Details -- +# To display the author box below each article, configure the settings below. +# The author image should be placed inside the `/static` folder. +# Uncomment any links to enable them. The icons will be displayed in the order listed. + [author] # name = "Your name here" # image = "/img/author.jpg" - # email = "hello@your_domain.com" - - # twitter = "https://twitter.com/username" - # github = "https://github.com/username" - # keybase = "https://keybase.io/username" - # linkedin = "https://linkedin.com/in/username/" + # links = [ + # { email = "mailto:hello@your_domain.com" }, + # { link = "https://link-to-some-website.com/" }, + # { codepen = "https://codepen.io/username" }, + # { dev = "https://dev.to/username" }, + # { discord = "https://discord.gg/invitecode" }, + # { dribbble = "https://dribbble.com/username" }, + # { facebook = "https://facebook.com/username" }, + # { github = "https://github.com/username" }, + # { gitlab = "https://gitlab.com/username" }, + # { instagram = "https://instagram.com/username" }, + # { keybase = "https://keybase.io/username" }, + # { lastfm = "https://lastfm.com/user/username" }, + # { linkedin = "https://linkedin.com/in/username" }, + # { mastodon = "https://mastodon.instance/@username" }, + # { medium = "https://medium.com/username" }, + # { reddit = "https://reddit.com/user/username" }, + # { slack = "https://workspace.url/team/userid" }, + # { snapchat = "https://snapchat.com/add/username" }, + # { soundcloud = "https://soundcloud.com/username" }, + # { steam = "https://steamcommunity.com/profiles/userid" }, + # { tiktok = "https://tiktok.com/@username" }, + # { twitch = "https://twitch.tv/username" }, + # { twitter = "https://twitter.com/username" }, + # { youtube = "https://youtube.com/username" }, + # ] diff --git a/config/_default/config.toml b/config/_default/config.toml index 8d028486..fda0ff81 100644 --- a/config/_default/config.toml +++ b/config/_default/config.toml @@ -1,9 +1,23 @@ +# -- Site Configuration -- theme = "congo" + +# Speficiy the base URL for the website. # baseURL = "https://your_domain.com/" + +# The language code of the language that the website is written in. +# This can be a base language (ie. "en") or a specific variant (ie. "en-AU"). languageCode = "en" +# The website title. This will be displayed in the site header. title = "Congo" + +# A default copyright message is generated automatically. +# Uncomment the line below to provide a custom copyright Markdown string. # copyright = "Copy, _right?_ :thinking_face:" +# To automatically convert strings such as :bang: to emoji, set this to true. enableEmoji = true + +# Congo will generate a robots file that allows search engines to index +# the entire site. If you don't want a robots file, set this to false. enableRobotsTXT = true diff --git a/config/_default/markup.toml b/config/_default/markup.toml index 2e144acd..2ca49b3b 100644 --- a/config/_default/markup.toml +++ b/config/_default/markup.toml @@ -1,5 +1,9 @@ -[highlight] - noClasses = false +# -- Markup -- +# These settings are required for the theme to function. +[goldmark] [goldmark.renderer] unsafe = true + +[highlight] + noClasses = false diff --git a/config/_default/menus.toml b/config/_default/menus.toml index 05445b84..7d0c31f4 100644 --- a/config/_default/menus.toml +++ b/config/_default/menus.toml @@ -1,3 +1,15 @@ +# -- Main Menu -- +# The main menu is displayed at the top of the theme. +# Acceptable parameters are name, pageRef, page, url, title, weight. +# +# The simplest menu configuration is to provide: +# name = The name to be displayed for this menu link +# pageRef = The identifier of the page or section to link to +# +# By default the menu is ordered alphabetically. This can be +# overridden by providing a weight value. The menu will then be +# ordered by weight from lowest to highest. + [[main]] name = "Blog" pageRef = "posts" diff --git a/config/_default/params.toml b/config/_default/params.toml index 40404aef..99730681 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -1,9 +1,39 @@ +# -- Theme Options -- +# These options control how the theme functions and allow you to +# customise the display of your website. +# +# Refer to the README for more details about each of these parameters. + +[homepage] + layout = "page" # valid options: page, profile, custom + showList = false + listSections = ["blog"] + +[article] + showDate = true + dateFormat = "2 January 2006" + showAuthor = true + showDraftLabel = true + showHeadingAnchors = true + showPagination = true + showReadingTime = true + # sharingLinks = ["facebook", "twitter", "reddit", "linkedin", "email"] + +[list] + groupByYear = true + +[taxonomy] + showTermCount = true + +[sitemap] + excludedKinds = ["taxonomy", "term"] + +[fathomAnalytics] + # site = "ABC12345" + # domain = "llama.yoursite.com" + [verification] # google = "" # bing = "" # pinterest = "" # yandex = "" - -[fathomAnalytics] - # site = "ABC12345" - # domain = "llama.yoursite.com" diff --git a/data/sharing.json b/data/sharing.json new file mode 100644 index 00000000..327c9b1d --- /dev/null +++ b/data/sharing.json @@ -0,0 +1,27 @@ +{ + "email": { + "icon": "email", + "title": "Send via email", + "url": "mailto:?body=%s&subject=%s" + }, + "facebook": { + "icon": "facebook", + "title": "Share on Facebook", + "url": "https://www.facebook.com/sharer/sharer.php?u=%s"e=%s" + }, + "linkedin": { + "icon": "linkedin", + "title": "Share on LinkedIn", + "url": "https://www.linkedin.com/shareArticle?mini=true&url=%s&title=%s" + }, + "reddit": { + "icon": "reddit", + "title": "Submit to Reddit", + "url": "https://reddit.com/submit/?url=%s&resubmit=true&title=%s" + }, + "twitter": { + "icon": "twitter", + "title": "Tweet on Twitter", + "url": "https://twitter.com/intent/tweet/?url=%s&text=%s" + } +} diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 5721b3af..72d7e926 100755 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -1,28 +1,59 @@ +# Site configuration for the Congo demo site +# -------------------------------------------------------------------------- +# IMPORTANT: You should not use this file as a template for configuration +# as it does not contain all the required theme settings! +# +# Refer to the theme docs for configuration instructions if you're unsure. +# https://github.com/jpanther/Congo#readme +# -------------------------------------------------------------------------- + baseURL = "https://example.com" theme = "Congo" languageCode = "en-AU" title = "Congo" +enableEmoji = true [author] - name = "Freddy Blogger" - image = "https://i.pravatar.cc/150?img=11" - twitter = "https://twitter.com/" - github = "https://github.com/" - linkedin = "https://linkedin.com/" - -[[menu.main]] - name = "Blog" - pageRef = "blog" - weight = 10 -[[menu.main]] - name = "About" - pageRef = "about" - weight = 20 -[[menu.main]] - name = "Tags" - url = "tags" - weight = 30 + name = "Congo" + image = "/img/author.jpg" + links = [ + { twitter = "https://twitter.com/" }, + { facebook = "https://facebook.com/" }, + { linkedin = "https://linkedin.com/" }, + { youtube = "https://youtube.com/" }, + ] [taxonomies] - category = "categories" tag = "tags" + +[params.homepage] + layout = "custom" + showList = true + listSections = "samples" + +[params.list] + groupByYear = false + +[[menu.main]] + name = "Docs" + pageRef = "docs" + weight = 10 +[[menu.main]] + name = "Samples" + pageRef = "samples" + weight = 20 +# [[menu.main]] +# name = "Users" +# pageRef = "users" +# weight = 30 +[[menu.main]] + name = "GitHub" + url = "https://github.com/jpanther/Congo" + weight = 40 + +[markup.goldmark] +[markup.goldmark.renderer] + unsafe = true + +[markup.highlight] + noClasses = false diff --git a/exampleSite/content/_index.md b/exampleSite/content/_index.md index f494b487..f228f37f 100755 --- a/exampleSite/content/_index.md +++ b/exampleSite/content/_index.md @@ -1,14 +1,14 @@ --- -title: "Welcome to Congo! 🎉" -description: "This is a demo of the Congo theme for Hugo" +title: "Welcome to Congo! :tada:" +description: "This is a demo of the Congo theme for Hugo." --- {{< lead >}} A simple, lightweight theme for Hugo built with Tailwind CSS. {{< /lead >}} -This is the homepage. It's just plain Markdown content and can render whatever you wish. +This is a demo site built entirely using Congo. It also contains a complete set of [theme documentation](/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. -Perhaps you'll link to an [about](/about) page, or direct people to check out your [blog posts](/post). It's really up to you. +Explore the [sample pages](/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](/docs/installation/) to get started. {{< figure src="mountains.jpg" caption="Photo by [Anna Scarfiello](https://unsplash.com/@little_anne?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)." >}} diff --git a/exampleSite/content/about.md b/exampleSite/content/about.md deleted file mode 100755 index 9a69a635..00000000 --- a/exampleSite/content/about.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: "About" -description: "Hugo, the world's fastest framework for building websites" -date: 2019-02-28 ---- - -Written in Go, Hugo is an open source static site generator available under the [Apache Licence 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows. - -Hugo makes use of a variety of open source projects including: - -- https://github.com/yuin/goldmark -- https://github.com/alecthomas/chroma -- https://github.com/muesli/smartcrop -- https://github.com/spf13/cobra -- https://github.com/spf13/viper - -Hugo is ideal for blogs, corporate websites, creative portfolios, online magazines, single page applications or even a website with thousands of pages. - -Hugo is for people who want to hand code their own website without worrying about setting up complicated runtimes, dependencies and databases. - -Websites built with Hugo are extremely fast, secure and can be deployed anywhere including, AWS, GitHub Pages, Heroku, Netlify and any other hosting provider. - -Learn more and contribute on [GitHub](https://github.com/gohugoio). diff --git a/exampleSite/content/blog/_index.md b/exampleSite/content/blog/_index.md deleted file mode 100755 index 0682cfb0..00000000 --- a/exampleSite/content/blog/_index.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: "Blog" -description: "My life in words." ---- diff --git a/exampleSite/content/docs/_index.md b/exampleSite/content/docs/_index.md new file mode 100755 index 00000000..cb8ce946 --- /dev/null +++ b/exampleSite/content/docs/_index.md @@ -0,0 +1,14 @@ +--- +title: "Documentation" +description: "Learn how to use Congo and its features." +--- + +{{< lead >}} +Simple, yet powerful. Learn how to use Congo and its features. +{{< /lead >}} + +{{< figure src="screenshot.png" >}} + +This section contains everything you need to know about Congo. If you're new, check out the [Installation](/docs/installation/) guide to begin or visit the [Samples](/samples/) section to see what Congo can do. + +--- diff --git a/exampleSite/content/docs/advanced-customisation.md b/exampleSite/content/docs/advanced-customisation.md new file mode 100644 index 00000000..2400e336 --- /dev/null +++ b/exampleSite/content/docs/advanced-customisation.md @@ -0,0 +1,65 @@ +--- +title: "Advanced Customisation" +date: 2020-08-09 +draft: false +description: "Learn how to build Congo manually." +slug: "advanced-customisation" +tags: ["advanced", "css", "docs"] +showDate: false +showAuthor: false +--- + +There are a couple of ways you can make style changes to Congo. + +If you just need to add or override some simple styles, you can do so by creating a `custom.css` file in your project's `static/css/` folder. This file will be loaded automatically after the theme's default styles. + +Alternatively, 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. + +{{< alert >}} +**Note:** Building the theme manually is intended for advanced users. +{{< /alert >}} + +Change into the `themes/congo/` folder and install the project dependencies. + +```bash +npm install +``` + +Once installed, you can edit the `themes/congo/tailwind.config.js` to change the styles that are applied throughout the theme. You can also adjust specific styles in `themes/congo/assets/css/main.css`. + +To allow for easy theme colour changes, Congo defines a `primary` and `secondary` colour palette that is used throughout the theme. In order to change the colour across the entire theme, simply edit the `tailwind.config.js` file accordingly. + +For example, to change to a green colour scheme, you could apply these changes: + +```js + // themes/congo/tailwind.config.js + + theme: { + colors: { + transparent: "transparent", + white: colors.white, + gray: colors.gray, + primary: colors.lime, + secondary: colors.teal, + }, + ... + } +``` + +For a full list of colours available, and their corresponding configuration values, see the official [Tailwind docs](https://tailwindcss.com/docs/customizing-colors#color-palette-reference). + +After editing the configuration, you need to rebuild the theme's stylesheets. + +```bash +npm run build +``` + +This will automatically output a minified CSS file to `/themes/congo/static/css/main.css`. + +To aid with testing style changes, you can also run the Tailwind JIT comiler in watch mode. + +```bash +npm run dev +``` + +Now whenever you make a change, the (non-minified) CSS files will be rebuilt automatically. This mode is useful to run when using `hugo server` to preview your site during development. Remember to perform a full build before publishing your website. diff --git a/exampleSite/content/docs/configuration.md b/exampleSite/content/docs/configuration.md new file mode 100644 index 00000000..f0720377 --- /dev/null +++ b/exampleSite/content/docs/configuration.md @@ -0,0 +1,53 @@ +--- +title: "Configuration" +date: 2020-08-14 +draft: false +description: "All the configuration variables available in Congo." +slug: "configuration" +tags: ["config", "docs"] +showDate: false +showAuthor: false +--- + +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](/docs/installation/#set-up-your-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 >}} + +## 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](/docs/front-matter/) section for further details. + + +|Name|Type|Default|Description| +| --- | --- | --- | --- | +|`homepage.layout`|string|`"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](/docs/homepage-layout/) section for more details.| +|`homepage.showList`|boolean|`false`|Whether or not recent articles are listed on the homepage beneath the page content. Refer to the [Recent Articles](/docs/homepage-layout/#recent-articles) docs for more details.| +|`homepage.listSections`|array of strings|`["blog"]`|The sections of content to include in the recent list when `homepage.showList` is `true`.| +|`article.showDate`|boolean|`true`|Whether or not article dates are displayed.| +|`article.dateFormat`|string|`"2 January 2006"`|How article dates are formatted. Refer to the [Hugo docs](https://gohugo.io/functions/format/#gos-layout-string) for acceptable formats.| +|`article.showAuthor`|boolean|`true`|Whether or not the author box is displayed in the article footer.| +|`article.showDraftLabel`|boolean|`true`|Whether or not the draft indicator is shown next to articles when site is built with `--buildDrafts`.| +|`article.showHeadingAnchors`|boolean|`true`|Whether or not heading anchor links are displayed alongside headings within articles.| +|`article.showPagination`|boolean|`true`|Whether or not the next/previous article links are displayed in the article footer.| +|`article.showReadingTime`|boolean|`true`|Whether or not article reading times are displayed.| +|`article.sharingLinks`|array of strings|_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.groupByYear`|boolean|`true`|Whether or not articles are grouped under years in the article listing.| +|`sitemap.excludedKinds`|array of strings|`["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`|boolean|`true`|Whether or not the number of articles within a taxonomy term is displayed on the taxonomy listing.| +|`fathomAnalytics.site`|string|_Not set_|The site code generated by Fathom Analytics for the website. Refer to the [Analytics docs](#analyticshtml) below for more details.| +|`fathomAnalytics.domain`|string|_Not set_|If using a custom domain with Fathom Analytics, provide it here to serve `script.js` from the custom domain.| +|`verification.google`|string|_Not set_|The site verification string provided by Google to be included in the site metadata.| +|`verification.bing`|string|_Not set_|The site verification string provided by Bing to be included in the site metadata.| +|`verification.pinterest`|string|_Not set_|The site verification string provided by Pinterest to be included in the site metadata.| +|`verification.yandex`|string|_Not set_|The site verification string provided by Yandex to be included in the site metadata.| + diff --git a/exampleSite/content/docs/front-matter.md b/exampleSite/content/docs/front-matter.md new file mode 100644 index 00000000..553ae9a2 --- /dev/null +++ b/exampleSite/content/docs/front-matter.md @@ -0,0 +1,26 @@ +--- +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"] +showDate: false +showAuthor: false +--- + +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 parameters are listed below. + +Front matter parameter default values are inherited from the theme's [base configuration](/docs/configuration/), so you only need to specify these parameters in your front matter when you want to override the default. + + +|Name|Type|Default|Description| +| --- | --- | --- | --- | +|`externalUrl`|string|_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.| +|`showDate`|boolean|`article.showDate`|Whether or not article dates are displayed.| +|`showAuthor`|boolean|`article.showAuthor`|Whether or not the author box is displayed in the article footer.| +|`showHeadingAnchors`|boolean|`article.showHeadingAnchors`|Whether or not heading anchor links are displayed alongside headings within this article.| +|`showPagination`|boolean|`article.showPagination`|Whether or not the next/previous article links are displayed in the article footer.| +|`showReadingTime`|boolean|`article.showReadingTime`|Whether or not article reading times are displayed.| +|`xml`|boolean|`true` unless excluded by `sitemap.excludedKinds`|Whether or not this article is included in the generated `/sitemap.xml` file.| + diff --git a/exampleSite/content/docs/getting-started.md b/exampleSite/content/docs/getting-started.md new file mode 100644 index 00000000..6dd36e4a --- /dev/null +++ b/exampleSite/content/docs/getting-started.md @@ -0,0 +1,73 @@ +--- +title: "Getting Started" +date: 2020-08-15 +draft: false +description: "All the front matter variables available in Congo." +slug: "getting-started" +tags: ["installation", "docs"] +showDate: false +showAuthor: false +--- + +{{< alert >}} +This section assumes you have already [installed the Congo theme](/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. + +A few things you need to set for a new installation: + +```toml +# config/_default/config.toml + +baseURL = "https://your_domain.com" +languageCode = "en-AU" + +title = "My awesome website" +``` + +It's also useful to set the author configuration in the `config/_default/author.toml` file. You can also add links to your profiles here to enable them in the theme. + +```toml +# config/_default/author.toml + +[author] +name = "Your name" +links = [ + { twitter = "https://twitter.com/username" } +] +``` + +## 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. + +The same logic applies to taxonomies. Some people prefer to use _tags_ and _categories_, 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 the following files: + +```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 new sections: + +```toml +# config/_default/menus.toml + +[[main]] + name = "Blog" + pageRef = "posts" + weight = 10 + +[[main]] + name = "Topics" + pageRef = "topics" + weight = 20 +``` + +These steps 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](/docs/configuration/) section. diff --git a/exampleSite/content/docs/homepage-layout/home-page.jpg b/exampleSite/content/docs/homepage-layout/home-page.jpg new file mode 100644 index 00000000..2a619e05 Binary files /dev/null and b/exampleSite/content/docs/homepage-layout/home-page.jpg differ diff --git a/exampleSite/content/docs/homepage-layout/home-profile-list.jpg b/exampleSite/content/docs/homepage-layout/home-profile-list.jpg new file mode 100644 index 00000000..319da77b Binary files /dev/null and b/exampleSite/content/docs/homepage-layout/home-profile-list.jpg differ diff --git a/exampleSite/content/docs/homepage-layout/home-profile.jpg b/exampleSite/content/docs/homepage-layout/home-profile.jpg new file mode 100644 index 00000000..006c8576 Binary files /dev/null and b/exampleSite/content/docs/homepage-layout/home-profile.jpg differ diff --git a/exampleSite/content/docs/homepage-layout/index.md b/exampleSite/content/docs/homepage-layout/index.md new file mode 100644 index 00000000..7a54895c --- /dev/null +++ b/exampleSite/content/docs/homepage-layout/index.md @@ -0,0 +1,48 @@ +--- +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"] +showDate: false +showAuthor: false +--- + +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. + +## 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. + +![Profile layout](home-page.jpg) + +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 `author.toml` configuration file. 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. + +![Profile layout](home-profile.jpg) + +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 can use whatever HTML, Tailwind, or Hugo templating functions to define your layout. + +## Recent articles + +All homepage layouts have the option of displaying recent articles below the main page content. To enable this, simply set the `homepage.showList` setting to `true` in the `params.toml` configuration file. + +![Profile layout with recent articles](home-profile-list.jpg) + +The articles listed in this section are derived from the `homepage.listSections` 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"]`. diff --git a/exampleSite/content/docs/installation.md b/exampleSite/content/docs/installation.md new file mode 100644 index 00000000..d06b349d --- /dev/null +++ b/exampleSite/content/docs/installation.md @@ -0,0 +1,62 @@ +--- +title: "Installation" +date: 2020-08-16 +draft: false +description: "How to install the Congo theme." +slug: "installation" +tags: ["installation", "docs"] +showDate: false +showAuthor: false +--- + +Simply follow the standard Hugo [Quick Start](https://gohugo.io/getting-started/quick-start/) procedure to get up and running quickly. + +Detailed instructions can be found below. + +## Install Hugo + +You can find specific instructions for your platform in the official [Hugo docs](https://gohugo.io/getting-started/installing.). + +Make sure you are using **Hugo version 0.86.1** or later as the theme takes advantage of some of the latest Hugo features. + +## Create a new site + +Run the command `hugo new site mywebsite` to create a new Hugo site in a folder named `mywebsite`. + +## Download the Congo theme + +There are a couple of ways to install the Congo theme into your Hugo website. The git method is the easiest to keep the theme up-to-date, but you can also download and install manually if you don't have git available. + +### Install using git + +Change into the directory for your Hugo website, initialise a new 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 +``` + +{{< alert >}} +**Note:** You need to substitute `mywebsite` for the correct folder name you used in Step 2. +{{< /alert >}} + +### Install manually + +Download the latest release of the theme. + +{{< button href="https://github.com/jpanther/Congo/releases" target="_blank" >}}Download from Github{{< /button >}} + +Extract the archive, rename the folder to `congo` and move it to the `themes/` directory inside your your `mywebsite` folder. + +{{< alert >}} +**Note:** You need to substitute `mywebsite` for the correct folder name you used in Step 2. +{{< /alert >}} + +## Set up your configuration files + +In the root folder of your website, delete the `config.toml` file that was generated by Hugo. Copy the entire `config` folder from `themes/congo/config/` into the root of your website. This will ensure you have all the correct theme settings and will enable you to easily customise the theme. + +You're now all set up to use Congo. From here you can add some content and start the Hugo server. + +Refer to the Hugo docs for more information or read the next section to learn more about configuring the theme. diff --git a/exampleSite/content/docs/partials.md b/exampleSite/content/docs/partials.md new file mode 100644 index 00000000..d126358c --- /dev/null +++ b/exampleSite/content/docs/partials.md @@ -0,0 +1,91 @@ +--- +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"] +showDate: false +showAuthor: false +--- + +## 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. + +```toml +# config/_default/config.toml + +googleAnalytics = "UA-PROPERTY_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 `` 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. + +## 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 `` in place of the default assets. + +## Icon + +Similar to the [icon shortcode](/docs/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" }} +``` + +Congo includes a number of built-in icons for social, links and other purposes. You can also provide your own icon assets by including the SVG in `assets/icons/`. + +## 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`](/docs/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 `` and `