Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Replace deprecated IsMultiLingual with hugo.IsMultilingual #43

Merged
merged 1 commit into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions exampleSite/config/_default/config.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
baseurl = "http://your-site-here/"
languageCode = "en-us"
defaultContentLanguage = "en"
defaultContentLanguageInSubdir = false
title = "your site title"
# theme = "hugo-theme-geppaku"
googleAnalytics = "G-2GMRFCH6DG" # Optional
disqusShortname = "" # Optional

[languages]
[languages.en]
languageName = "English"
weight = 1
[languages.ja]
languageName = "Japanese"
weight = 2

[author]
# If you want to display author information set these
# This is Optional values
Expand Down
106 changes: 106 additions & 0 deletions exampleSite/content/post/2016/05/how-to-install-Geppaku-theme.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
+++
date = "2016-05-03T11:03:05+09:00"
draft = false
title = "月白のインストール方法"
slug = "how-to-install-geppaku-theme"
categories = ["technology"]
tags = [
"Hugo",
"Hugo theme",
]
+++
Geppaku is bluish white theme for [Hugo](http://gohugo.io/).
It is color name in Japan. Chinese character is "月白".

> 月白(げっぱく)とは、月の光を思わせる薄い青みを含んだ白色のことです。
<small>via http://irocore.com/geppaku/</small>

Geppaku is the white color including a thin blue that reminiscent of the light of the moon.
(If that translate is wrong, please inform me using PullRequest.)

## Screenshot
### Index page
![list](/list.png)

### Post page
![post](/screenshot.png)


## Installation

```
$ mkdir themes
$ cd themes
$ git clone https://github.com/masa0221/hugo-theme-geppaku hugo-theme-geppaku
```
See the Hugo documentation for more information.


### Config

Example of config.toml file:
```toml
baseurl = "http://your-site-here/"
languageCode = "en-us"
title = "your site title"
theme= "hugo-theme-geppaku"
googleAnalytics = "" # Optional
disqusShortname = "" # Optional

[author]
# If you want to display author information set these
# This is Optional values
name = "Your name"

# Please set account ids
# This is Optional values
twitter = "your twitter id"
linkedin = "your linkedin id"
github = "your github id"

[params]
[params.sharebutton]
# If you want to display share buttons set these
# This is Optional values
twitter = true
facebook = true
# hatena = true # hatena is Japanese social media
google = true
pocket = true
# Please set id when you want to display facebook
facebookAppId = "your app id"

[params.adsense]
# If you want to display Google adsense set these
# This is Optional values
# 1. Create file written of the adsense tag into the directory "layouts/partials"
# 2. Please set file path name omitted "layouts/partials"
sidebar = "adsense/sidebar.html"
content = "adsense/content.html"
```
You can delete optional parameter.
Please delete unnecessary parameter.


### New Post
#### Create markdown file
```sh
hugo new post/2016/05/hello-hugo.md
```

#### Example of the toml file

```
+++
date = "2016-04-30T16:44:45+09:00"
draft = false
title = "Hello Hugo!"
slug = "hello-hugo"
categories = ["tech"]
tags = [
"hugo",
"golang",
]
+++
Hello Hugo!
```
2 changes: 1 addition & 1 deletion layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{{ if .Site.Copyright }}
{{ .Site.Copyright | markdownify}}
{{ else }}
Copyright (c) {{ .Site.LastChange.Format "2006" }}, <a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
Copyright (c) {{ .Site.Lastmod.Format "2006" }}, <a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
{{ end }}
</span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/language-selector.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and .Site.IsMultiLingual (not .Site.Params.DisableLanguageSwitchingButton)}}
{{- if and hugo.IsMultilingual (not .Site.Params.DisableLanguageSwitchingButton)}}
{{ range .Page.AllTranslations }}
<a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>
{{ end }}
Expand Down