How to left justify content in all pages using Ananke

Can’t seem to find what controls this?

How to left justify content

To which content are you referring? The prose is already left-justified when viewing either a content page or a list page.

If by “justify” you mean pulling everything to the left, search the templates for application of the “center” class. For example, in layouts/page/single.html

<div class="flex-l mt2 mw8 center">

Don’t modify the theme. Instead, override individual templates as needed by copying them to the same path within the layouts directory in the root of your project.

Finally, note that the structure of the Ananke theme’s layouts directory is currently incompatible with Hugo v0.146.0 and later. Yes, we’re using referencing the Ananke theme in our quick start guide, but we’ll replace it with something else if the theme author doesn’t update it soon. See https://github.com/gohugoio/hugoDocs/issues/2548.

The theme currently uses Tachyons as the style system, and the centered text (for instance, on the index page) is created via the tc and tc-l classes. Depending on the location of your issue, look for these classes. On the homepage, for instance, all text is centered. If you want to change this to left-aligned, remove tc-l on this line:

The center class is for the container’s position on the page, and adds margin: 0 auto; to center the whole article container.

And better do this in a copy of index.html in your local tree, not in the theme’s file.

1 Like