開発環境
- macOS Catalina - Apple (OS)
- Emacs (Text Editor)
- Windows 10 Pro (OS)
- Visual Studio Code (Text Editor)
- Hugo
Build Websites With Hugo: Fast Web Development With Markdown (Brian P. Hogan(著)、Pragmatic Bookshelf)のChapter 4(Working with Data)、Your Turn 4.の解答を求めてみる。
HTML
portfolio/themes/basic/layouts/_default/opensource.html
{{ define "main" }}
<h2>{{ .Title }}</h2>
{{ .Content }}
<section class="oss">
{{ range .Site.Data.repos }}
<article>
<h3><a href="{{ .html_url }}">{{ .name }}</a></h3>
<p>{{ .description }}</p>
</article>
{{ end }}
</section>
{{ end }}
入出力結果(Zsh、PowerShell、Terminal)
% tree data
data
├── repos.json
└── socialmedia.json
0 directories, 2 files
%
0 コメント:
コメントを投稿