Skip to content

Commit

Permalink
ignition
Browse files Browse the repository at this point in the history
  • Loading branch information
jmau111 committed Aug 10, 2021
0 parents commit d5a3185
Show file tree
Hide file tree
Showing 64 changed files with 2,764 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
node_modules
.idea
public
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Contributing

I would love to review your pull requests. Do not hesitate to raise issues and send PRs.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) Julien Maury - https://www.julien-maury.dev

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
108 changes: 108 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Hugo Ava Theme

[See demo](https://hugo-theme-ava.netlify.app/)

## Installation

### Install Hugo

Follow [the official installation guide](https://gohugo.io/getting-started/installing/)

**You need the extended version**

### Create a new Hugo site

```
hugo new site my-site
```

This will create a fresh Hugo site in the folder `my-site`.

### Install theme with Git

Clone this repo into the themes folder
```
cd mynewsite
git clone https://github.com/jmau111/hugo-theme-ava.git themes/hugo-ava
```

## Copy example content

You can use contents generated for the demo:

```
cp -a themes/hugo-theme-ava/exampleSite/. .
```

## Change colors

Feel free to change colors for both light and dark mode. See `themes/hugo-theme-ava/assets/scss/_mode_light.scss` or `themes/hugo-theme-ava/assets/scss/_mode_dark.scss`.

You can customize other CSS variables in `themes/hugo-theme-ava/assets/scss/_variables.scss`

## Don't forget to change the favicon

You don't have to remove the one set in the theme but ensure you replace the one in the `/static/` folder at the root or your project.

## humans.txt

I've included the `humans.txt` file cause I care about this file. You can put your name in it or replace this entire file in your `/static/` folder at the root of the project:

### Using the config.toml

Copy the `config.toml` file into the root folder of your Hugo site, then you can modify the copy.

## Run Hugo

Run dev server:

```
hugo server
```

Then you can go to [`localhost:1313`](http://localhost:1313).

Build:

```
hugo
```

## Configuration

### Change baseURL

```
baseURL = "https://www.mysite.com/"
```

Ensure you use a trailing slash.

### Google Analytics

Add you google analytics ID to the `config.toml`

```
// config.toml
[params]
google_analytics_id="UA-XXXXXXXX-X"
```

### Menu

You can edit and add main menu links in the `config.toml` under `[[menu.main]]`

## TODO

A lot of stuff, including:

* handling images in templates with hugo features (but you can use images as meta og for SEO purpose starting from now)
* i18n
* contact form
* shortcodes

But still, it's not a multi-purpose theme.

## License

You're welcome to fork this, but keep the licence MIT please.
2 changes: 2 additions & 0 deletions archetypes/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
+++
+++
36 changes: 36 additions & 0 deletions assets/js/darkm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
window.onload = function () {
if (window.CSS && CSS.supports("color", "var(--sandman)")) {

const storage = localStorage.getItem("dark-mode");

if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.documentElement.setAttribute("data-theme", "dark");
}

if (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches) {
document.documentElement.setAttribute("data-theme", "light");
}

if (storage && storage === "dark") {
document.documentElement.setAttribute("data-theme", "dark");
}

if (storage && storage === "light") {
document.documentElement.setAttribute("data-theme", "light");
}

const toggleTheme = function toggleTheme(e) {
if (e.currentTarget.classList.contains("dark--hidden")) {
document.documentElement.setAttribute("data-theme", "dark");
localStorage.setItem("dark-mode", "dark");
return;
}
document.documentElement.setAttribute("data-theme", "light");
localStorage.setItem("dark-mode", "light");
};
const toggleThemes = document.querySelectorAll(".theme__btn");
toggleThemes.forEach(function (btn) {
btn.addEventListener("click", toggleTheme);
});
}
}
Loading

0 comments on commit d5a3185

Please sign in to comment.