Welcome to mirror list, hosted at ThFree Co, Russian Federation.

README.md - github.com/matsuyoshi30/harbor.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5e7c7226f8fddecef21aebbfb88fc169d35bf601 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
# [harbor](https://themes.gohugo.io/harbor/) - Simple Hugo Theme

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=matsuyoshi30_harbor&metric=alert_status)](https://sonarcloud.io/dashboard?id=matsuyoshi30_harbor)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fmatsuyoshi30%2Fharbor.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fmatsuyoshi30%2Fharbor?ref=badge_shield)

Simple and minimal personal blog theme for [Hugo](https://gohugo.io/).

![screenshot](https://user-images.githubusercontent.com/16238709/77252732-3698c880-6c99-11ea-9def-15a5f9b918bc.png)

![screenshot-dark](https://user-images.githubusercontent.com/16238709/77252745-529c6a00-6c99-11ea-95f6-2df83dfff35e.png)

[DEMO](https://matsuyoshi30.net/harbor/) is built from [exampleSite](https://github.com/matsuyoshi30/harbor/tree/exampleSite).

## Features

- Support tags, categories and archives
- Analytics integration (Google, Goatcounter or Matomo)
- Responsive
- Dark mode
- Syntax Highlight (see [Hugo doc](https://gohugo.io/content-management/syntax-highlighting/))
- Search entire blog posts
- Table Of Contents
- Disqus
- Most social media

## Installation & Update

```
$ # install
$ cd themes
$ git submodule add https://github.com/matsuyoshi30/harbor.git harbor

$ # update
$ git submodule update --remote --merge
```

If you want to know more information, see [Hugo doc](https://gohugo.io/themes/installing/).

## Usage

### `config.toml` example

```toml
theme = "harbor"
baseurl = "https://example.com/"
title = "Hugo Themes"
paginate = 3
languageCode = "en"
DefaultContentLanguage = "en"
enableInlineShortcodes = true
footnoteReturnLinkContents = "^"

# Optional
# If you use googleAnalytics, you set top-level options in config.toml to the beginning of the config file like other top-level options.
googleAnalytics = "UA-XXXXXXXX-XX"
# and disqus too.
disqusShortName = "yourdisqusshortname"

[params.goatcounter]
  domain="stats.domain.com"

[params.matomo]
  domain="stats.domain.com"
  id="123"

[Author]
  name = "Hugo Author"

[outputs]
  section = ["JSON", "HTML"]

[[params.nav]]
  identifier = "about"
  name = "About"
  icon = "fas fa-user fa-lg"
  url = "/about/"
  weight = 3

[[params.nav]]
  identifier = "tags"
  name = "Tags"
  icon = "fas fa-tag fa-lg"
  url = "tags"
  weight = 3

[[params.nav]]
  identifier = "categories"
  name = "Category"
  icon = "fas fa-folder-open fa-lg"
  url = "categories"
  weight = 3

[[params.nav]]
  identifier = "search"
  name = "Search"
  icon = "fas fa-search fa-lg"
  url = "search"
  weight = 3

[[params.nav]]
  identifier = "archives"
  name = "Archives"
  icon = "fas fa-archive fa-lg"
  url = "archives"
  weight = 3

# copy paste this block and change for each social media to add how many ever social media
# acounts/links you want
[[params.social]]
  name="name of social media"
  url="link to social media"
  icon="A icon from https://fontawesome.com/"

[params.logo]
  url = "icon.png" # static/images/icon.png
  width = 50
  height = 50
  alt = "Logo"
```

Before you user my theme, don't remember to change favicon (static/favicon.ico) and icon (static/images/icon.png)!

If you don't change them, your favicon and icon are my face :)

### Search entire blog posts

You should make `search.md` in the `content` directory.

```
---
title: "Search"
layout: "search"
---
```

### TOC

If you want to use TableOfContent, you need to write words greater than 400, and set `true` of the frontmatter `toc`.

### Back To Top Button

If you want to use Back To Top Button, you need to write words greater than 400, and set `true` of the frontmatter `backtotop`.

### Archives

If you want archive page, generate `archives.md` file in the `content` directory.

```
$ hugo new archives.md
```

```
---
title: "Archive page"
type: archives
---
```

### Override CSS

If you want to override CSS, add `customCSS` param which is path to CSS file to your config.toml.

```
[params]
  customCSS = ["/css/custom.css"] # in case you use `/static/css/custom.css`
```

### Enable Google Analytics when running as server

If you want to enable google analytics when running hugo as server, add `enableGoogleAnalytics` param to your config.toml.

```
[params]
  enableGoogleAnalytics = true
```

### Enable UglyURLs

If you want to enable "Ugly URLs" (e.g. exmaple.com/urls.html), add `uglyurls = true` to top level and [params] of your config.toml.

```
uglyurls = true

[params]
  uglyurls = true
```

### Enable Bottom Navigation

If you want to enable bottom navigation in , add `enableBottomNavigation = true` params to your config.toml.

```
[params]
  enableBottomNavigation = true
```

## Frontmatter example

```
+++
title = "Article title here"
date = 2020-02-15T20:00:00+09:00
tags = ["tags here"]
draft = false
toc = false
backtotop = false
disable_comments = true <!-- disable disqus -->
+++

# Title

<!-- when toc is true and post wordcounts is greater than 400 -->

## Contents

```

## Contribution

**Issues and PRs are very welcome!**

### Development

If you touch CSS or JavaScript file, you need to build to add your changes following below steps.

1. Install Node.js and npm (Node.js package manager).

2. The package.json file in your new sub-theme contains the versions of all the Node.js software you need.
  To install them run:

    ```
    $ npm install
    ```

3. After fixing files, you can format like below. (Auto format before commit using husky)

    ```
    $ npm run format
    ```

## LICENSE

[MIT](./LICENSE).

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fmatsuyoshi30%2Fharbor.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fmatsuyoshi30%2Fharbor?ref=badge_large)

## Author

[matsuyoshi30](https://twitter.com/matsuyoshi30)