This commit is contained in:
athul 2020-04-09 00:14:29 +05:30
commit 3c737553b6
17 changed files with 519 additions and 0 deletions

20
LICENSE Normal file
View File

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2020 ATHUL CYRIAC AJAY
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

2
archetypes/default.md Normal file
View File

@ -0,0 +1,2 @@
+++
+++

0
layouts/404.html Normal file
View File

View File

@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
{{ partial "header.html" . }}
<body>
<div class="container wrapper list">
{{ partial "head.html" . }}
{{ if isset .Data "Term" }}
<h1>Entries tagged - "{{ .Data.Term }}"</h1>
{{ else }}
<h1 class="page-title">All articles</h1>
{{ end }}
<ul class="posts">
{{- range .Data.Pages -}}
{{- if (in (.Site.Params.excludedTypes | default (slice "page")) .Type) -}}
{{- else -}}
<li class="post">
<a href="{{ .RelPermalink }}">{{.Title}}</a> <span class="meta">{{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</span>
</li>
{{- end -}}
{{- end -}}
</ul>
</div>
{{ partial "footer.html" . }}
</body>
</html>

View File

@ -0,0 +1,43 @@
<!DOCTYPE html>
<html>
{{ partial "header.html" . }}
<body>
<div class="content">
{{ partial "head.html" . }}
<main>
<article>
<div class="title">
<h1 class="title">{{ .Title }}</h1>
<div class="meta">Posted on {{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</div>
</div>
<div>
{{ if isset .Params "tldr" }}
<div class="tldr">
<strong>tl;dr:</strong>
{{ .Params.tldr }}
</div>{{ end }}
</div>
<section class="body">
{{ .Content }}
</section>
<div class="post-tags">
{{ if ne .Type "page" }}
{{ if gt .Params.tags 0 }}
<nav class="nav tags">
<ul class="flat">
{{ range .Params.tags }}
<li><a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a></li>
{{ end }}
</ul>
</nav>
{{ end }}
{{ end }}
</div>
{{- $.Scratch.Set "isDisqus" true -}}
{{ partial "footer.html" . }}
</div>
</body>
</html>

View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
{{ partial "header.html" . }}
<body>
<div class="container wrapper tags">
{{ partial "head.html" . }}
<h1 class="page-title">All tags</h1>
</div>
{{ partial "footer.html" . }}
</body>
</html>

View File

@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
{{ partial "header.html" . }}
<body>
<div class="container wrapper tags">
{{ partial "head.html" . }}
<h1 class="page-title">All tags</h1>
{{ $biggest := 1 }}
{{ $smallest := 1 }}
{{ $max := 3 }}
{{ $min := 1 }}
{{ $size := $min }}
{{ $data := .Data }}
<div class="tag-cloud">
{{ range $key, $value := .Data.Terms.ByCount }}
{{ $size := (add (mul (div $value.Count $biggest) (sub $max $min)) $min) }}
{{ $size := (cond (eq $biggest $smallest) $min $size) }}
<a style="font-size: {{ $size }}rem;" href="{{ $.Site.LanguagePrefix | absURL }}{{ $data.Plural }}/{{ $value.Name | urlize }}/">{{ $value.Name }}</a>
{{ end }}
</div>
</div>
{{ partial "footer.html" . }}
</body>
</html>

37
layouts/index.html Normal file
View File

@ -0,0 +1,37 @@
<!DOCTYPE html>
<html>
{{ partial "header.html" . }}
<body>
{{ partial "head.html" . }}
<main class="list">
<div class="site-description">
{{- if isset .Site.Params "subtitle" -}}
<p>{{ .Site.Params.Subtitle | markdownify }}</p>
{{- end -}}
</div>
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
{{ $paginator := .Paginate (where $pages "Params.hidden" "ne" true) }}
{{ range $paginator.Pages }}
<section class="list-item">
<h1 class="title"><a href="{{ .RelPermalink }}">{{.Title}}</a></h1>
<time>{{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</time>
<br><span class="description">
{{ if isset .Params "description" }}
{{ .Description }}
{{ else }}
{{ .Summary }}&hellip;
{{ end }}
</span><br/>
<a href="{{ .RelPermalink }}">Read more ⟶</a>
</section>
{{ end }}
{{ template "partials/paginator.html" . }}
</main>
{{ partial "footer.html" . }}
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,7 @@
<footer>
<a href="https://github.com/athul">GitHub</a> |
{{ with .Site.Copyright }} {{ . }} | {{ end }} <a href="https://github.com/athul/archie-theme">Archie Theme</a> | Built with <a href="https://gohugo.io">Hugo</a>
</footer>
{{ if not .Site.IsServer }}
{{ template "_internal/google_analytics_async.html" . }}
{{ end }}

View File

@ -0,0 +1,9 @@
<div class="content">
<header>
<div class="logo">
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
</div>
<nav>
👋
</nav>
</header>

View File

@ -0,0 +1,32 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
{{- $title := ( .Title ) -}}
{{- $siteTitle := ( .Site.Title ) -}}
{{- if .IsHome -}}
<title>{{ $siteTitle }} {{ if isset .Site.Params "subtitle" }}- {{ .Site.Params.Subtitle }}{{ end }} </title>
{{- else -}}
<title>{{ $title }} - {{ $siteTitle }}</title>
{{- end -}}
{{- if isset .Site.Params "favicon" -}}
<link rel="icon" type="image/png" href={{ .Site.Params.favicon }} />
{{- end -}}
<meta name="viewport" content="width=device-width, initial-scale=1">
{{ with .OutputFormats.Get "rss" -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}
{{- template "_internal/opengraph.html" . -}}
{{- template "_internal/twitter_cards.html" . -}}
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet"> <link rel="stylesheet" type="text/css" media="screen" href="{{ .Site.BaseURL }}css/main.css" />
{{- range .Site.Params.customJS }}
{{- if or (hasPrefix . "http://") (hasPrefix . "https://") }}
<script src="{{ . }}"></script>
{{- else }}
<script src="{{ $.Site.BaseURL }}{{ . }}"></script>
{{- end }}
{{- end }}
{{- end }}
</head>

View File

@ -0,0 +1,15 @@
{{ $pag := $.Paginator }}
{{ if gt $pag.TotalPages 1 }}
<ul class="pagination">
<span class="page-item page-prev">
{{ if $pag.HasPrev }}
<a {{ if $pag.HasPrev }}href="{{ $pag.Prev.URL }}"{{ end }} class="page-link" aria-label="Previous"><span aria-hidden="true">← Prev</span></a>
{{ end }}
</span>
<span class="page-item page-next">
{{ if $pag.HasNext }}
<a {{ if $pag.HasNext }}href="{{ $pag.Next.URL }}"{{ end }} class="page-link" aria-label="Next"><span aria-hidden="true">Next →</span></a>
{{ end }}
</span>
</ul>
{{ end }}

View File

@ -0,0 +1,6 @@
<div class="callout" style="">
<div class="callout-inner">
{{ .Get "text" }}
</div>
</div>

228
static/css/main.css Normal file
View File

@ -0,0 +1,228 @@
/* Markdown */
html {
color: #232333;
font-family: 'Roboto Mono', monospace;
font-size: 15px;
line-height: 1.6em;
}
body{
display: block;
margin: 8px;
}
* {
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
::selection {
background: red;
color: #fff;
}
h1, h2, h3, h4, h5, h6 {
font-size: 1.2rem;
margin-top: 2em;
}
h1::before { color: red; content: '# '; }
h2::before { color: red; content: '## '; }
h3::before { color: red; content: '### '; }
h4::before { color: red; content: '#### '; }
h5::before { color: red; content: '##### '; }
h6::before { color: red; content: '###### '; }
p {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
line-height: 1.5;
}
hr {
border: 0;
border-top: 3px solid palevioletred;
margin: 1em 0;
}
blockquote {
border-left: 3px solid lime;
color: #737373;
margin: 0;
padding-left: 1em;
}
a {
border-bottom: 3px solid red;
color: inherit;
text-decoration: none;
}
a:hover {
background-color: navy;
color: #fff;
}
ul {
list-style: none;
padding-left: 2ch;
}
ul li {
text-indent: -2ch;
}
ul li::before {
content: '* ';
font-weight: bold;
}
/* Images */
img {
border: 3px solid #ececec;
max-width: 100%;
}
figure {
box-sizing: border-box;
display: inline-block;
margin: 0;
max-width: 100%;
}
figure img {
max-height: 500px;
}
@media screen and (min-width: 600px) {
figure {
padding: 0 40px;
}
}
figure h4 {
font-size: 1rem;
margin: 0;
margin-bottom: 1em;
}
figure h4::before {
content: '↳ ';
}
/* Code blocks */
code {
background-color: #f1f1f1;
padding: .1em .2em;
}
pre {
background-color: #ececec;
line-height: 1.4;
overflow-x: auto;
padding: 1em;
}
.highlight pre ::selection {
background: rgba(255, 255, 255, 0.2);
color: inherit;
}
pre code {
background-color: transparent;
color: inherit;
font-size: 100%;
padding: 0;
}
/* Containers */
.content {
margin-bottom: 4em;
margin-left: auto;
margin-right: auto;
max-width: 800px;
padding: 0 1ch;
word-wrap: break-word;
}
/* Header */
header {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin: 1em 0;
}
header .main {
font-size: 1.5rem;
}
/* Footer */
footer {
margin-top: 1em;
}
/* Common */
.title h1 {
margin-bottom: 0;
}
time {
color: #757575;
}
/* Posts */
article .title {
margin-bottom: 1em;
}
/* Lists */
.list {
margin-top: 2em;
}
.list .title a {
border: none;
}
.list .description a {
border-bottom: none;
color: springgreen;
}
.list .description a:hover {
color: #fff;
}
.list h1 {
margin-bottom: 0;
}
.list p {
margin: 0;
}
.list-item {
margin-bottom: 2em;
}
/* Expander */
/* Callout */
.callout {
background-color: springgreen;
color: #fff;
padding: 1em;
}
.callout p {
font-family: 'Roboto Mono', monospace;
margin: 0;
}
.callout a {
border-bottom: 3px solid #fff;
}
.callout a:hover {
background-color: #fff;
color: springgreen;
}
.site-description {
display: flex;
justify-content: space-between;
}

13
static/js/feather.min.js vendored Normal file

File diff suppressed because one or more lines are too long

17
static/js/main.js Normal file
View File

@ -0,0 +1,17 @@
var expanders = document.getElementsByClassName('expander');
for (var i = 0; i < expanders.length; i++) {
(function() {
var expander = expanders[i];
var content = expander.children[0];
var button = document.createElement('button');
button.appendChild(document.createTextNode('expand'));
expander.appendChild(button);
content.style.height = expander.dataset.height || '12.5em';
button.onclick = function() {
content.style.height = 'auto';
button.remove();
}
})();
}

15
theme.toml Normal file
View File

@ -0,0 +1,15 @@
# theme.toml template for a Hugo theme
# See https://github.com/gohugoio/hugoThemes#themetoml for an example
name = "Archie"
license = "MIT"
licenselink = "https://github.com/athul/archie-theme/blob/master/LICENSE"
description = ""
homepage = "https://github.com/athul/archie-theme"
tags = ["blog","simple","responsive","minimal","tags","personal","clean","shortcodes"]
features = ["blog", "Clean and minimal", "Responsive", "Syntax highlighting",]
min_version = "0.41"
[author]
name = "Athul Cyriac Ajay"
homepage = "https://github.com/athul"