-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a8eb600
commit 66a7498
Showing
1 changed file
with
6 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
{{ $path := .Get 0 }} <!-- 전달받은 경로 --> | ||
{{ $page := .Site.GetPage $path }} <!-- 경로에 해당하는 페이지 가져오기 --> | ||
{{ $currentLang := .Page.Language.Lang }} | ||
{{ $currentLang := .Page.Language.Lang }} <!-- 현재 페이지 언어 --> | ||
{{ $baseURL := .Site.BaseURL }} <!-- 기본 baseURL 가져오기 --> | ||
|
||
{{ if $page }} <!-- 페이지가 유효한 경우 --> | ||
{{ $localizedPath := cond (eq $currentLang "en") $path (print "/" $currentLang $path) }} | ||
{{ $localizedPath := cond (eq $currentLang "en") $path (print "/" $currentLang $path) }} <!-- 언어별 경로 처리 --> | ||
{{ $finalPath := print $baseURL $localizedPath }} <!-- baseURL을 포함한 최종 경로 생성 --> | ||
{{ $title := $page.Title }} <!-- 페이지 제목 가져오기 --> | ||
<a href="{{ $localizedPath | relURL }}">{{ $title | safeHTML }}</a>{{- "" -}} | ||
<a href="{{ $finalPath }}">{{ $title | safeHTML }}</a>{{- "" -}} | ||
{{ else }} <!-- 페이지가 없을 경우 기본 출력 --> | ||
<a href="#">{{ $path }}</a>{{- "" -}} | ||
{{ end }} |