split the footer part for better structure

This commit is contained in:
Huy Tran 2018-01-22 10:03:55 +07:00
parent 365a5731ca
commit 514e9a167f
11 changed files with 120 additions and 101 deletions

View file

@ -4,9 +4,9 @@ __`hyde-hyde`__ is a [Hugo](https://gohugo.io)'s theme derived from @spf13's [Hy
You can see a real site in action [here](https://htr3n.github.io). You can see a real site in action [here](https://htr3n.github.io).
![hyde-hyde main screen](https://github.com/htr3n/hyde-hyde/blob/master/images/hyde-hyde-main.PNG) ![hyde-hyde main screen](https://github.com/htr3n/hyde-hyde/blob/master/images/main.png)
![hyde-hyde main screen](https://github.com/htr3n/hyde-hyde/blob/master/images/hyde-hyde-posts.PNG) ![hyde-hyde main screen](https://github.com/htr3n/hyde-hyde/blob/master/images/posts.png)
## Installation ## Installation

View file

Before

Width:  |  Height:  |  Size: 317 KiB

After

Width:  |  Height:  |  Size: 317 KiB

View file

Before

Width:  |  Height:  |  Size: 179 KiB

After

Width:  |  Height:  |  Size: 179 KiB

View file

@ -2,9 +2,10 @@
<body class="{{ .Site.Params.themeColor }} {{if .Site.Params.layoutReverse}}layout-reverse{{end}}"> <body class="{{ .Site.Params.themeColor }} {{if .Site.Params.layoutReverse}}layout-reverse{{end}}">
{{ partial "sidebar.html" . }} {{ partial "sidebar.html" . }}
<div class="content container"> <div class="content container">
{{ block "main" . -}}{{- end }} {{ block "main" . }}{{ end }}
</div>
<div class="footer">
{{ block "footer" . }}{{ end }}
</div> </div>
{{ template "_internal/google_analytics_async.html" . }}
</body> </body>
</html> </html>

View file

@ -1,5 +1,5 @@
{{ define "main" -}} {{ define "main" }}
<h1 class="title">Blog Posts</h1> <h1 class="title">{{ .Title }}</h1>
<ul class="posts"> <ul class="posts">
{{ range .Data.Pages -}} {{ range .Data.Pages -}}
<li> <li>
@ -8,3 +8,12 @@
{{- end }} {{- end }}
</ul> </ul>
{{- end }} {{- end }}
{{ define "footer" }}
<!-- Footer -->
<div>
{{ if .Site.GoogleAnalytics -}}
{{ template "_internal/google_analytics_async.html" . }}
{{- end}}
</div>
{{- end }}

View file

@ -33,9 +33,25 @@
{{ end }} {{ end }}
{{ .Content }} {{ .Content }}
</div> </div>
{{- end }}
{{ if .Site.DisqusShortname -}} {{ define "footer" -}}
{{ if .Site.Params.highlightjs }}
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
{{ range .Site.Params.highlightjslanguages }}
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/{{.}}.min.js"></script>
{{ end }}
<script type="text/javascript">
hljs.initHighlightingOnLoad();
</script>
{{ end }}
<!-- Google Analytics -->
{{ if .Site.GoogleAnalytics }}
{{ template "_internal/google_analytics_async.html" . }}
{{ end }}
<!-- Disqus-->
{{ if .Site.DisqusShortname }}
<h2>Comments</h2> <h2>Comments</h2>
{{ template "_internal/disqus.html" . }} {{ template "_internal/disqus.html" . }}
{{- end }} {{ end }}
{{- end }} {{- end }}

View file

@ -17,7 +17,6 @@
<!-- CSS --> <!-- CSS -->
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/print.css" media="print"> <link rel="stylesheet" href="{{ .Site.BaseURL }}css/print.css" media="print">
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/poole.css"> <link rel="stylesheet" href="{{ .Site.BaseURL }}css/poole.css">
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/syntax.css">
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/hyde.css"> <link rel="stylesheet" href="{{ .Site.BaseURL }}css/hyde.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Fira+Sans:300,300i,400,400i,500"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Fira+Sans:300,300i,400,400i,500">
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/custom.css"> <link rel="stylesheet" href="{{ .Site.BaseURL }}css/custom.css">

View file

@ -10,7 +10,7 @@
<div> <div>
<ul class="sidebar-nav"> <ul class="sidebar-nav">
{{ range .Site.Menus.main -}} {{ range .Site.Menus.main -}}
<li><a href="{{.URL}}"> {{ .Name | upper }} </a></li> <li><a href="{{.URL}}"> {{ .Name | title }} </a></li>
{{- end }} {{- end }}
</ul> </ul>
</div> </div>

View file

@ -1,12 +1,8 @@
body { html, body {
font-family: "Fira Sans", sans-serif; font-family: "Fira Sans", sans-serif;
font-size: 16px; font-size: 18px;
font-weight: 300 !important; font-weight: 300;
} line-height: 1.5;
code {
font-family: monospace;
font-size: .9rem;
} }
.img-circle { .img-circle {
@ -19,19 +15,24 @@ code {
} }
.brand { .brand {
font-size: 3.0em; font-size: 2.6em;
margin-bottom: 0; margin-bottom: 0;
} }
span, p, code {
font-size: 1.33vw;
}
.text-center { .text-center {
text-align:center; text-align:center;
} }
.meta { .meta {
font-size: .9rem !important; font-size: .8rem !important;
font-weight: 300; font-weight: 300;
} }
pre {
padding: 2px;
tab-size: 2;
}
pre > code {
font-family: monospace;
}

View file

@ -1,66 +1,59 @@
.hll { background-color: #ffffcc } /* Background */ .chroma { color: #f8f8f2; background-color: #272822 }
/*{ background: #f0f3f3; }*/ /* Error */ .chroma .err { color: #960050; background-color: #1e0010 }
.c { color: #999; } /* Comment */ /* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
.err { color: #AA0000; background-color: #FFAAAA } /* Error */ /* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; width: 100%; overflow: auto; display: block; }
.k { color: #006699; } /* Keyword */ /* LineHighlight */ .chroma .hl { display: block; width: 100%;background-color: #ffffcc }
.o { color: #555555 } /* Operator */ /* LineNumbersTable */ .chroma .lnt { margin-right: 0.4em; padding: 0 0.4em 0 0.4em; display: block; }
.cm { color: #0099FF; font-style: italic } /* Comment.Multiline */ /* LineNumbers */ .chroma .ln { margin-right: 0.4em; padding: 0 0.4em 0 0.4em; }
.cp { color: #009999 } /* Comment.Preproc */ /* Keyword */ .chroma .k { color: #66d9ef }
.c1 { color: #999; } /* Comment.Single */ /* KeywordConstant */ .chroma .kc { color: #66d9ef }
.cs { color: #999; } /* Comment.Special */ /* KeywordDeclaration */ .chroma .kd { color: #66d9ef }
.gd { background-color: #FFCCCC; border: 1px solid #CC0000 } /* Generic.Deleted */ /* KeywordNamespace */ .chroma .kn { color: #f92672 }
.ge { font-style: italic } /* Generic.Emph */ /* KeywordPseudo */ .chroma .kp { color: #66d9ef }
.gr { color: #FF0000 } /* Generic.Error */ /* KeywordReserved */ .chroma .kr { color: #66d9ef }
.gh { color: #003300; } /* Generic.Heading */ /* KeywordType */ .chroma .kt { color: #66d9ef }
.gi { background-color: #CCFFCC; border: 1px solid #00CC00 } /* Generic.Inserted */ /* NameAttribute */ .chroma .na { color: #a6e22e }
.go { color: #AAAAAA } /* Generic.Output */ /* NameClass */ .chroma .nc { color: #a6e22e }
.gp { color: #000099; } /* Generic.Prompt */ /* NameConstant */ .chroma .no { color: #66d9ef }
.gs { } /* Generic.Strong */ /* NameDecorator */ .chroma .nd { color: #a6e22e }
.gu { color: #003300; } /* Generic.Subheading */ /* NameException */ .chroma .ne { color: #a6e22e }
.gt { color: #99CC66 } /* Generic.Traceback */ /* NameFunction */ .chroma .nf { color: #a6e22e }
.kc { color: #006699; } /* Keyword.Constant */ /* NameOther */ .chroma .nx { color: #a6e22e }
.kd { color: #006699; } /* Keyword.Declaration */ /* NameTag */ .chroma .nt { color: #f92672 }
.kn { color: #006699; } /* Keyword.Namespace */ /* Literal */ .chroma .l { color: #ae81ff }
.kp { color: #006699 } /* Keyword.Pseudo */ /* LiteralDate */ .chroma .ld { color: #e6db74 }
.kr { color: #006699; } /* Keyword.Reserved */ /* LiteralString */ .chroma .s { color: #e6db74 }
.kt { color: #007788; } /* Keyword.Type */ /* LiteralStringAffix */ .chroma .sa { color: #e6db74 }
.m { color: #FF6600 } /* Literal.Number */ /* LiteralStringBacktick */ .chroma .sb { color: #e6db74 }
.s { color: #d44950 } /* Literal.String */ /* LiteralStringChar */ .chroma .sc { color: #e6db74 }
.na { color: #4f9fcf } /* Name.Attribute */ /* LiteralStringDelimiter */ .chroma .dl { color: #e6db74 }
.nb { color: #336666 } /* Name.Builtin */ /* LiteralStringDoc */ .chroma .sd { color: #e6db74 }
.nc { color: #00AA88; } /* Name.Class */ /* LiteralStringDouble */ .chroma .s2 { color: #e6db74 }
.no { color: #336600 } /* Name.Constant */ /* LiteralStringEscape */ .chroma .se { color: #ae81ff }
.nd { color: #9999FF } /* Name.Decorator */ /* LiteralStringHeredoc */ .chroma .sh { color: #e6db74 }
.ni { color: #999999; } /* Name.Entity */ /* LiteralStringInterpol */ .chroma .si { color: #e6db74 }
.ne { color: #CC0000; } /* Name.Exception */ /* LiteralStringOther */ .chroma .sx { color: #e6db74 }
.nf { color: #CC00FF } /* Name.Function */ /* LiteralStringRegex */ .chroma .sr { color: #e6db74 }
.nl { color: #9999FF } /* Name.Label */ /* LiteralStringSingle */ .chroma .s1 { color: #e6db74 }
.nn { color: #00CCFF; } /* Name.Namespace */ /* LiteralStringSymbol */ .chroma .ss { color: #e6db74 }
.nt { color: #2f6f9f; } /* Name.Tag */ /* LiteralNumber */ .chroma .m { color: #ae81ff }
.nv { color: #003333 } /* Name.Variable */ /* LiteralNumberBin */ .chroma .mb { color: #ae81ff }
.ow { color: #000000; } /* Operator.Word */ /* LiteralNumberFloat */ .chroma .mf { color: #ae81ff }
.w { color: #bbbbbb } /* Text.Whitespace */ /* LiteralNumberHex */ .chroma .mh { color: #ae81ff }
.mf { color: #FF6600 } /* Literal.Number.Float */ /* LiteralNumberInteger */ .chroma .mi { color: #ae81ff }
.mh { color: #FF6600 } /* Literal.Number.Hex */ /* LiteralNumberIntegerLong */ .chroma .il { color: #ae81ff }
.mi { color: #FF6600 } /* Literal.Number.Integer */ /* LiteralNumberOct */ .chroma .mo { color: #ae81ff }
.mo { color: #FF6600 } /* Literal.Number.Oct */ /* Operator */ .chroma .o { color: #f92672 }
.sb { color: #CC3300 } /* Literal.String.Backtick */ /* OperatorWord */ .chroma .ow { color: #f92672 }
.sc { color: #CC3300 } /* Literal.String.Char */ /* Comment */ .chroma .c { color: #75715e }
.sd { color: #CC3300; font-style: italic } /* Literal.String.Doc */ /* CommentHashbang */ .chroma .ch { color: #75715e }
.s2 { color: #CC3300 } /* Literal.String.Double */ /* CommentMultiline */ .chroma .cm { color: #75715e }
.se { color: #CC3300; } /* Literal.String.Escape */ /* CommentSingle */ .chroma .c1 { color: #75715e }
.sh { color: #CC3300 } /* Literal.String.Heredoc */ /* CommentSpecial */ .chroma .cs { color: #75715e }
.si { color: #AA0000 } /* Literal.String.Interpol */ /* CommentPreproc */ .chroma .cp { color: #75715e }
.sx { color: #CC3300 } /* Literal.String.Other */ /* CommentPreprocFile */ .chroma .cpf { color: #75715e }
.sr { color: #33AAAA } /* Literal.String.Regex */ /* GenericDeleted */ .chroma .gd { color: #f92672 }
.s1 { color: #CC3300 } /* Literal.String.Single */ /* GenericEmph */ .chroma .ge { font-style: italic }
.ss { color: #FFCC33 } /* Literal.String.Symbol */ /* GenericInserted */ .chroma .gi { color: #a6e22e }
.bp { color: #336666 } /* Name.Builtin.Pseudo */ /* GenericStrong */ .chroma .gs { font-weight: bold }
.vc { color: #003333 } /* Name.Variable.Class */ /* GenericSubheading */ .chroma .gu { color: #75715e }
.vg { color: #003333 } /* Name.Variable.Global */
.vi { color: #003333 } /* Name.Variable.Instance */
.il { color: #FF6600 } /* Literal.Number.Integer.Long */
.css .o,
.css .o + .nt,
.css .nt + .nt { color: #999; }

View file

@ -2,8 +2,8 @@ name = "hyde-hyde"
license = "MIT" license = "MIT"
licenselink = "https://github.com/htr3n/hyde-hyde/blob/master/LICENSE.md" licenselink = "https://github.com/htr3n/hyde-hyde/blob/master/LICENSE.md"
description = "A forked/derived version of Hyde" description = "A forked/derived version of Hyde"
tags = ["blog", "theme", "hyde"] tags = ["Blog", "Theme", "Hyde", "Highlight.js"]
features = ["blog", "theme"] features = ["blog", "theme", "highlight.js"]
min_version = "0.33" min_version = "0.33"
[author] [author]