Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing html tags and add favicon config #14

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ disqusShortname = "shortname"
googleAnalytics = ""

[params]
favicon = "https://assets-cdn.github.com/favicon.ico"

[params.highlight]
style = "github"
Expand Down
1 change: 1 addition & 0 deletions layouts/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ <h2 class="subtitle is-4">
</div>
</div>
</section>
{{ partial "footer" . }}
2 changes: 1 addition & 1 deletion layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!-- This theme is not supported list page -->
{{ template "theme/index.html" . }}
5 changes: 5 additions & 0 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
{{ partial "nav" . }}
<section class="section">
<div class="container">
<div class="subtitle is-6 is-pulled-right">
{{ if .Params.tags }}
{{ partial "tags" .Params.tags }}
{{ end }}
</div>
<h2 class="subtitle is-6">{{ .Date.Format "January 2, 2006" }}</h2>
<h1 class="title">{{ .Title }}</h1>
<div class="content">
Expand Down
5 changes: 5 additions & 0 deletions layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
<div class="container">
{{ range sort .Paginator.Pages }}
<article>
<div class="subtitle is-6 is-pulled-right">
{{ if .Params.tags }}
{{ partial "tags" .Params.tags }}
{{ end }}
</div>
<h2 class="subtitle is-6">{{ .Date.Format "January 2, 2006" }}</h2>
<h1 class="title"><a href="{{ .Permalink }}">{{ .Title }}</a>{{ if .Draft }} ::Draft{{ end }}</h1>
<div class="content">
Expand Down
3 changes: 3 additions & 0 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@
{{ if .Site.GoogleAnalytics }}
{{ template "_internal/google_analytics_async.html" . }}
{{ end }}

</body>
</html>
20 changes: 13 additions & 7 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
<!DOCTYPE html>
<html{{ with .Site.LanguageCode }} lang="{{ . }}"{{ end }}>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<html xmlns="http://www.w3.org/1999/xhtml" {{ with .Site.LanguageCode }} lang="{{ . }}"{{ end }}>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{{ .Title }}{{ if eq .IsHome false }} | {{ .Site.Title }}{{ end }}</title>
<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/style.css">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css">
<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/style.css" />
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" />
{{ with .Site.Params.highlight.style }}
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/styles/{{ . }}.min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/styles/{{ . }}.min.css" />
{{ else }}
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/styles/default.min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/styles/default.min.css" />
{{ end }}
{{ with .Site.Params.favicon }}
<link rel="icon" type="image/x-icon" href="{{ . }}">
{{ end }}
</head>
<body>
9 changes: 9 additions & 0 deletions layouts/partials/tags.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{ range first 1 . }}
<a class="subtitle is-6" href="{{ "/tags/" | relURL }}{{ . | urlize }}">#{{ . }}</a>
{{ end }}

{{ if gt (len .) 1 }}
{{ range after 1 . }}
| <a class="subtitle is-6" href="{{ "/tags/" | relURL }}{{ . | urlize }}">#{{ . }}</a>
{{ end }}
{{ end }}