Giter Club home page Giter Club logo

hugo-terrassa-theme's Introduction

Terrassa - Hugo Theme

Terrassa is a simple, fast and responsive theme for Hugo with a strong focus on accessibility made from scratch.

Hugo Terrassa theme screenshot

Archived

I have decided to archive the project as I have been and am unable to give it the necessary support.

I started Terrassa as a way to experiment with Hugo and the Go template system and the truth is that I didn't expect the support that the project has been getting over time. Unfortunately over time I have had to move on to working with other technologies and on other projects and have never had enough time to re-familiarise myself with the code and continue working on the project.

Many thanks to all the people who have used Terrassa, who have sent PRs and above all to the people who encouraged me and talked about how they were using Terrassa to bring their projects to life.

Features

  • Coherent responsive design.
  • Consistent design throughout the entire site.
  • Classic navigation menu in large screen sizes.
  • Hamburger menu in mobile devices.
  • Focus on accessibility.
  • Customizable call to action on the home page.
  • Contact form.
  • Ready for blogging.
  • Multilingual Support

Installation

To install Terrassa run the followings command inside your Hugo site:

$ mkdir themes
$ cd themes
$ git clone https://github.com/danielkvist/hugo-terrassa-theme.git terrassa

Or

$ mkdir themes
$ cd themes
$ git submodule add https://github.com/danielkvist/hugo-terrassa-theme.git terrassa

You can also download the last release here.

Back to your Hugo site directory open the config.toml file and add or change the following line:

theme = "terrassa"

Configuration

You can find an example of the final configuration here.

Basic

baseurl = "/"           # The base URL of your Hugo site
title = "titlehere"     # The title of your Hugo site
author = "authorhere"   # The author name
googleAnalytics = ""    # Your Google Analytics tracking ID
enableRobotsTXT = true
language = "en-US"
paginate = 7            # The numbers of posts per page
theme = "terrassa"      # Your Hugo theme

There's a lot more information about the basic configuration of an Hugo site here.

Description, favicon and logo params

[params]
    description = "" # Description for the meta description tag
    favicon = ""     # Relative URL for your favicon
    logo = ""        # Absolute URL for your logo

Hero

[params.hero]
    textColor = "" # Empty for default color

Call To Action

[params.cta] # Call To Action
    show = true
    cta = "Contact"  # Text message of the CTA
    link = "contact" # Relative URL

Separators between Home sections

[params.separator]
    show = false

Contact information

[params.contact]
    email = ""
    phone = ""
    skype = ""
    address = ""

Social Networks

[params.social]
    twitter = ""
    facebook = ""
    github = ""
    gitlab = ""
    codepen = ""
    instagram = ""
    pinterest = ""
    youtube = ""
    linkedin = ""
    weibo = ""
    mastodon = ""
    tumblr = ""
    flickr = ""
    "500px" = ""

Icons for social networks depend on Font Awesome.

Font Awesome

[params.fa]
    version = ""    # Font Awesome version
    integrity = ""  # Font Awesome integrity for the Font Awesome script

Copyright message

[params.copy]
    message = ""

Agreements

[params.agreement]
    message = ""    # You can use HTML tags

Posts

[params.posts]
    showAuthor = true
    showDate = true
    showTags = true
    dateFormat = "Monday, Jan, 2006"

Form

[params.form]
    netlify = true # Only if you are using Netlify
    action = ""
    method = ""
    inputNameName = ""
    inputNameLabel = ""
    inputNamePlaceholder = ""
    inputEmailName = ""
    inputEmailLabel = ""
    inputEmailPlaceholder = ""
    inputMsgName = ""
    inputMsgLabel = ""
    inputMsgLength = 750
    inputSubmitValue = ""

Privacy

[privacy]
    [privacy.googleAnalytics]
        anonymizeIP = true
        disable = false
        respectDoNotTrack = true
        useSessionStorage = false
    [privacy.instagram]
        disable = false
        simple = false
    [privacy.twitter]
        disable = false
        enableDNT = true
        simple = false
    [privacy.vimeo]
        disable = false
        simple = false
    [privacy.youtube]
        disable = false
        privacyEnhanced = true

To learn more about privacy configuration check the official documentation.

Custom CSS

To add custom CSS you have to create a folder called assets in the root of your project. Then, create another folder called css inside assets. And finally, a file called custom.css inside css with your styles.

$ mkdir -p ./assets/css/

Archetypes

Terrassa includes three base archetypes:

  • default: for content such as blogs posts.
  • section: for the sections on your Home page.
  • page: for pages like the About page.

So be careful. Creating a new site with Hugo also creates a default archetype that replaces the one provided by Terrassa.

Home and Single pages

To create your home page run the following command inside your Hugo site:

$ hugo new _index.md -k page

Or to create another page:

$ hugo new example.md -k page

You'll get something like this:

---
title: ""
description: ""
images: []
draft: true
menu: main
weight: 0
---

Some properties are used as follows:

  • title: is the name that will be displayed in the menu. In the rest of the single pages the main title of the content.
  • description: in the case of the home page the description is not shown. In the rest of the single pages it is shown as a subtitle.
  • images: in the case of the home page the first image is used as the background image for the hero and to share on social networks (with Twitter Cards and Facebook Graph). In every other page or post is used only for share on social networks.
  • weight: sets the order of the items in the menu.

Home page Sections

To create a new section in your Home page follow the next steps:

$ hugo new sections/example.md -k section

You'll come across something like this:

---
title: "Example"
description: ""
draft: true
weight: 0
---

The title is used as the title of your new section and the content is the body. At this moment the description is not used for anything.

The weight defines the order in case of having more than one section.

Blog or List pages

To create a Blog or a page with a similar structure follow these steps:

$ hugo new posts/_index.md -k page

In this case it is only necessary to set, if wanted, the title and the weight in the _index.md.

To add a new posts run the following command:

$ hugo new posts/bad-example.md

Inside this file you'll find something like this:

---
title: "Bad example"
description: ""
date: 2018-12-27T21:09:45+01:00
publishDate: 2018-12-27T21:09:45+01:00
author: "John Doe"
images: []
draft: true
tags: []
---

The title and description are used as the main title and subtitle respectively.

You can find more information about each parameter in the official documentation.

Then, the corresponding section will show a list of cards with the title, the date, a summary of the content (truncated to 480 words) and a list of tags if any.

Hugo Terrassa theme Blog section screenshot

Contact

For the contact page follow these instructions:

$ hugo new contact/_index.md -k page

The title and description will be used as the main title and subtitle respectively with a contact form. The rest of the options are defined in the config.toml.

Multilingual Support

If your site is multilingual, add each language to your config.toml parameters with the following structure:

[languages]
    [languages.en]
        languageName = "en"
        weight = 1
        contentDir = "content/en"
      [languages.de]
        languageName = "de"
        weight = 2
        contentDir = "content/de"
      [languages.fr]
        languageName = "fr"
        weight = 3
        contentDir = "content/fr"

The theme assumes you have one default language, defined in config.toml as defaultContentLanguage. These pages will be at root of the URL, while the other languages will be in their own subdirectory.

You can overwrite all Site parameters in config.url by adding them to the respective language, for example:

[languages.de]
  languageName = "de"
  weight = 2
  contentDir = "content/de"
  title = "Das ist der deutsche Titel"
  description = "Das ist die deutsche Beschreibung"

For translating the contact form, add these parameters:

[languages.de.params]
  [languages.de.params.form] # Translate contact form fields
    inputNameLabel = "Name"
    inputNamePlaceholder = "Dein Name"
    inputEmailLabel = "E-mail"
    inputEmailPlaceholder = "Deine E-Mail-Adresse"
    inputMsgLabel = "Schreib etwas"
    inputSubmitValue = "Abschicken"
    [languages.de.params.cta] # Translate Call To Action
        show = true
        cta = "Kontakt"
        link = "de/kontakt/" # Relative URL

Activate the language switcher in the header by setting:

[params.languageSwitcher]
    show = true

Read more about Hugo's Multilingual mode here: https://gohugo.io/content-management/multilingual/

hugo-terrassa-theme's People

Contributors

coreyt avatar corrieriluca avatar dustinsummers avatar ludcarvalho avatar penkovski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hugo-terrassa-theme's Issues

Broken image on the blog list page in Chrome browser

Hey

I setup a blog site for myself using the Terrassa theme built by you. The issue I'm facing is with the blog list page wherein if I add an image the alternate text for the image is shown with a broken image symbol in Chrome browser.
In Firefox, it just shows the alternate text without any symbol.
To maintain consistency across browsers should it just go with the behavior as it is in Firefox? What are your suggestions? Can you advise how to fix this issue?

This is the blog url for reference:
https://poo17nam.github.io/posts/
image

Image URL mismatch between hero and OpenGraph

Hugo will generate Open Graph meta-data by default, using the images property, among others. It will assume that the image is located in the site's root directory. If I have the following header in _index.md:

---
images: ["test.jpg"]
---

Hugo will generate the following HTML:

<meta name="twitter:image" content="https://mysite.local/test.jpg"/>
<meta property="og:image" content="https://mysite.local/test.jpg" />

Terrassa, on the other hand, will generate this:

<main class="hero" 
    style="background-image: url('https://mysite.local/images/test.jpg');" >

There is no way to consolidate those two things, except for putting the image into two different places. Furthermore, using the hero image as the OG preview is sub-optimal.

The least horrible workaround right now is to use the same file name for different purposes:

  • /test.jpg is the OG preview
  • /images/test.jpg is the hero graphic.

multiple 'section' pages

I'm not a native hugo user, so my terminology is likely incorrect. Hopefully my point gets through.

The Home page has this 'section' type format, where it's built off of individual .md files that live in the sections folder.

Can I have another page that has a similar format? I could kinda see my way into figuring out how to copy/paste/rename the section and sections partials, but i'm not sure how the page is identified as using that structure to begin with.
[Edit] - ok maybe not now that I found this archtype folder that also looks like it has things that define page structure. I really don't want to muck with hugo honestly.

parse failed

latif@latif:~/latifshaikh$ hugo server -D
Error: "/home/latif/latifshaikh/themes/terrassa/layouts/partials/head.html:10:1": parse failed: template: partials/head.html:10: function "hugo" not defined

[FR] Ability to write lists on home page

I'm writing a website for an open source project and want to add a Features list.
Your template is perfect for the project, but I can't seem to write Markdown lists using asterisks (*).

e.g.

Features

  • This doesn't work

but

- This does

For now I'm using "\-" to escape the "-" markdown symbol, but this list writing ability would probably be a lot easier and nicer since it would show a dot instead of the dash.

Colors

Hello, I like your theme!
This is not really an issue but more of a newbie question...

How do I change the background color of the page?

Thank you for your time and hard work!

Post title lazy loading on Firefox

Hi there,

I setup a very basic hugo site using your theme. Thank you for theme, it looks neat! ๐Ÿ‘ ๐Ÿ˜„

I noticed that the title of a post is loaded much later in firefox for some reason and I experience a strange drop in the page. It doesnt happen on Chrome.

In the official demo, the same happens sometimes when the image on the front page is loaded.

Here is an example:
lazyloadingtitle

Is that a bug or a configuration issue on my end?
Thanks

Changing favicon is not working. Can't replace Hugo's logo as favicon

From documentation :

[params]
    description = "" # Description for the meta description tag
    favicon = ""     # Relative URL for your favicon
    logo = ""        # Absolute URL for your logo

Steps to replicate:

  1. Add a file favicon.ico (32x32px) at the root level (same level with config.toml)
  2. Add the code above in the config.toml and set:

favicon = "favicon.ico"

  1. Rebuild site
  2. Launch live server and check favicon in browser and source code

Result: The favicon is not the one I set, but the Hugo's logo. This is also visible in the public folder after rebuild.

Browser support?

Do you know the minimum browser level for the CSS and features used? Is IE9, 10 or 11 supported?

Footer requires params.social to be non-empty

I was trying to build a minimal site with no social media links specified in the config and it appears as though the theme requires at least one social media link.

I'm not sure if the developer intended for this to be the case.

How do I change the hero image on the homepage?

I'm replacing a Wordpress site using your theme and I really like it. However, I'm not sure how to change the hero image on the home page. I put the image I want in the 'static' folder and changed the config file to the new path, but it did not appear. Any help would be appreciated.

Keep up the good work

Unordered and ordered list

Could you please add some bullt points / numbers for ul and ol elements?

It seems that they get tranlated from markwon, but the included css of the team sets their list-style to none.

Is this on purpose?

Header grid template columns inadequate for hamburger menu

When a site with a long multi-word title is rendered on mobile, the title only has very little horizontal space, leading to line breaks, despite there being plenty of space:

image

This is due to the significant margins in header_title on the one hand, and due to the default, non-@media grid-template-columns values on the other.

Unfortunately, I fail to understand the semantics of grid-template-columns and so can't provide an adequate fix.

blog post spacing on large screen

Hi,
I started building a page with the theme and it is really awesome!

I've found there is a problem, though, when having 2 posts on the blog page content list (when it shows 3 at a time). There is a very long separation between the items (one on the very top, and one in the very bottom). This only happens when using a large screen.

Here's an image to show how it looks like:

image

I dug down and it seems that the problem could be on the grid-auto-flow on style.css ".content". But I couldn't fix it, so I can't suggest a change. Could you have a look?

Thank you so much for the great work!!!

Support nested menus

As a Hugo newcomer I've spent north of an hour trying to figure out how to add a two-level menu to Terrassa.

Finally I looked into menu.html and realized that it's only iterating in one dimension through the main menu items.

It would be great to add support for at least one level of nesting, e.g.

  • Home
  • About
  • Legal
    • Imprint
    • ToS

And to have a JavaScript / CSS based showing / hiding of the "Imprint" and "ToS" menus when hovering over "Legal".

If this is not planned, please at least clearly document the lack of nesting support :)

Error: Error building site: failed to render pages: render of "home" failed:

Hey there, cloned the repo at 2019-01-13 02:41 UTC and loaded it into an other empty site (other than having an index page)

Got the below on generation.

$ hugo

Total in 11 ms
Error: Error building site: failed to render pages: render of "home" failed: execute of template failed: template: index.html:2:3: executing "main" at <partial "hero.html" ...>: error calling partial: "/home/user/src/site/themes/terrassa/layouts/partials/hero.html:1:11": execute of template failed: template: partials/hero.html:1:11: executing "partials/hero.html" at <index $.Params.image...>:
error calling index: index of untyped nil

$ hugo version
Hugo Static Site Generator v0.53/extended linux/amd64 BuildDate: 2018-12-24T12:58:46Z

Thanks for the great work!

Dropdown menu.

Hello there,

I was looking over Hugo's theme and came across this one. I would like to know if it supports dropdown menus, as I would like to categorize my blog posts and a dropdown menu when I hover would be great.

Handling alternative font awesome icons in [params.social]

In the [params.social] section config.toml, I have added a new entry called donate, which is an external link to a donation page of sorts.

The icon itself is here

It seems like it is trying to render out the icon called donate from font awesome, but ends up showing the blinking exclamation mark, which signifies that it couldn't find that icon.

Any suggestions on how to add items other than what are already configured in the config.toml?

Use of .Hugo is deprecated

When building the site, I am receiving a warning:
Building sites . WARN 2019/06/01 12:28:30 Page's .Hugo is deprecated and will be removed in a future release. Use the global hugo function.

Alignment of sections

Screen Shot 2019-07-30 at 21 13 03
Hi. I am building my website using this theme. I want the sections at the top to appear as:

Home About . Blog Contact

instead of

Home Blog . About . Contact

Which file should I alter?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.