This commit is contained in:
mivinci 2021-07-18 21:40:40 +08:00
parent 9fd4150509
commit b96ac1bc1f
4 changed files with 61 additions and 296 deletions

13
Makefile Normal file
View file

@ -0,0 +1,13 @@
source=exampleSite
.PHONY: dev, build, clean
dev:
hugo server -D -s $(source) --themesDir ../..
build:
cd exampleSite
hugo -D --gc --minify -s $(source) --themesDir ../..
clean:
rm -r $(source)/public

View file

@ -2,14 +2,57 @@
A Clean and minimal Hugo theme porting from Minima on Hexo. A Clean and minimal Hugo theme porting from Minima on Hexo.
![screenshot](./images/tn.png)
## Features ## Features
- [x] light/dark mode - [x] light/dark mode
- [x] Hightlight - [x] Code Hightlight
- [x] Comments - [x] KaTeX
- [x] LaTeX - [x] Google analytics
- [x] Disqus/OvO comments
## Usage ## Usage
Writing... Before using Minima, make sure you've got Hugo(v0.41.0 or higher) installed on your device.
### Installation
Suppose `blog` is where you place your sources.
```bash
cd blog
git init
git submodule add --depth 1 https://github.com/mivinci/hugo-theme-minima.git themes/minima
```
Or `clone` directly if you don't wanna use the Git submodule.
```bash
git clone https://github.com/mivinci/hugo-theme-minima.git themes/minima
```
Anyways, you just need to put Minima under the `blog/themes` directory.
### Configuration
Follow [exampleSite/config.toml](https://github.com/Mivinci/hugo-theme-minima/blob/main/exampleSite/config.toml) and edit your own `blog/config.toml` file.
### Supported Front Matters
| Field | Type | Explanation |
| ----------- | ------ | ------------------------------------------------------ |
| title | string | Title of the post, will be rendered in a `h1` tag |
| description | string | Description of the post, will be rendered in a `p` tag |
| date | string | Datetime that the post is written |
| math | bool | True if the post needs to render math formulas |
| comment | bool | True if the post allows people to make comments |
| draft | bool | True if the post isn't already to production |
| categories | array | Array of categories the posts belongs to |
| series | array | Array of series the posts belongs to |
| tags | array | Array of tags the posts is related to |
### Feedback
Feedbacks are welcome [here](https://github.com/Mivinci/hugo-theme-minima/issues).

View file

@ -12,10 +12,8 @@ name = "XJJ"
slogon = "A student and web developer from Earth 🌍" slogon = "A student and web developer from Earth 🌍"
description = "This is Minima, a clean and minimal Hugo theme porting from Minima on Hexo. It not only inherits everything from Hexo Minima like dark/light mode but intgrated KaTeX and some taxonomies like categories, series and tags. I created this from scratch using pure CSS and Vanilla JS without using unnecessary development packs! 😁" description = "This is Minima, a clean and minimal Hugo theme porting from Minima on Hexo. It not only inherits everything from Hexo Minima like dark/light mode but intgrated KaTeX and some taxonomies like categories, series and tags. I created this from scratch using pure CSS and Vanilla JS without using unnecessary development packs! 😁"
[params] [params]
subtitle = "" subtitle = ""
recent_posts = 5
[[params.social]] [[params.social]]
name = "github" name = "github"
@ -47,7 +45,7 @@ weight = 3
[[menu.main]] [[menu.main]]
name = "About" name = "About"
url = "/about" url = "/about"
weight = 5 weight = 4
[taxonomies] [taxonomies]
category = "categories" category = "categories"

View file

@ -1,289 +0,0 @@
/* https://github.com/PrismJS/prism-themes/blob/master/themes/prism-vsc-dark-plus.css */
pre[class*="language-"],
code[class*="language-"] {
color: #d4d4d4;
font-size: 13px;
text-shadow: none;
font-family: Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono",
"Courier New", monospace;
direction: ltr;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::selection,
code[class*="language-"]::selection,
pre[class*="language-"] *::selection,
code[class*="language-"] *::selection {
text-shadow: none;
background: #75a7ca;
}
@media print {
pre[class*="language-"],
code[class*="language-"] {
text-shadow: none;
}
}
pre[class*="language-"] {
padding: 1em;
margin: 0.5em 0;
overflow: auto;
background: #292929;
}
:not(pre) > code[class*="language-"] {
padding: 0.1em 0.3em;
border-radius: 0.3em;
color: #db4c69;
background: #f9f2f4;
}
/*********************************************************
* Tokens
*/
.namespace {
opacity: 0.7;
}
.token.doctype .token.doctype-tag {
color: #569cd6;
}
.token.doctype .token.name {
color: #9cdcfe;
}
.token.comment,
.token.prolog {
color: #6a9955;
}
.token.punctuation,
.language-html .language-css .token.punctuation,
.language-html .language-javascript .token.punctuation {
color: #d4d4d4;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.inserted,
.token.unit {
color: #b5cea8;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.deleted {
color: #ce9178;
}
.language-css .token.string.url {
text-decoration: underline;
}
.token.operator,
.token.entity {
color: #d4d4d4;
}
.token.operator.arrow {
color: #569cd6;
}
.token.atrule {
color: #ce9178;
}
.token.atrule .token.rule {
color: #c586c0;
}
.token.atrule .token.url {
color: #9cdcfe;
}
.token.atrule .token.url .token.function {
color: #dcdcaa;
}
.token.atrule .token.url .token.punctuation {
color: #d4d4d4;
}
.token.keyword {
color: #569cd6;
}
.token.keyword.module,
.token.keyword.control-flow {
color: #c586c0;
}
.token.function,
.token.function .token.maybe-class-name {
color: #dcdcaa;
}
.token.regex {
color: #d16969;
}
.token.important {
color: #569cd6;
}
.token.italic {
font-style: italic;
}
.token.constant {
color: #9cdcfe;
}
.token.class-name,
.token.maybe-class-name {
color: #4ec9b0;
}
.token.console {
color: #9cdcfe;
}
.token.parameter {
color: #9cdcfe;
}
.token.interpolation {
color: #9cdcfe;
}
.token.punctuation.interpolation-punctuation {
color: #569cd6;
}
.token.boolean {
color: #569cd6;
}
.token.property,
.token.variable,
.token.imports .token.maybe-class-name,
.token.exports .token.maybe-class-name {
color: #9cdcfe;
}
.token.selector {
color: #d7ba7d;
}
.token.escape {
color: #d7ba7d;
}
.token.tag {
color: #569cd6;
}
.token.tag .token.punctuation {
color: #808080;
}
.token.cdata {
color: #808080;
}
.token.attr-name {
color: #9cdcfe;
}
.token.attr-value,
.token.attr-value .token.punctuation {
color: #ce9178;
}
.token.attr-value .token.punctuation.attr-equals {
color: #d4d4d4;
}
.token.entity {
color: #569cd6;
}
.token.namespace {
color: #4ec9b0;
}
/*********************************************************
* Language Specific
*/
pre[class*="language-javascript"],
code[class*="language-javascript"],
pre[class*="language-jsx"],
code[class*="language-jsx"],
pre[class*="language-typescript"],
code[class*="language-typescript"],
pre[class*="language-tsx"],
code[class*="language-tsx"] {
color: #9cdcfe;
}
pre[class*="language-css"],
code[class*="language-css"] {
color: #ce9178;
}
pre[class*="language-html"],
code[class*="language-html"] {
color: #d4d4d4;
}
.language-regex .token.anchor {
color: #dcdcaa;
}
.language-html .token.punctuation {
color: #808080;
}
/*********************************************************
* Line highlighting
*/
pre[data-line] {
position: relative;
}
pre[class*="language-"] > code[class*="language-"] {
position: relative;
z-index: 1;
}
.line-highlight {
position: absolute;
left: 0;
right: 0;
padding: inherit 0;
margin-top: 1em;
background: #f7ebc6;
box-shadow: inset 5px 0 0 #f7d87c;
z-index: 0;
pointer-events: none;
line-height: inherit;
white-space: pre;
}