Hugo + Github 조합으로 30분 만에 개인 개발 블로그를 구축하기 (3)
Hugo 테마는 종류도 정말 많고, 각 테마마다 지원하는 기능이 다양하기 때문에 잘 활용하기 위해서는 각 테마가 지원하는 기능을 알아두는 것이 좋다. 이번 가이드에 사용한 freshPink 테마의 지원 기능에 대해서 알아보자.
[params]
mainImageUrl = "https://i.imgur.com/URQWyyY.png"
showMainImage = true
freshPink 테마는 메인 페이지에 원하는 이미지를 노출할 수 있는 기능을 제공한다.hugo.toml -> mainImageUrl 속성에 기입하면 된다.hugo.toml -> showMainImage 속성으로 제어할 수 있다.
showMainImage = true : 이미지 ONshowMainImage = false : 이미지 OFFGithub 잔디[params]
githubUsername = "username"
showGithubChart = true
freshPink 테마는 메인 페이지에 자신의 깃허브 잔디를 노출할 수 있는 기능을 제공한다.hugo.toml -> githubUsername 속성에 기입하면 된다.hugo.toml -> showGithubChart 속성으로 제어할 수 있다.
showGithubChart = true : 잔디 ONshowGithubChart = false : 잔디 OFF[params]
primaryColor = "#fa8b84"
freshPink 테마는 primaryColor 를 변경할 수 있는 기능을 제공한다.Front Matter 살펴보기+++
title = '03. Shortcuts'
date = 2000-10-10
draft = false
featured_image = "img.url..."
tags = ['tag_b']
+++
Front Matter 란 마크다운 파일의 머리말 역할을 하며, Hugo가 글을 빌드할 때 필요한 메타데이터를 담는 구역이다.
title : 글 제목date : 작성 날짜draft : 초안 여부 (true면 빌드 시 무시됨, false면 공개됨)tags : 태그 달기featured_image : 해당 게시글 상단에 이미지가 표시된다..md 파일의 Front Matter를 보면 tags = [] 필드가 있다.tags = ['tag_a']
여러 개의 태그를 동시에 지정할 수도 있다.
tags = ['tag_a', 'tag_c']
/content/tags 경로로 이동한다 (폴더가 없다면 생성한다).unix).content/tags/unix 경로가 생성되며 설정이 완료된다.freshPink 와 같이 하나의 시리즈로 묶어 관리하고자 할 때 유용하다./data/series 디렉토리(없으면 만들자)가 필요하다.items 리스트에는 해당 시리즈에 속하는 각 문서의 이름과 링크를 작성한다.title: "freshPink"
items:
- name: "01. freshPink"
link: "https://elecbrandy.github.io/posts/post-1"
- name: "03. features"
link: "https://elecbrandy.github.io/posts/post-2"
- name: "03. shortcuts"
link: "https://elecbrandy.github.io/posts/post-3"
title: 사용자가 클릭하여 리스트를 펼칠 때 보이는 제목이다.series: data/series/ 디렉토리에 있는 YAML 파일의 이름(확장자 제외)을 지정한다.{{< series title="📚 /hugo 튜토리얼" series="hugo" >}}
/tolight, /todark 를 통해 모드를 변환할 수 있다!