Convert Figma logo to code with AI

theNewDynamic logogohugo-theme-ananke

Ananke: A theme for Hugo Sites

1,288
1,237
1,288
77

Top Related Projects

A minimalist blog theme for hugo.

A fast, clean, responsive Hugo theme.

A simple, retro theme for Hugo

Card-style Hugo theme designed for bloggers

Quick Overview

Ananke is a responsive and customizable theme for Hugo, a popular static site generator. It provides a clean and modern design suitable for various types of websites, including blogs, portfolios, and small business sites. Ananke is known for its ease of use and flexibility.

Pros

  • Easy to set up and customize with minimal configuration
  • Responsive design that works well on desktop and mobile devices
  • Built-in support for multilingual websites
  • Integration with Netlify CMS for content management

Cons

  • Limited built-in layout options compared to some other Hugo themes
  • May require custom CSS for more advanced design customizations
  • Documentation could be more comprehensive for advanced users
  • Some users report occasional issues with image handling

Getting Started

To use the Ananke theme with your Hugo site:

  1. Initialize a new Hugo site:

    hugo new site my-site
    cd my-site
    
  2. Add the Ananke theme as a submodule:

    git init
    git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke
    
  3. Add the theme to your Hugo configuration file (config.toml):

    theme = "ananke"
    
  4. Start the Hugo server:

    hugo server -D
    

Your site should now be running with the Ananke theme. Customize the config.toml file to adjust site settings and theme options.

Competitor Comparisons

A minimalist blog theme for hugo.

Pros of hugo-coder

  • Minimalist design with a focus on readability and simplicity
  • Built-in dark mode support
  • More customization options for social media links and icons

Cons of hugo-coder

  • Less visually striking than gohugo-theme-ananke's default design
  • Fewer built-in shortcodes for content enhancement
  • Limited color scheme options without custom CSS

Code Comparison

hugo-coder (config.toml):

[params]
  author = "John Doe"
  info = "Full Stack DevOps and Magician"
  description = "John Doe's personal website"
  keywords = "blog,developer,personal"
  avatarurl = "images/avatar.jpg"

gohugo-theme-ananke (config.toml):

[params]
  favicon = ""
  site_logo = ""
  description = "The last theme you'll ever need. Maybe."
  facebook = ""
  twitter = "https://twitter.com/GoHugoIO"
  instagram = ""
  youtube = ""

Both themes offer easy configuration through the config.toml file, but hugo-coder provides more detailed options for personal information and social media links. gohugo-theme-ananke focuses on site-wide settings and major social platforms.

A fast, clean, responsive Hugo theme.

Pros of PaperMod

  • More customization options and features, including dark mode and multiple language support
  • Cleaner and more modern design aesthetic
  • Better performance optimization, resulting in faster load times

Cons of PaperMod

  • Steeper learning curve for beginners due to more complex configuration options
  • Less out-of-the-box compatibility with older Hugo versions

Code Comparison

PaperMod:

params:
  env: production
  defaultTheme: auto
  ShowReadingTime: true
  ShowShareButtons: true
  ShowPostNavLinks: true

Ananke:

[params]
  featured_image = "/images/gohugo-default-sample-hero-image.jpg"
  recent_posts_number = 2
  custom_css = ["css/custom.css"]

PaperMod offers more granular control over theme features and appearance, while Ananke focuses on simplicity and ease of use. PaperMod's configuration allows for more detailed customization of post display and user interaction elements, whereas Ananke's configuration emphasizes basic layout and content presentation options.

Both themes are popular choices for Hugo websites, with PaperMod being more suitable for users seeking advanced features and customization, while Ananke is ideal for those prioritizing simplicity and quick setup.

A simple, retro theme for Hugo

Pros of hugo-theme-terminal

  • Minimalist design with a focus on content and readability
  • Built-in dark mode support for improved user experience
  • Customizable color schemes to match personal preferences

Cons of hugo-theme-terminal

  • Limited built-in features compared to gohugo-theme-ananke
  • Less flexibility in layout options and homepage customization
  • Steeper learning curve for users new to terminal-style interfaces

Code Comparison

hugo-theme-terminal:

<header class="header">
  <div class="header__inner">
    <div class="header__logo">
      {{ partial "logo.html" . }}
    </div>
    {{ partial "menu.html" . }}
  </div>
</header>

gohugo-theme-ananke:

<header>
  <div class="pb3-m pb6-l {{ .Site.Params.background_color_class | default "bg-black" }}">
    {{ partial "site-navigation.html" . }}
    {{ partial "site-header.html" . }}
  </div>
</header>

Both themes use partials for modular design, but hugo-theme-terminal has a simpler structure, while gohugo-theme-ananke includes more customization options through site parameters.

Card-style Hugo theme designed for bloggers

Pros of Stack

  • More feature-rich with built-in dark mode, search functionality, and social sharing options
  • Highly customizable with extensive configuration options
  • Modern and visually appealing design, particularly suited for blog-style websites

Cons of Stack

  • Steeper learning curve due to more complex configuration
  • May be overkill for simple, minimalist websites
  • Requires more resources to load due to additional features

Code Comparison

Stack (config.yaml):

params:
  mainSections:
    - post
  featuredImageField: image
  rssFullContent: true
  favicon:

Ananke (config.toml):

[params]
  featured_image = "/images/gohugo-default-sample-hero-image.jpg"
  recent_posts_number = 2

Stack offers more granular control over configuration, while Ananke provides a simpler setup with fewer options. Stack's YAML configuration allows for nested structures, whereas Ananke uses TOML for a flatter, more straightforward approach.

Both themes are well-maintained and popular choices for Hugo websites. Stack is better suited for content-rich blogs with advanced features, while Ananke is ideal for simpler, elegant websites with a focus on readability and clean design.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Ananke, A theme for Hugo, a framework for building websites

[!WARNING] Parts of this documentation, such as the sections related to the production environment, are currently a work in progress. This is due to recent changes and updates in the theme. We are actively working on providing complete and up-to-date guidance. Thank you for your patience.

The intent of this theme is to provide a solid starting place for Hugo sites with basic features and include best practices for performance, accessibility, and rapid development.

screenshot

DEMO

Features

  • Responsive
  • Accessible
  • Contact form
  • Custom Robots.txt (changes values based on environment)
  • Internal templates for meta data, google analytics, and DISQUS or COMMENTO comments
  • RSS Discovery
  • Table of Contents (must declare toc: true in post parameter)

Also includes examples of Hugo Features or Functions:

  • Pagination (internal template)
  • Taxonomies
  • Archetypes
  • Custom shortcode
  • Related content
  • Hugo built-in menu
  • i18n
  • with
  • first
  • after
  • sort
  • Site LanguageCode
  • where
  • Content Views
  • Partials
  • Template layouts (type "post" uses a special list template, single template, and a content view)
  • Tags
  • len
  • Conditionals
  • ge (greater than or equal to)
  • .Site.Params.mainSections to avoid hard-coding "blog," etc. [release note]

This theme uses the Tachyons CSS library. This will allow you to manipulate the design of the theme by changing class names in HTML without touching the original CSS files.

Installation

Dive into our documentation on installing the theme as GoHugo Module or Git Submodule. The official setup guide of GoHugo covers the installation of the theme as Git Submodule.

Getting started

After installing the theme successfully it requires a just a few more steps to get your site running.

The config file

Take a look inside the exampleSite folder of this theme. You'll find a file called config.toml. To use it, copy the config.toml in the root folder of your Hugo site. Feel free to change the strings in this theme.

Add comments

To enable comments, add following to your config file:

  • DISQUS:

    [services.disqus]
      shortname = 'YOURSHORTNAME'
    
  • COMMENTO:

    [params]
      commentoEnable = true
    

Change the hero background

For any page or post you can add a featured image by including the local path in front matter (see content in the exampleSite/content/en/_readme.md file for examples): featured_image = '/images/gohugo-default-sample-hero-image.jpg'

Featured image as Page Resources

If user is using Page Resources, the theme will try and match the featured_image from with a page resource of type image and use its relative permalink. If no featured_image is set, the theme will look for a Page Resource of type image whose filepath includes either cover or feature

Other hero settings

If you would like to hide the header text on the featured image on a page, set omit_header_text to true. See exampleSite/content/en/contact.md for an example.

You don't need an image though. The default background color is black, but you can change the color, by changing the default color class in the config.toml file. Choose a background color from any on the Tachyons library site, and preface it with "bg-"

example: background_color_class = "bg-blue" or background_color_class = "bg-gray"

The default fitting and alignment for the featured image is cover bg-top, but can be changed using the featured_image_class. Choose a fitting and alignment style for the featured image using Tachyons classes such as "cover|contain" for fitting and "bg-top|bg-center|bg-bottom" for alignment.

example: featured_image_class = "cover bg-center" or featured_image_class = "contain bg-top"

The default cover backdrop for the featured image is bg-black-60, but can be changed using the cover_dimming_class. Choose a color dimming class for the page or site header from any on the Tachyons library site, preface it with "bg-" and add the value such as "-X0" where X is in [1,9]

example: cover_dimming_class = "bg-black-20" or cover_dimming_class = "bg-white-40"

Activate the contact form

This theme includes a shortcode for a contact form that you can add to any page (there is an example on the contact page in the exampleSite folder). One option is to use formspree.io as proxy to send the actual email. Each month, visitors can send you up to fifty emails without incurring extra charges. Visit the Formspree site to get the "action" link and add it to your shortcode like this:

{{< form-contact action="https://formspree.io/your@email.com" >}}

Read more link

The homepage and other areas of the site use a read more link on the element. You can customize the copy of this link to make it more descriptive with the parameter read_more_copy available as a site and front matter parameter.

# config.toml
# Globally for all pages:
[params]
read_more_copy = "Read more about this entry"

# Just for french
[languages.fr]
name = "Français"
weight = 2

[languages.fr.params]
read_more_copy = "En savoir plus à ce sujet"

Using front matter and cascade, this can be customized for a whole section, or just for one page.

# content/posts/tower-bridge-london.md
  title: The Tower Bridge of London
  read_more_copy: Read more about this bridge

Social Media Follow + Share

Read the documentation for social media follow and social share in our wiki.

This project uses Font Awesome brand icons, which are licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0). For more information, visit Font Awesome.

Content indexing

If the theme is run in production, pages will be indexed by search engines. To prevent indexing on some given pages, add private: true to its Front Matter.

Update font or body classes

The theme is set, by default, to use a near-white background color and the "Avenir" or serif typeface. You can change these in your config file with the body_classes parameter, like this:

[params]
  body_classes = "avenir bg-near-white"

which will give you a body class like this:

<body class="avenir bg-near-white">

note: The body_classes parameter will not change the font used in post content. To do this, you must use the post_content_classes parameter.

You can find a list of available typefaces here.

And a list of background colors here.

n.b. in future versions we will likely separate the typeface and other body classes.

CSS

Ananke stylesheet is built with Hugo Pipes's Asset Bundling alone to maximize compatibility. The theme simply bundles its several files into one minified and fingerprinted (in production) CSS file.

Ananke uses Tachyons.io utility class library.

Custom CSS

WARNING: Pending resolution of this discussion, Custom CSS only works with Hugo Extended

In order to complement the default CSS with your own, you can add custom css files to the project.

  1. Just add a assets/ananke/css directory to your project and add the file(s) in it.
  2. Register the files using the custom_css key in your site's parameter. The path referenced in the parameter should be relative to the assets/ananke/css folder.

The css files will be added in their registered order to final main.css file.

For example, if your css files are assets/ananke/css/custom.css and assets/ananke/special.css then add the following to the config file:

[params]
custom_css = ["custom.css","special.css"]

IMPORTANT: Files registered through the custom_css array, while unlimited in number, must be of the same type (Ex: all scss or all css)

Note on retrocompatibiliy for custom css: If the files registered through the custom_css setting are not found in assets/ananke/css the theme will expect them to live at the given path relative to the static directory and load them as <link> requests.

Show Reading Time and Word Count

If you add a key of show_reading_time true to either the Config Params, a page or section's front matter, articles will show the reading time and word count.

Adding Scripts to the Page Head

Some scripts need to be added within the page head. To add your own scripts to the page head, simply insert them into the head-additions.html partial located in the layouts/partials folder.

Logo

You can replace the title of your site in the top left corner of each page with your own logo. To do that put your own logo into the static directory of your website, and add the site_logo parameter to the site params in your config file. For example:

[params]
site_logo = "img/logo.svg"

Set Content Font Color

You can set the font color of the main content both globally and on individual pages:

Globally: Set the text_color param in the config.toml file.

[params]
text_color = "green"

Individual Page (prioritized over global): Set the text_color param in a page's markdown file front matter.

note: The value of text_color must be a valid tachyons color class. A list can be found here.

Localize date format

Dates of blog posts and single pages are rendered with the default date format commonly used in the USA and Canada. It is possible to specify a different format.

[params]
date_format = "2. January 2006"

With hugo 0.87.0 and above, you can also use predefined layout, like :date_full, and it will output localized dates or times. See hugo's documentation of the time.Format function for more details.

Using a canonical url

When you want to publish content that is already published on a different site. You need to reference a canonical url of the original content. By defining the canonicalUrl in the front matter definition the canonical url is set in the headers.

canonicalUrl: https://mydomain.com/path-to-the-oringinal-content/

Nearly finished

In order to see your site in action, run Hugo's built-in local server.

hugo server

Now enter localhost:1313 in the address bar of your browser.

Contributing

If you find a bug feel free to use the issue tracker to let me know. If you are having issues setting up your site with the theme, or have an idea for a feature, please use the discussions for support.

Join me on my ananke-theme Discord channel for direct support.