From 7528f5bf5e71d32db26a629887799b0c98a7333b Mon Sep 17 00:00:00 2001
From: Salvatore Giordano <salvatoregiordanoo@gmail.com>
Date: Thu, 17 Jan 2019 13:50:14 +0000
Subject: [PATCH] Add external link feature for posts (#141)

---
 exampleSite/content/posts/external-post.md |   14 ++++++++++++++
 archetypes/posts.md                        |    1 +
 layouts/posts/li.html                      |    2 +-
 CONTRIBUTORS.md                            |    1 +
 4 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 3156e7f..48b5993 100644
--- a/CONTRIBUTORS.md
+++ b/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)
\ No newline at end of file
diff --git a/archetypes/posts.md b/archetypes/posts.md
index 92f352a..634fa29 100644
--- a/archetypes/posts.md
+++ b/archetypes/posts.md
@@ -6,4 +6,5 @@
 slug = "" 
 tags = []
 categories = []
+externalLink = ""
 +++
diff --git a/exampleSite/content/posts/external-post.md b/exampleSite/content/posts/external-post.md
new file mode 100644
index 0000000..3e68871
--- /dev/null
+++ b/exampleSite/content/posts/external-post.md
@@ -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"
++++
diff --git a/layouts/posts/li.html b/layouts/posts/li.html
index 28bb0c3..7077125 100644
--- a/layouts/posts/li.html
+++ b/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>

--
Gitblit v1.10.0