forked from jmau111/hugo-theme-ava
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d5a3185
Showing
64 changed files
with
2,764 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.DS_Store | ||
node_modules | ||
.idea | ||
public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
+++ | ||
+++ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); | ||
} | ||
} |
Oops, something went wrong.