Browse Source

Inserting about link based on the URL

master
digitalcraftsman 10 years ago
parent
commit
263453fa25
  1. 5
      layouts/partials/head.html
  2. 8
      layouts/partials/nav.html

5
layouts/partials/head.html

@ -9,4 +9,7 @@
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/style.css">
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/highlight.css">
{{ "<!-- RSS Feed -->" | safeHTML }}
<link rel="alternate" type="application/rss+xml" title="{{ with .Site.Params.name }}{{ . }}{{ end }}" href="/feed.xml">
{{ if .RSSlink }}
<link href="{{ .RSSlink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
<link href="{{ .RSSlink }}" rel="feed" type="application/rss+xml" title="{{ .Site.Title }}" />
{{ end }}

8
layouts/partials/nav.html

@ -1,12 +1,12 @@
<nav class="main-nav">
<!-- TODO: Show link only if current page is NOT home -->
{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }}
{{ if ne $url "" }}
<a href='{{ .Site.BaseURL }}'> <span class="arrow"></span>Home</a>
{{ end }}
<!-- TODO: If .PermaLink == /about then don't show this link -->
<a href='{{ .Site.BaseURL }}about'>About</a>
<!-- TODO: Add link to RSS feed -->
{{ if ne $url "about/" }}
<a href='{{ .Site.BaseURL }}about'>About</a>
{{ end }}
<a class="cta" href="{{ .Site.BaseURL }}index.xml">Subscribe</a>
</nav>
Loading…
Cancel
Save