Browse Source

Using shortcodes instead of abusing layouts

master
Mobius K 10 months ago
parent
commit
4d494b567f
  1. 3
      content/_index.html
  2. 13
      layouts/index.html
  3. 8
      layouts/shortcodes/projects.html

3
content/_index.html

@ -1,3 +1,6 @@
---
title: Portfolio
layout: single
---
{{< projects >}}

13
layouts/index.html

@ -1,13 +0,0 @@
{{ define "main" }}
{{ range .Site.Data.projects.list }}
<p>
<a href="{{ .url }}">{{ .name }}</a>
<span>{{ .description }}</span>
</p>
{{ end }}
{{ .Content }}
{{ end }}

8
layouts/shortcodes/projects.html

@ -0,0 +1,8 @@
{{ range .Site.Data.projects.list }}
<p>
<a href="{{ .url }}">{{ .name }}</a>
<span>{{ .description }}</span>
</p>
{{ end }}
Loading…
Cancel
Save