2020年7月3日金曜日

開発環境

Build Websites With Hugo: Fast Web Development With Markdown (Brian P. Hogan(著)、Pragmatic Bookshelf)のChapter 1(Kicking the Tires)、Your Turn 3.の解答を求めてみる。

入出力結果(Zsh、PowerShell、Terminal)

% cat archetypes/default.md 
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
---

% perl -p -e 's/true/false/' archetypes/*
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: false
---

% perl -i -p -e 's/true/false/' archetypes/*
% cat archetypes/default.md              
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: false
---

% hugo new contact.md      
/.../portfolio/content/contact.md created
% cat content/contact.md 
---
title: "Contact"
date: 2020-07-03T13:53:30+09:00
draft: false
---

% perl -i -p -e 's/false/true/' archetypes/*
% cat archetypes/default.md           
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
---

% 

0 コメント:

コメントを投稿