Skip to content
This repository has been archived by the owner on Jul 28, 2021. It is now read-only.

Commit

Permalink
add support for custom CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkvist committed Jun 4, 2019
1 parent 88a672a commit dfebf8b
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 9 deletions.
29 changes: 23 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,61 @@ Terrassa is a simple, fast and responsive theme for Hugo with a strong focus on

![Hugo Terrassa theme screenshot](https://github.com/danielkvist/hugo-terrassa-theme/blob/master/images/screenshot.png)

## Theme features
## Features

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

And much more.
## Some things that will be added in the future

- A better hamburger menu.
- Service Workers.
- Easier ways to customize fonts and colors.
- Support for comments.

## Installation

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

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

Or

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

> You can also download the last release [here](https://github.com/danielkvist/hugo-terrassa-theme/releases).
Back to your Hugo site directory open the *config.toml* file and add the following line:
Back to your Hugo site directory open the *config.toml* file and add or change the following line:

```toml
theme = "terrassa"
```

And that's it.
## Configuration

You can find an example of the final configuration [here](https://github.com/danielkvist/hugo-terrassa-theme/blob/master/exampleSite/config.toml).

### 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.

```bash
$ mkdir -p ./assets/css/
```

## Archetypes

Expand Down
Empty file added assets/css/custom.css
Empty file.
6 changes: 4 additions & 2 deletions layouts/partials/styles.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
{{ $style := resources.Get "css/style.css" }}
{{ $media := resources.Get "css/media-queries.css" }}
{{ $animations := resources.Get "css/animations.css" }}
{{ $bundle := slice $reset $base $style $media $animations | resources.Concat "css/bundle.css" }}
{{ $css := $bundle | resources.Minify | resources.Fingerprint "sha512" }}
{{ $custom := resources.Get "css/custom.css" }}
{{ $bundle := slice $reset $base $style $media $animations $custom | resources.Concat "css/bundle.css" }}

{{ $css := $bundle | resources.Minify }}

<link rel="stylesheet" href="{{ $css.Permalink }}">
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ docker-rm:
dev: hugo-server-draft
build: huo-build-deploy
check: hugo-build-min docker-nc docker-run
clean: docker-stop docker-rm hugo-clean
clean: docker-stop docker-rm hugo-clean

0 comments on commit dfebf8b

Please sign in to comment.