Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
🎨 prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
canstand committed Nov 25, 2021
1 parent 4349bb3 commit 9a532f1
Show file tree
Hide file tree
Showing 32 changed files with 299 additions and 221 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.js]
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
indent_size = 4
10 changes: 5 additions & 5 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: GitHub Pages
on:
push:
tags:
- 'v*.*.*'
- "v*.*.*"

jobs:
deploy:
Expand All @@ -14,18 +14,18 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod

- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 'latest'
hugo-version: "latest"

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '16'
node-version: "16"

- name: Cache dependencies
uses: actions/cache@v2
Expand Down
6 changes: 4 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"endOfLine": "lf",
"htmlWhitespaceSensitivity": "css",
"printWidth": 120,
"semi": false,
"semi": true,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "es5",
"trailingComma": "all",
"useTabs": false,
"overrides": [
{
"files": ["*.html"],
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# Compost Theme | Hugo

Compost is a simple, lightweight theme for [Hugo](https://gohugo.io). Mainly based on the [Congo](https://github.com/jpanther/congo), also refer to [hugo-starter-tailwind-basic](https://github.com/bep/hugo-starter-tailwind-basic) and so on.
Compost is a simple, lightweight theme for [Hugo](https://gohugo.io). Mainly based on the [Congo](https://github.com/jpanther/congo), also refer to [hugo-starter-tailwind-basic](https://github.com/bep/hugo-starter-tailwind-basic) and so on.

🌏[Demo site](https://canstand.github.io/compost/)

## Features

The main differences with [Congo](https://github.com/jpanther/congo):

- The text style is customized for the [Chinese language](https://canstand.github.io/compost/zh/posts/typography/) (automatically applied when lang is zh), which does not affect the entire site English.
- The Tailwind CSS JIT mode is not used. Therefore, you can directly use `hugo server -D` to test, the lack of which is that the build will take longer.
- The Tailwind CSS JIT mode is not used. Therefore, you can directly use `hugo server -D` to test, the lack of which is that the build will take longer.

## Usage

1. Set the theme in the Hugo project as `github.com/canstand/compost`, and add build option to `config.toml`:

```toml
theme = 'github.com/canstand/compost'

Expand All @@ -20,13 +23,15 @@ writeStats = true
```

2. Install or upgrade dependencies:

```bash
hugo mod get -u
hugo mod npm pack
npm install
```

3. Then run your project as usual.

```bash
hugo server
```
7 changes: 5 additions & 2 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ Compost 是一个简单、轻量级的 [Hugo](https://gohugo.io) 主题。主要
🌏[演示站点](https://github.com/canstand/compost/zh)

## 特性

[Congo](https://github.com/jpanther/congo) 的主要区别:
* 针对简体中文语言定制了正文样式(lang 为 zh 时自动应用),不影响全站英文。
* 暂时没用 Tailwind CSS JIT 模式。因此可以直接用 `hugo server -D` 测试,缺占是 build 耗时会长一些。

- 针对简体中文语言定制了正文样式(lang 为 zh 时自动应用),不影响全站英文。
- 暂时没用 Tailwind CSS JIT 模式。因此可以直接用 `hugo server -D` 测试,缺占是 build 耗时会长一些。

## 使用

1. 在 Hugo 项目配置文件 `config.toml` 里指定主题为 `github.com/canstand/compost`,并且配置构建参数:

```toml
theme = 'github.com/canstand/compost'

Expand Down
10 changes: 5 additions & 5 deletions assets/css/components.css
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ body {
@apply flex items-center;
}

.pagination .page-item .page-link{
.pagination .page-item .page-link {
@apply p-2 m-2;
}

Expand Down Expand Up @@ -594,14 +594,14 @@ body {
}

#TableOfContents li {
@apply my-1
@apply my-1;
}

#TableOfContents li a {
@apply block pl-2 border-l-2 border-transparent;
}

#TableOfContents li.active>a {
#TableOfContents li.active > a {
@apply block pl-2 border-l-2 border-primary-500;
}

Expand All @@ -618,10 +618,10 @@ body {
@apply w-full p-4 order-last border-t border-neutral-500;
}

.tab-control:checked+.tab-label {
.tab-control:checked + .tab-label {
@apply border-primary-500 text-primary-500;
}

.tab-control:checked+.tab-label+.tab-content {
.tab-control:checked + .tab-label + .tab-content {
@apply block !important;
}
10 changes: 4 additions & 6 deletions assets/js/main.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import Alpine from 'alpinejs';
import intersect from '@alpinejs/intersect';

(function() {
import Alpine from "alpinejs";
import intersect from "@alpinejs/intersect";

(function () {
Alpine.plugin(intersect);
window.Alpine = Alpine
window.Alpine = Alpine;
Alpine.start();

})();
9 changes: 7 additions & 2 deletions exampleSite/content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,33 @@ description: "This is a demo of the Compost theme for Hugo."
A simple, lightweight theme for Hugo built with Tailwind CSS.
{{< /lead >}}

Compost is a simple, lightweight theme for [Hugo](https://gohugo.io). Mainly based on the [Congo](https://github.com/jpanther/congo), also refer to [hugo-starter-tailwind-basic](https://github.com/bep/hugo-starter- tailwind-basic) and so on.
Compost is a simple, lightweight theme for [Hugo](https://gohugo.io). Mainly based on the [Congo](https://github.com/jpanther/congo), also refer to [hugo-starter-tailwind-basic](https://github.com/bep/hugo-starter- tailwind-basic) and so on.

## Features

The main differences with [Congo](https://github.com/jpanther/congo):

- The text style is customized for the simplified Chinese language (automatically applied when lang is zh), which does not affect the entire site English.
- The Tailwind CSS JIT mode is not used. Therefore, you can directly use `hugo server -D` to test, the lack of which is that the build will take longer.
- The Tailwind CSS JIT mode is not used. Therefore, you can directly use `hugo server -D` to test, the lack of which is that the build will take longer.

## Usage

1. Set the theme in the Hugo project as `github.com/canstand/compost`:

```toml
theme = 'github.com/canstand/compost'
```

2. Install or upgrade dependencies:

```bash
hugo mod get -u
hugo mod npm pack
npm install
```

3. Then run your project as usual.

```bash
hugo server
```
9 changes: 6 additions & 3 deletions exampleSite/content/_index.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@ description: "演示 Hugo Compost 主题"
---

{{< lead >}}
使用 Tailwind CSS 构建的简单、轻量级的 Hugo 主题。
使用 Tailwind CSS 构建的简单、轻量级的 Hugo 主题。
{{< /lead >}}

Compost 是一个简单、轻量级的 [Hugo](https://gohugo.io) 主题。主要基于 [Congo](https://github.com/jpanther/congo) 改造,并参考了 [hugo-starter-tailwind-basic](https://github.com/bep/hugo-starter-tailwind-basic) 等。

## 特性

[Congo](https://github.com/jpanther/congo) 的主要区别:
* 针对简体中文语言定制了正文样式(lang 为 zh 时自动应用),不影响全站英文。
* 暂时没用 Tailwind CSS JIT 模式。因此可以直接用 `hugo server -D` 测试,缺占是 build 耗时会长一些。

- 针对简体中文语言定制了正文样式(lang 为 zh 时自动应用),不影响全站英文。
- 暂时没用 Tailwind CSS JIT 模式。因此可以直接用 `hugo server -D` 测试,缺占是 build 耗时会长一些。

## 使用

1. 在 Hugo 项目里指定主题为 `github.com/canstand/compost`

```toml
theme = 'github.com/canstand/compost'
```
Expand Down
4 changes: 2 additions & 2 deletions exampleSite/content/posts/emoji-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ date: 2019-03-05
description: "Guide to emoji usage in Hugo"
tags: ["emoji", "sample"]
categories: ["sample"]
series:
- "Extra"
series:
- "Extra"
---

Emoji can be enabled in a Hugo project in a number of ways.
Expand Down
60 changes: 34 additions & 26 deletions exampleSite/content/posts/markdown-syntax.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
author: Hugo Authors
title: Markdown Syntax Guide
date: '2019-03-11'
date: "2019-03-11"
description: Sample article showcasing basic Markdown syntax and formatting for HTML elements.
tags:
- markdown
Expand All @@ -18,17 +18,23 @@ draft: false
---

This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme.

<!--more-->

## Headings

The following HTML `<h1>``<h6>` elements represent six levels of section headings. `<h1>` is the highest section level while `<h6>` is the lowest.

# H1

## H2

### H3

#### H4

##### H5

###### H6

## Paragraph
Expand All @@ -44,7 +50,7 @@ The blockquote element represents content that is quoted from another source, op
#### Blockquote without attribution

> Tiam, ad mint andaepu dandae nostion secatur sequo quae.
> **Note** that you can use *Markdown syntax* within a blockquote.
> **Note** that you can use _Markdown syntax_ within a blockquote.
#### Blockquote with attribution

Expand All @@ -57,31 +63,31 @@ The blockquote element represents content that is quoted from another source, op

Tables aren't part of the core Markdown spec, but Hugo supports supports them out-of-the-box.

Name | Age
--------|------
Bob | 27
Alice | 23
| Name | Age |
| ----- | --- |
| Bob | 27 |
| Alice | 23 |

#### Inline Markdown within tables

| Italics | Bold | Code |
| -------- | -------- | ------ |
| *italics* | **bold** | `code` |
| --------- | -------- | ------ |
| _italics_ | **bold** | `code` |

## Code Blocks

#### Code block with backticks

```html
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example HTML5 Document</title>
</head>
<body>
<p>Test</p>
</body>
<head>
<meta charset="utf-8" />
<title>Example HTML5 Document</title>
</head>
<body>
<p>Test</p>
</body>
</html>
```

Expand All @@ -99,7 +105,9 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
</html>

#### Code block with Hugo's internal highlight shortcode

{{< highlight html >}}

<!doctype html>
<html lang="en">
<head>
Expand All @@ -122,19 +130,19 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou

#### Unordered List

* List item
* Another item
* And another item
- List item
- Another item
- And another item

#### Nested list

* Fruit
* Apple
* Orange
* Banana
* Dairy
* Milk
* Cheese
- Fruit
- Apple
- Orange
- Banana
- Dairy
- Milk
- Cheese

## Other Elements — abbr, sub, sup, kbd, mark

Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/posts/math-typesetting.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: A brief guide to setup KaTeX
math: true
tags: ["sample"]
series:
- Extra
- Extra
---

Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries.
Expand Down
Loading

0 comments on commit 9a532f1

Please sign in to comment.