Skip to content

Commit

Permalink
chore: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
hugo-sid committed Feb 13, 2023
0 parents commit 526932b
Show file tree
Hide file tree
Showing 54 changed files with 2,727 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.hugo_build.lock

exampleSite/.hugo_build.lock
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2023 Sidharth R.

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.
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<h1 align=center> Awesome hugo blog | <a href="" target="_blank" rel="nofollow">Demo</a></h1>

<h4 align=center>📰 Clean UI | 🌙 Dark mode support | 📱 Responsive design </h4>

A minimal blog theme for [Hugo](https://gohugo.io/).

## Features

- Minimal design
- Responsive design
- Light and dark mode
- Syntax highlighting
- RSS feed


## Setup

To create a new Hugo site with this theme, run the following command:

hugo new site myblog

Then, clone this repository into the `themes` directory of your new site:

cd myblog
git clone https://github.com/hugo-sid/hugo-blog-awesome.git themes/hugo-blog-awesome

To preview the thmeme with example content, run the following command from the `exampleSite` directory:

hugo server --themesDir ../..

## Usage

To use this theme, set the `theme` variable in your site's `config.toml` to `hugo-blog-awesome`:

theme = "hugo-blog-awesome"

## Configuration

You can have a look at the `config.toml` file in the `exampleSite` directory for an example configuration.
I recommend you to copy the `config.toml` file from the `exampleSite` directory to the root directory of your Hugo site. Then, you can edit the `config.toml` file to suit your needs.

## Content

### Posts

To create a new post, run the following command:

hugo new posts/my-first-post.md

Then, edit the `my-first-post.md` file to suit your needs.

## Contributing

If you find any bugs or have any suggestions, feel free to open an issue or a pull request.

## License

This theme is released under the MIT license. For more information read the [License](https://github.com/hugo-sid/hugo-blog-awesome/LICENSE.md).
7 changes: 7 additions & 0 deletions archetypes/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title:
date: {{ .Date }}
draft: true
description:
---

Binary file added assets/code-highlight.css
Binary file not shown.
16 changes: 16 additions & 0 deletions assets/js/themeLoader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const body = document.body;
const data = body.getAttribute("data-theme");

const initTheme = (state) => {
if (state === "dark") {
body.setAttribute("data-theme", "dark");
} else if (state === "light") {
body.removeAttribute("data-theme");
} else {
localStorage.setItem("theme", data);
}
};

initTheme(localStorage.getItem("theme"));

setTimeout(() => body.classList.remove("notransition"), 75);
32 changes: 32 additions & 0 deletions assets/js/themeSwitchnMenu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
(() => {
// Theme switch
const body = document.body;
const lamp = document.getElementById("mode");

const toggleTheme = (state) => {
if (state === "dark") {
localStorage.setItem("theme", "light");
body.removeAttribute("data-theme");
} else if (state === "light") {
localStorage.setItem("theme", "dark");
body.setAttribute("data-theme", "dark");
} else {
initTheme(state);
}
};

lamp.addEventListener("click", () =>
toggleTheme(localStorage.getItem("theme"))
);

// Blur the content when the menu is open
const cbox = document.getElementById("menu-trigger");

cbox.addEventListener("change", function () {
const area = document.querySelector(".wrapper");
this.checked
? area.classList.add("blurry")
: area.classList.remove("blurry");
});
})();

Loading

0 comments on commit 526932b

Please sign in to comment.