mirror of https://github.com/luizdepra/hugo-coder.git

Salvatore Giordano
17.50.2019 7528f5bf5e71d32db26a629887799b0c98a7333b
Add external link feature for posts (#141)

* Add external link feature for posts

* Add post example using external link
1 files added
3 files modified
18 ■■■■■ changed files
CONTRIBUTORS.md 1 ●●●● patch | view | raw | blame | history
archetypes/posts.md 1 ●●●● patch | view | raw | blame | history
exampleSite/content/posts/external-post.md 14 ●●●●● patch | view | raw | blame | history
layouts/posts/li.html 2 ●●● patch | view | raw | blame | history
CONTRIBUTORS.md
@@ -29,3 +29,4 @@
- [Piotr Januszewski](https://piojanu.github.io)
- [Artem Khvastunov](https://artspb.me)
- [Gabriel Nepomuceno] (https://blog.nepomuceno.me)
- [Salvatore Giordano] (https://salvatore-giordano.github.io)
archetypes/posts.md
@@ -6,4 +6,5 @@
slug = "" 
tags = []
categories = []
externalLink = ""
+++
exampleSite/content/posts/external-post.md
New file
@@ -0,0 +1,14 @@
+++
date = "2019-01-17"
title = "Hugo coder wiki"
slug = "hugo-coder-wiki"
tags = [
    "hugo",
    "development",
    "themes"
]
categories = [
    "Development",
]
externalLink = "https://github.com/luizdepra/hugo-coder/wiki"
+++
layouts/posts/li.html
@@ -1,4 +1,4 @@
<li>
  <span class="date">{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}</span>
  <a class="title" href="{{ .URL }}">{{ .Title }}</a>
  <a class="title" href="{{ .Params.ExternalLink | default .URL }}">{{ .Title }}</a>
</li>