---
title: "hugo使い始めました | grasys blog"
url: "https://blog.grasys.io/post/yusukeh/hugo/"
description: "こんにちは株式会社grasysの代表しております長谷川です。 静的サイトジェネレーター Hugo を使い始めました。 こういうのやり始めると止まらなくなるから良くない・・・うちはインフラの会社 個人的にはMedium押しだったりするけど・・・（だがしかし、もう書いてないｗ） なぜ犬なのかはお答えしません！ｗ というよ…"
---

# hugo使い始めました

-   ![](/_astro/noicon.CTHOhNiB_1HMs6A.webp)[yusukeh](/authors/yusukeh/)
-   公開日：2016年8月10日
-   カテゴリー：[Tech](/categories/tech/)
-   タグ：[#hugo](/tags/hugo/)

![hugo使い始めました](/_astro/ogp.cLc2U0YS_ZDcwB6.webp)

こんにちは株式会社grasysの代表しております長谷川です。

静的サイトジェネレーター [Hugo](https://gohugo.io/) を使い始めました。  
こういうのやり始めると止まらなくなるから良くない・・・うちはインフラの会社  
個人的には[Medium](https://medium.com/@yusuke_h)押しだったりするけど・・・（だがしかし、もう書いてないｗ）

> なぜ犬なのかはお答えしません！ｗ というより理由がありません！ｗ

[lektor](https://www.getlektor.com/), [ghost](https://ghost.org/), [Jekyll](https://jekyllrb.com/) といくつか候補を考えたんだけど**Hugo** にしました。（個人的にはghostでも良かったかもｗ）

themeは [casper](http://themes.gohugo.io/casper/) これを使わせて頂いてます。(ghostのdefault themeがcasperそっくりｗ)

## Google Cloud (GCP) Storage

弊社は**google partner**なので**Google Cloud (GCP) Storage**のWebsite Hostingを利用することにしました。

というか静的なWebサイトは全部これにしてます。

Documentは以下

[Static Website Examples, Troubleshooting and Tips](https://cloud.google.com/storage/docs/static-website)

subdomainはblog.grasys.io

### bucket生成

ex)

Plain textcontent\_copy

```
gsutil mb -c <Storage Classes> -l <Bucket Locations> <Bucket Name>
```

[Storage Classes](https://cloud.google.com/storage/docs/storage-classes) [Bucket Locations](https://cloud.google.com/storage/docs/bucket-locations)

standardでasiaにmulti-regionalで作ります。

Plain textcontent\_copy

```
gsutil mb -c STANDARD -l ASIA gs://blog.grasys.io
```

※注意としてはGoogle Web Master ToolでDNSの所有者であることを設定しておく必要があります。-> [Domain-Named Bucket Verification](https://cloud.google.com/storage/docs/domain-name-verification)

### ACL設定

Plain textcontent\_copy

```
gsutil defacl set public-read gs://blog.grasys.io
```

### DNS設定

Google Cloud (GCP) DNSを利用してます。

digはこんな感じ

Plain textcontent\_copy

```
dig blog.grasys.io

blog.grasys.io.		3600	IN	CNAME	c.storage.googleapis.com.
```

### Hugo

hugoの設定して(かなり大変だったｗ)いろいろ準備してコンテンツのMarkdown書いて・・・

hugoのconfig.tomlがあるDirectoryまで移動して

Plain textcontent\_copy

```
$ hugo
Started building site
0 draft content
0 future content
2 pages created
0 non-page files copied
5 paginator pages created
2 tags created
0 categories created
in 78 ms
```

Plain textcontent\_copy

```
$ tree -L 1 hugo
hugo
├── archetypes
├── config.toml
├── content
├── data
├── layouts
├── public
├── static
└── themes

7 directories, 1 file
```

### Google Cloud (GCP) StorageへUploadする！

js, css, htmlを圧縮しながらUpload

Plain textcontent\_copy

```
gsutil -m cp -R -z js,css,html ./hugo/public/* gs://blog.grasys.io/
```

* * *

Google Cloud (GCP) PlatformのDocumentは時間経つとけっこう変わるので注意して！

## この記事を書いた人

[![](/_astro/yusukeh.BvUd2yKE_1mQ6Fp.webp)](/authors/yusukeh/)

### [yusukeh](/authors/yusukeh/)

Fly high. Think deep. Move fast. Go far.🦅

-   [X](https://x.com/yusukeh "X")
-   [GitHub](https://github.com/yusukeh "GitHub")
-   [Medium](https://medium.com/@yusukeh "Medium")
-   [Facebook](https://www.facebook.com/yusuke.exzm "Facebook")
-   [Instagram](https://www.instagram.com/yusukehasegawa/ "Instagram")
-   [LinkedIn](https://www.linkedin.com/in/hasegawa-yusuke-091b4164/ "LinkedIn")

[プロフィールと記事一覧](/authors/yusukeh/)