Skip to content

Commit

Permalink
hugo-theme-m10c主题
Browse files Browse the repository at this point in the history
  • Loading branch information
CYRUS-STUDIO committed Sep 15, 2024
1 parent 5ff875a commit 5bfc313
Show file tree
Hide file tree
Showing 46 changed files with 2,534 additions and 0 deletions.
12 changes: 12 additions & 0 deletions themes/m10c/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions themes/m10c/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
public/
exampleSite/resources/
21 changes: 21 additions & 0 deletions themes/m10c/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 Fabien Casters

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.
93 changes: 93 additions & 0 deletions themes/m10c/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# m10c theme

![Intro](https://github.com/vaga/hugo-theme-m10c/blob/master/images/cover.png)

A Hugo minimalistic theme for bloggers

Main features:

- Fully responsive
- Twitter Cards, Open Graph, Disqus and Google Analytics supported (see Hugo docs)
- Customizable colors
- Customizable picture and description
- Customizable menu on sidebar
- Customizable social media links on sidebar
- Optimized for performance 100/100 on Lighthouse
- All feather icons included

## Getting started

### Installation

Create a new Hugo site:
```bash
$ hugo new site [path]
```

Clone this repository into `themes/` directory:
```bash
$ cd [path]
$ git clone https://github.com/vaga/hugo-theme-m10c.git themes/m10c
```

Add this line in the `config.toml` file:
```toml
theme = "m10c"
```

### Configuration

In your `config.toml` file, define the following variables in `params`:

- `author`: Name of the author
- `description`: Short description of the author
- `avatar`: Path of file containing the author avatar image
- `menu_item_separator`: Separator between each menu item. HTML allowed (default: " - ")
- `favicon`: Absolute path of your favicon.ico file (default: "/favicon.ico")

To add a menu item, add the following lines in `menu`:

```
[[menu.main]]
identifier = "tags"
name = "Tags"
url = "/tags/"
```

[Read Hugo documentations](https://gohugo.io/content-management/menus/#readout) for more informations about menu

To add a social link, add the following lines in `params`:

```
[[params.social]]
icon = "github"
name = "My Github"
url = "https://github.com/vaga"
```

To change theme colors, add the following lines in `params`:

```
[params.style]
darkestColor = "#d35050"
darkColor = "#212121"
lightColor = "#f5e3e0"
lightestColor = "#f5f5f5"
primaryColor = "#ffffff"
```

If you want the above theme colors, you can see the [exampleSite/config.toml](/exampleSite/config.toml) file.

### Styling

To override styles using scss, add a file called `_extra.scss` to `[path]/assets/css/`

**Note:** Hugo releases come in two versions, `hugo` and `hugo_extended`. You need `hugo_extended` to automatically compile your scss.

## License

This theme is released under the [**MIT**](/LICENSE.md) License.

## Acknowledgements

- [feather](https://feathericons.com/) - [MIT](https://github.com/feathericons/feather/blob/master/LICENSE)
65 changes: 65 additions & 0 deletions themes/m10c/assets/css/_base.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
* {
box-sizing: border-box;
}

html {
line-height: 1.6;
}

body {
margin: 0;
font-family: sans-serif;
background: $dark-color;
color: $light-color;
}

h1, h2, h3, h4, h5, h6 {
color: $lightest-color;
}

a {
color: $primary-color;
transition: color 0.35s;
text-decoration: none;

&:hover {
color: $lightest-color;
}
}

// Browsers seem to use a smaller default font-size with monospaced code
// blocks (like 80% of the size of normal text) and that looks pretty bad with
// small inline code-blocks in the middle of normal text (mainly because of
// the very noticeable difference in x-height). This CSS corrects that problem.
code {
font-family: monospace,monospace;
font-size: 1em;
color: rgba($light-color, .8);

// Fixes iOS font sizing anomaly
text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}

pre {
font-size: 1rem;
line-height: 1.2em;
margin: 0;
overflow: auto;

// A larger monospaced block of text (that isn't mixed with normal text)
// generally looks heavier than normal text with the same font size. For this
// reason using a smaller monospaced font size makes sense in this situation.
code {
font-size: .8em;
}
}

::selection {
background: rgba($light-color, .25);
}
::-moz-selection {
background: rgba($light-color, .25);
}
51 changes: 51 additions & 0 deletions themes/m10c/assets/css/components/_app.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
.app-header {
padding: 2.5em;
background: $darkest-color;
text-align: center;
}

.app-header-avatar {
width: 15rem;
height: 15rem;
border-radius: 100%;
border: 0.5rem solid $primary-color;
}

.app-container {
padding: 2.5rem;
}

.app-header-social {
display: flex;
align-items: center;
justify-content: center;
font-size: 2em;
color: $lightest-color;

a:not(:last-child) {
margin-right: 0.4em;
}
}

.app-header-title {
color: $lightest-color;
display: block;
font-size: 2em;
margin: 0.67em 0;
font-weight: bold;
}

@media (min-width: 940px) {
.app-header {
position: fixed;
top: 0;
left: 0;
width: 20rem;
min-height: 100vh;
}

.app-container {
max-width: 65rem;
margin-left: 20rem;
}
}
7 changes: 7 additions & 0 deletions themes/m10c/assets/css/components/_error_404.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.error-404 {
text-align: center;
}

.error-404-title {
text-transform: uppercase;
}
6 changes: 6 additions & 0 deletions themes/m10c/assets/css/components/_icon.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.icon {
display: inline-block;
width: 1em;
height: 1em;
margin-top: -0.125em;
}
27 changes: 27 additions & 0 deletions themes/m10c/assets/css/components/_pagination.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.pagination {
display: block;
list-style: none;
padding: 0;
font-size: 0.8em;
text-align: center;
margin: 3em 0;
}

.page-item {
display: inline-block;
.page-link {
display: flex;
align-items: center;
justify-content:center;
width: 1.8rem;
height: 1.8rem;
}

&.active {
.page-link {
color: $lightest-color;
border-radius: 2em;
background: $primary-color;
}
}
}
44 changes: 44 additions & 0 deletions themes/m10c/assets/css/components/_post.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
.post-title {
color: $lightest-color;
}

.post-meta > div {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 0.2em;
font-size: 0.8em;

> .icon {
margin-right: 0.4em;
}
}

.post-content {
& > pre,
.highlight {
margin: 1em 0;
}

& > pre,
.highlight > pre,
.highlight > div {
border-left: 0.4em solid rgba($primary-color, .8);
padding: 1em 1em;
}

blockquote {
border-left: 0.4em solid rgba($primary-color, .8);
margin: 1em 0em;
padding: .5em 1em;
background: $darkest-color;

p {
margin: .5em 0;
}
}

img {
max-width: 100%;
}
}
26 changes: 26 additions & 0 deletions themes/m10c/assets/css/components/_posts_list.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.posts-list {
padding: 0;
}

.posts-list-item {
list-style: none;
padding: 0.4em 0;

&:not(:last-child) {
border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
}
}

.posts-list-item-description {
display: flex;
align-items: center;
font-size: 0.8em;

> .icon {
margin-right: 0.4em;
}
}

.posts-list-item-separator {
margin: 0 0.4em;
}
15 changes: 15 additions & 0 deletions themes/m10c/assets/css/components/_tag.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.tag {
display: inline-block;
margin-right: 0.2em;
padding: 0 0.6em;
font-size: 0.9em;
border-radius: 0.2em;
white-space: nowrap;
background: rgba(255, 255, 255, 0.1);
transition: color 0.35s, background 0.35s;

&:hover {
transition: color 0.25s, background 0.05s;
background: rgba(255, 255, 255, 0.3);
}
}
Loading

0 comments on commit 5bfc313

Please sign in to comment.