Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/darshanbaral/mero.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarshan Baral <darshanbaral@gmail.com>2019-06-02 02:51:25 +0300
committerDarshan Baral <darshanbaral@gmail.com>2019-06-19 07:26:53 +0300
commit62ffdf049d81237d9031696f6940da2417a9e217 (patch)
treea2c53cff4d6e1280f690749c812e2de06f29813c
parent364e92fe6752dd7132678145a6da7d964153a8d7 (diff)
updated theme to allow for more sections
separate by section instead of category Added section previews in home page Added pagination to sections Added pagination to single pages Added dropdown menu Style Changes Consolidated Files Reorganized social icons Section Previews in Home Page Menu is now auto generated Updated archetype Added _index.md for sections Updated contents Metadata for pages Reorganized homepage Style updates Removal/Reorganization Reorganization Updated theme.toml
-rw-r--r--exampleSite/archetypes/default.md17
-rw-r--r--exampleSite/config.toml32
-rw-r--r--exampleSite/content/alltaxa/_index.md3
-rw-r--r--exampleSite/content/archive/_index.md3
-rw-r--r--exampleSite/content/blogs/_index.md3
-rw-r--r--exampleSite/content/blogs/blog-1.md (renamed from exampleSite/content/posts/post (6).md)16
-rw-r--r--exampleSite/content/blogs/blog-2.md (renamed from exampleSite/content/posts/post (5).md)16
-rw-r--r--exampleSite/content/post/_index.md3
-rw-r--r--exampleSite/content/post/post (1).md (renamed from exampleSite/content/posts/post (1).md)45
-rw-r--r--exampleSite/content/post/post (2).md (renamed from exampleSite/content/posts/post (2).md)16
-rw-r--r--exampleSite/content/post/post (3).md (renamed from exampleSite/content/posts/post (3).md)16
-rw-r--r--exampleSite/content/post/post (4).md (renamed from exampleSite/content/posts/post (4).md)16
-rw-r--r--layouts/_default/baseof.html9
-rw-r--r--layouts/_default/list.html54
-rw-r--r--layouts/_default/section.html26
-rw-r--r--layouts/_default/single.html62
-rw-r--r--layouts/_default/terms.html18
-rw-r--r--layouts/index.html19
-rw-r--r--layouts/partials/about.html10
-rw-r--r--layouts/partials/head.html47
-rw-r--r--layouts/partials/image-social.html10
-rw-r--r--layouts/partials/intro.html33
-rw-r--r--layouts/partials/metadata.html37
-rw-r--r--layouts/partials/metadataJS.html14
-rw-r--r--layouts/partials/navbar.html51
-rw-r--r--layouts/partials/prevNext.html28
-rw-r--r--layouts/partials/readingtime.html7
-rw-r--r--layouts/partials/recentarticles.html18
-rw-r--r--layouts/partials/taxa.html23
-rw-r--r--layouts/section/alltaxa.html4
-rw-r--r--layouts/section/archive.html41
-rw-r--r--static/css/mero.css113
-rw-r--r--static/images/post1/post1_skyline_tn.jpegbin0 -> 72931 bytes
-rw-r--r--static/js/mero.js8
-rw-r--r--theme.toml2
35 files changed, 556 insertions, 264 deletions
diff --git a/exampleSite/archetypes/default.md b/exampleSite/archetypes/default.md
index 22a7858..ceb447e 100644
--- a/exampleSite/archetypes/default.md
+++ b/exampleSite/archetypes/default.md
@@ -1,6 +1,11 @@
----
-title: "{{ replace .Name "-" " " | title }}"
-date: {{ .Date }}
-draft: true
----
-
++++
+title = ""
+date = "{{ .Date }}"
+tags = [""]
+categories = [""]
+description = ""
+draft = true
+mainImage = ""
+mainImageThumbnail = ""
+mainImageCaption = ""
++++ \ No newline at end of file
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index acfa8a2..133e2d2 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -2,39 +2,13 @@ baseURL = "http://example.org/"
languageCode = "en-us"
title = "My Blog"
theme = "mero"
+disableKinds = ["taxonomyTerm"]
[params]
+ dateFormat = "2006-01-02"
author = "Firstname Lastname"
description = "My awesome blog"
-
-[menu]
- [[menu.main]]
- identifier = "home"
- name = "Home"
- title = "home"
- url = "/"
- weight = 100
-
- [[menu.main]]
- identifier = "posts"
- name = "Posts"
- title = "posts"
- url = "/posts/"
- weight = 200
-
- [[menu.main]]
- identifier = "categories"
- name = "Categories"
- title = "categories"
- url = "/categories/"
- weight = 300
-
- [[menu.main]]
- identifier = "tags"
- name = "Tags"
- title = "tags"
- url = "/tags/"
- weight = 400
+ mainImage = "images/main.jpeg"
[params.introduction]
text = "**This website** is my blog. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
diff --git a/exampleSite/content/alltaxa/_index.md b/exampleSite/content/alltaxa/_index.md
new file mode 100644
index 0000000..4656760
--- /dev/null
+++ b/exampleSite/content/alltaxa/_index.md
@@ -0,0 +1,3 @@
++++
+title = "taxa"
++++ \ No newline at end of file
diff --git a/exampleSite/content/archive/_index.md b/exampleSite/content/archive/_index.md
new file mode 100644
index 0000000..99ef1ec
--- /dev/null
+++ b/exampleSite/content/archive/_index.md
@@ -0,0 +1,3 @@
+---
+title: "Archive"
+--- \ No newline at end of file
diff --git a/exampleSite/content/blogs/_index.md b/exampleSite/content/blogs/_index.md
new file mode 100644
index 0000000..0f9a56c
--- /dev/null
+++ b/exampleSite/content/blogs/_index.md
@@ -0,0 +1,3 @@
++++
+title= "Blogs"
++++ \ No newline at end of file
diff --git a/exampleSite/content/posts/post (6).md b/exampleSite/content/blogs/blog-1.md
index 2a4114c..0a1e207 100644
--- a/exampleSite/content/posts/post (6).md
+++ b/exampleSite/content/blogs/blog-1.md
@@ -1,9 +1,9 @@
-+++
-title = "Title of the post 6"
-date = "2018-12-15"
-tags = ["other"]
-categories = ["Category 11"]
-description = "A brief summary for the post 6."
-+++
-
++++
+title = "Title of the blog 1"
+date = "2019-01-01"
+tags = ["random"]
+categories = ["Category 1"]
+description = "A brief summary for the blog 1"
++++
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file
diff --git a/exampleSite/content/posts/post (5).md b/exampleSite/content/blogs/blog-2.md
index 736fb0c..c2f92d2 100644
--- a/exampleSite/content/posts/post (5).md
+++ b/exampleSite/content/blogs/blog-2.md
@@ -1,9 +1,9 @@
-+++
-title = "Title of the post 5"
-date = "2018-10-10"
-tags = ["other"]
-categories = ["Category 11"]
-description = "A brief summary for the post 5"
-+++
-
++++
+title = "Title of the blog 2"
+date = "2018-12-11"
+tags = ["random1", "random2"]
+categories = ["Category 11"]
+description = "A brief summary for the blog 2"
++++
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file
diff --git a/exampleSite/content/post/_index.md b/exampleSite/content/post/_index.md
new file mode 100644
index 0000000..13f12a3
--- /dev/null
+++ b/exampleSite/content/post/_index.md
@@ -0,0 +1,3 @@
++++
+title= "Posts"
++++ \ No newline at end of file
diff --git a/exampleSite/content/posts/post (1).md b/exampleSite/content/post/post (1).md
index 49e40fa..b0148a3 100644
--- a/exampleSite/content/posts/post (1).md
+++ b/exampleSite/content/post/post (1).md
@@ -1,23 +1,24 @@
-+++
-title = "Create new hugo theme"
-date = "2018-12-10"
-tags = ["tutorial"]
-categories = ["Hugo"]
-description = "A brief summary for the post 1. And this is slightly longer than the others. And this one also has three sentences. Nevermind, this one actually has four sentences."
-+++
-
-The `hugo new theme` command will scaffold the beginnings of a new theme for you to get you on your way.
-
-If you’re creating a theme with plans to share it on the Hugo Themes website please note the following: - If using inline styles you will need to use absolute URLs, for the linked assets to be served properly, e.g. `<div style="background: url('{{ "images/background.jpg" | absURL }}')">` - Make sure not to use a forward slash `/` in the beginning of a `URL`, because it will point to the host root. Your theme’s demo will be available in a subdirectory of the Hugo website and in this scenario Hugo will not generate the correct `URL` for theme assets. - If using external CSS and JS from a CDN, make sure to load these assets over `https`. Please do not use relative protocol URLs in your theme’s templates.
-
-Hugo can initialize a new blank theme directory within your existing themes using the hugo new command:
-
-```
-hugo new theme [name]
-```
-
-An image is here.
-
-{{< figure src="/images/post1/post1_skyline.jpeg" caption="Awesome Caption *Here*" >}}
-
++++
+title = "Create new hugo theme"
+date = "2019-05-10"
+tags = ["tutorial"]
+categories = ["Hugo"]
+description = "A brief summary for the post 1. And this is slightly longer than the others. And this one also has three sentences. Nevermind, this one actually has four sentences."
+mainImage = "images/post1/post1_skyline.jpeg"
+mainImageThumbnail = "images/post1/post1_skyline_tn.jpeg"
+mainImageCaption = "Awesome Caption *Here*"
++++
+
+The `hugo new theme` command will scaffold the beginnings of a new theme for you to get you on your way.
+
+If you’re creating a theme with plans to share it on the Hugo Themes website please note the following: - If using inline styles you will need to use absolute URLs, for the linked assets to be served properly, e.g. `<div style="background: url('{{ "images/background.jpg" | absURL }}')">` - Make sure not to use a forward slash `/` in the beginning of a `URL`, because it will point to the host root. Your theme’s demo will be available in a subdirectory of the Hugo website and in this scenario Hugo will not generate the correct `URL` for theme assets. - If using external CSS and JS from a CDN, make sure to load these assets over `https`. Please do not use relative protocol URLs in your theme’s templates.
+
+Hugo can initialize a new blank theme directory within your existing themes using the hugo new command:
+
+```
+hugo new theme [name]
+```
+
+An image is here.
+
If you’re creating a theme with plans to share it on the Hugo Themes website please note the following: - If using inline styles you will need to use absolute URLs, for the linked assets to be served properly, e.g. `<div style="background: url('{{ "images/background.jpg" | absURL }}')">` - Make sure not to use a forward slash `/` in the beginning of a `URL`, because it will point to the host root. Your theme’s demo will be available in a subdirectory of the Hugo website and in this scenario Hugo will not generate the correct `URL` for theme assets. - If using external CSS and JS from a CDN, make sure to load these assets over `https`. Please do not use relative protocol URLs in your theme’s templates. \ No newline at end of file
diff --git a/exampleSite/content/posts/post (2).md b/exampleSite/content/post/post (2).md
index b787436..7a1b70e 100644
--- a/exampleSite/content/posts/post (2).md
+++ b/exampleSite/content/post/post (2).md
@@ -1,9 +1,9 @@
-+++
-title = "Title of the post 2"
-date = "2018-12-11"
-tags = ["random1", "random2"]
-categories = ["Category 11"]
-description = "A brief summary for the post 2"
-+++
-
++++
+title = "Title of the post 2"
+date = "2018-12-11"
+tags = ["random1", "random2"]
+categories = ["Category 11"]
+description = "A brief summary for the post 2"
++++
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file
diff --git a/exampleSite/content/posts/post (3).md b/exampleSite/content/post/post (3).md
index 7724539..8099e3f 100644
--- a/exampleSite/content/posts/post (3).md
+++ b/exampleSite/content/post/post (3).md
@@ -1,9 +1,9 @@
-+++
-title = "Title of the post 3"
-date = "2018-12-12"
-tags = ["random"]
-categories = ["Category 1"]
-description = "A brief summary for the post 3"
-+++
-
++++
+title = "Title of the post 3"
+date = "2018-12-12"
+tags = ["random"]
+categories = ["Category 1"]
+description = "A brief summary for the post 3"
++++
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file
diff --git a/exampleSite/content/posts/post (4).md b/exampleSite/content/post/post (4).md
index 85a0892..3e78bef 100644
--- a/exampleSite/content/posts/post (4).md
+++ b/exampleSite/content/post/post (4).md
@@ -1,9 +1,9 @@
-+++
-title = "Title of the post 4"
-date = "2018-11-10"
-tags = ["random"]
-categories = ["Category 1"]
-description = "A brief summary for the post 4"
-+++
-
++++
+title = "Title of the post 4"
+date = "2018-11-10"
+tags = ["random"]
+categories = ["Category 1"]
+description = "A brief summary for the post 4"
++++
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 0a2c0e2..fc18fdb 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -1,12 +1,13 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">
{{ partial "head.html" . }}
-
- <body class="container bg-dark text-white">
+ <body class="bg-dark text-white m-auto" style="width:95%; max-width: 1024px;">
<div class="wrapper">
{{ partial "navbar.html" . }}
- {{ block "main" . }}
- {{ end }}
+ <main>
+ {{ block "main" . }}
+ {{ end }}
+ </main>
</div>
{{ partial "footer.html" . }}
</body>
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index bd8f933..f5967da 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -1,15 +1,45 @@
{{ define "main" }}
<main>
- <h1>{{ .Title }}</h1>
- <table class="table table-striped">
- {{ range .Pages }}
- <tr>
- <td>{{ .Date.Format "2006-Jan-02" }}</td>
- <td>
- <a href="{{.Permalink}}">{{.Title}}:</a> {{ .Description }}
- </td>
- </tr>
- {{ end }}
- </table>
+ <h1 class="mt-4">{{ .Title }}</h1>
+ <div class="d-flex flex-column">
+ {{ range (.Paginator 10).Pages }}
+ <div
+ class="border mt-3 mb-3 p-3 rounded position-relative"
+ >
+ <h3 class="mb-0">
+ <a href="{{ .Permalink | relURL }}" class="article-titles">
+ {{- .Title -}}
+ </a>
+ </h3>
+ <div
+ class="bg-dark pl-1 pr-1"
+ style="position: absolute; top: -1rem; left: 5px;"
+ >
+ <small>
+ <time>
+ {{- .Date.Format (default "2006-12-13" $.Site.Params.dateFormat) -}}
+ </time>
+ </small>
+ <span
+ class="more"
+ style="font-size: 1.2em;"
+ title="Show Metadata"
+ onclick="showMetadata(this)"
+ >
+ &#43;
+ </span>
+ </div>
+ {{ partial "metadata" . }}
+
+ {{ if .Params.Description }}
+ <p class="mt-2 mb-0 ml-2">{{ .Params.Description }}</p>
+ {{ end }}
+ </div>
+ {{ end }}
+ </div>
+ <div class="d-flex justify-content-center">
+ {{ template "_internal/pagination.html" . }}
+ </div>
</main>
-{{ end }} \ No newline at end of file
+{{ partial "metadataJS" . }}
+{{ end }}
diff --git a/layouts/_default/section.html b/layouts/_default/section.html
deleted file mode 100644
index 3d1de63..0000000
--- a/layouts/_default/section.html
+++ /dev/null
@@ -1,26 +0,0 @@
-{{ define "main" }}
-<main>
- <div class="row row-eq-height">
- {{ $sectionName := .Title | lower }}
- {{ range $key, $taxonomy := .Site.Taxonomies.categories.ByCount }}
- <div class="col-md-6 mt-3">
- <h2>
- <a href="/categories/{{ .Name }}/">
- {{ .Name }}
- </a>
- </h2>
- <div class="border rounded p-2">
- {{ range where $taxonomy.Pages.ByDate "Type" $sectionName }}
- <h4 class="ml-2">
- <a href="{{ .Permalink }}">
- {{ .Title }}
- </a>
- </h4>
- <p class="ml-4">{{ .Description }}</p>
- {{ end }}
- </div>
- </div>
- {{ end }}
- </div>
-</main>
-{{ end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 4389b5b..697d5a8 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -1,28 +1,44 @@
{{ define "main" }}
-<main>
- <h1>
- <u>{{ .Title }}</u>
- </h1>
- <ul class="list-inline">
- <li class="list-inline-item">
- {{ .Date.Format "2006-Jan-02" }}
- </li>
- <a href="/tags/">
- <i class="fas fa-tags"></i>
- </a>
- {{ range.Params.tags }}
- <li class="list-inline-item">
- <a href="/tags/{{ . }}/">
- {{ . }}
+<article class="border rounded p-3 position-relative" style="margin-top: 2.5em;">
+ <div class="header">
+ <h1 style="font-size: 2.5em;">
+ {{ .Title }}
+ </h1>
+ <div
+ class="mb-1 mr-3 pl-1 pr-1 rounded bg-dark"
+ style="position: absolute; top: -19px; font-size: 0.9em;"
+ >
+ <time>
+ {{- .Date.Format (default "January 2, 2006" $.Site.Params.dateFormat) -}}
+ </time>
+ <span
+ class="more"
+ style="font-size: 1.5em;"
+ title="Show Metadata"
+ onclick="showMetadata(this)"
+ >
+ &#43;
+ </span>
+ </div>
+ {{- partial "metadata" . -}}
+ </div>
+ <div class="article pb-3 pt-3 border-bottom border-top">
+ {{ if .Params.mainImage }}
+ <figure>
+ <a href="{{ .Params.mainImage | relURL }}">
+ <img
+ src="{{ .Params.mainImageThumbnail | relURL }}"
+ alt="{{ .Params.mainImageCaption | markdownify }}"
+ />
</a>
- </li>
+ <figcaption>
+ {{ .Params.mainImageCaption | markdownify }}
+ </figcaption>
+ </figure>
{{ end }}
- </ul>
-
- <div>
- <article id="content">
- {{ .Content }}
- </article>
+ {{ .Content }}
</div>
-</main>
+ {{ partial "prevNext" . }}
+</article>
+{{ partial "metadataJS" . }}
{{ end }}
diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html
deleted file mode 100644
index 54e0b29..0000000
--- a/layouts/_default/terms.html
+++ /dev/null
@@ -1,18 +0,0 @@
-{{ define "main" }}
-<main>
- <h1 id="title">{{ .Title }}</h1>
- <div class="d-flex flex-row flex-wrap mb-3">
- {{ $data := .Data }}
- {{ range $key, $value := .Data.Terms }}
- <div class="p-1 border rounded m-1">
- <h3 class="m-0">
- <a href="/{{ $data.Plural }}/{{ $key | urlize }}">
- {{ $key }}
- </a>
- </h3>
- <p class="ml-2">{{ len $value }} posts.</p>
- </div>
- {{ end }}
- </div>
-</main>
-{{ end }}
diff --git a/layouts/index.html b/layouts/index.html
index ce0b696..b4deed2 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -1,5 +1,16 @@
{{ define "main" }}
-<main>
- {{ partial "intro.html" . }}
-</main>
-{{ end }} \ No newline at end of file
+<div class="d-flex flex-row flex-wrap justify-content-around">
+ <div class="mt-4 home-flex-item" style="width: calc(35% - 20px); min-width: 250px;">
+ {{ partial "image-social" . }}
+ </div>
+
+ <div class="home-flex-item mt-4" style="width: calc(65% - 20px);">
+ <div class="position-relative border rounded p-2" style="margin-bottom: 40px;">
+ {{ partial "about" . }}
+ </div>
+ <div class="home-flex-item position-relative p-2 border rounded text-center">
+ {{ partial "recentarticles" . }}
+ </div>
+ </div>
+</div>
+{{ end }}
diff --git a/layouts/partials/about.html b/layouts/partials/about.html
new file mode 100644
index 0000000..4eefe10
--- /dev/null
+++ b/layouts/partials/about.html
@@ -0,0 +1,10 @@
+<h4
+ class="pl-2 pr-2 bg-dark rounded border"
+ style="position: absolute; top: -1rem; right: 0.5em;"
+>
+ <b>About</b>
+</h4>
+<h1>I am {{ .Site.Params.author }}.</h1>
+<p>
+ {{- .Site.Params.introduction.text | markdownify -}}
+</p>
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 3f8cacb..4294bb3 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -4,55 +4,24 @@
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
<meta name="description" content="{{ .Site.Params.description }}" />
<meta name="author" content="{{ .Site.Params.author }}" />
+ {{- $hugoGenerator := index (findRE `content=\"(.+)\"` hugo.Generator) 0 }}
+ <meta name="generator" content="mero theme by Darshan in {{ replaceRE `content=|\"` `` $hugoGenerator }}" />
<link
rel="stylesheet"
- href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
+ href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
+ integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
+ crossorigin="anonymous"
/>
<link
rel="stylesheet"
href="https://use.fontawesome.com/releases/v5.5.0/css/all.css"
/>
<link
- href="https://fonts.googleapis.com/css?family=Overlock"
+ href="https://fonts.googleapis.com/css?family=Overlock|Roboto+Mono&display=swap"
rel="stylesheet"
/>
+ <link rel="stylesheet" href="{{ `css/mero.css` | relURL }}" />
- <script>
- setColors = function() {
- let images = document.querySelectorAll("img");
- images.forEach(elem => elem.classList.add("img-fluid", "rounded"));
-
- let imagecaption = document.querySelectorAll("figcaption");
- imagecaption.forEach(elem => elem.classList.add("initialism"));
- };
- window.onload = setColors;
- </script>
-
- <style>
- html,
- body {
- height: 100%;
- }
- .wrapper {
- min-height: 100%;
- margin-bottom: -100px;
- padding-bottom: 100px;
- }
- footer {
- height: 100px;
- }
- a {
- color: #ffc107 !important;
- }
- code {
- color: #17a2b8 !important;
- }
- a:hover {
- text-decoration: none;
- }
- * {
- font-family: "Overlock", cursive;
- }
- </style>
+ <script src="{{ `js/mero.js` | relURL }}"></script>
</head>
diff --git a/layouts/partials/image-social.html b/layouts/partials/image-social.html
new file mode 100644
index 0000000..26947f0
--- /dev/null
+++ b/layouts/partials/image-social.html
@@ -0,0 +1,10 @@
+<img class="w-100 rounded mb-2" src="{{ `/images/main.jpeg` | relURL }}" />
+<div class="d-flex justify-content-center mt-2">
+ {{ range .Site.Params.social.list }}
+ <div class="ml-1 mr-1" style="width: 40px; height: 40px;">
+ <a href="{{ .url }}">
+ <i class="social-icon {{ .class }} {{ .icon }}"></i>
+ </a>
+ </div>
+ {{ end }}
+</div>
diff --git a/layouts/partials/intro.html b/layouts/partials/intro.html
deleted file mode 100644
index 6104e3b..0000000
--- a/layouts/partials/intro.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<div class="row row-eq-height">
- <div class="col-md-4 mt-2">
- <img class="w-100 rounded" src={{ "./images/main.jpeg" | absURL }}>
- <div class="mt-1 text-center">
- {{ range.Site.Params.social.list }}
- <span class="ml-1 mr-1" style="font-size: 2em;">
- <a href="{{ .url }}">
- <i class="{{ .class }} {{ .icon }}"></i>
- </a>
- </span>
- {{ end }}
- </div>
- </div>
-
- <div class="col-md-8 p-2">
- <h1>I am {{ .Site.Params.author }}.</h1>
- {{ .Site.Params.introduction.text | markdownify }}
- <div class="mt-4 bg-dark border-top p-2 text-center">
- <h4>
- <b>Recent Posts</b> |
- <small
- ><a href="./posts"><i>See All</i></a></small
- >
- </h4>
- {{ range where .Pages "Type" "posts" | first 4}}
- <a class="list-entry-link text-uppercase" href="{{ .Permalink }}">
- {{ .Title }}
- </a>
- <p class="ml-4">{{ .Description }}</p>
- {{ end }}
- </div>
- </div>
-</div>
diff --git a/layouts/partials/metadata.html b/layouts/partials/metadata.html
new file mode 100644
index 0000000..830f223
--- /dev/null
+++ b/layouts/partials/metadata.html
@@ -0,0 +1,37 @@
+<div class="m-2 metadata overflow-hidden" style="max-height: 0px;">
+ {{ if ne $.Kind "section" }}
+ <div class="metadata-value mb-1 taxa taxa-container-div list-sections">
+ <div>
+ Reading Time: {{ partial "readingtime" . }}
+ </div>
+ <div>
+ Section:
+ <a
+ class="pl-1 pr-1 rounded border border-secondary"
+ href="{{ .Section | relURL }}"
+ title="Section"
+ >
+ {{- (.Site.GetPage .Section).Title -}}
+ </a>
+ </div>
+ </div>
+ {{ end }}
+
+ {{ $params := .Params }}
+ {{ range $name, $value := .Site.Taxonomies }}
+ {{ if index $params $name }}
+ <div class="metadata-value mb-1 taxa taxa-container-div list-{{- $name -}}">
+ {{ $name | humanize }}:
+ {{ range index $params $name }}
+ <a
+ class="pl-1 pr-1 rounded border border-secondary"
+ href="{{ $name | relURL }}/{{ . | urlize }}"
+ title="{{ $name }}"
+ >
+ {{- . -}}
+ </a>
+ {{ end }}
+ </div>
+ {{ end }}
+ {{ end }}
+</div>
diff --git a/layouts/partials/metadataJS.html b/layouts/partials/metadataJS.html
new file mode 100644
index 0000000..e7b5029
--- /dev/null
+++ b/layouts/partials/metadataJS.html
@@ -0,0 +1,14 @@
+<script>
+ let showMetadata = function(x) {
+ let elem = x.parentNode.nextElementSibling;
+ if (window.getComputedStyle(elem)["height"] === "0px") {
+ elem.style.maxHeight = elem.scrollHeight + "px";
+ x.innerHTML = "&times;";
+ x.title = "Hide Metadata";
+ } else {
+ elem.style.maxHeight = "0px";
+ x.innerHTML = "&#43;";
+ x.title = "Show Metadata";
+ }
+ };
+</script>
diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html
index 27d3c83..00d5c62 100644
--- a/layouts/partials/navbar.html
+++ b/layouts/partials/navbar.html
@@ -1,7 +1,44 @@
-<div class="btn-group mt-2 mb-4">
- {{ range.Site.Menus.main }}
- <a href="{{ .URL }}" class="border-warning bg-dark btn"
- ><span>{{ .Name }}</span>
- </a>
- {{ end }}
-</div>
+<nav class="mb-3 mt-3 ml-1">
+ <div class="d-flex flex-row">
+ <div class="menu-item">
+ <a
+ href="{{ `/` | relURL }}"
+ class="border border-warning bg-dark p-2"
+ style="border-top-left-radius: 10px; border-bottom-left-radius: 10px;"
+ ><span>Home</span>
+ </a>
+ </div>
+ <div class="menu-item dropdown">
+ <span class="dropbtn border border-warning bg-dark p-2 text-warning"
+ >Sections <i class="fas fa-angle-down"></i
+ ></span>
+ <div class="dropdown-content p-2 bg-dark2 mt-2 rounded w-auto mt-1" style="min-width: 200px;">
+ <ul class="list-unstyled">
+ {{ range .Site.Sections.ByWeight }}
+ {{ $thisSection := replace .File.Dir "\\" "" }}
+ {{ if not (in (slice "alltaxa" "archive") $thisSection) }}
+ <li class="pt-2">
+ <a href="{{ .Permalink }}">{{ .Title }}</a>
+ </li>
+ {{ end }}
+ {{ end }}
+ </ul>
+ </div>
+ </div>
+ <div class="menu-item">
+ <a
+ href="{{ `/alltaxa/` | relURL }}"
+ class="border border-warning bg-dark p-2"
+ ><span>Taxa</span>
+ </a>
+ </div>
+ <div class="menu-item">
+ <a
+ href="{{ `/archive/` | relURL }}"
+ class="border border-warning bg-dark p-2"
+ style="border-top-right-radius: 10px; border-bottom-right-radius: 10px;"
+ ><span>Archive</span>
+ </a>
+ </div>
+ </div>
+</nav>
diff --git a/layouts/partials/prevNext.html b/layouts/partials/prevNext.html
new file mode 100644
index 0000000..cdf21cb
--- /dev/null
+++ b/layouts/partials/prevNext.html
@@ -0,0 +1,28 @@
+<div class="mt-4 d-flex flex-row justify-content-around">
+ {{- if .NextInSection }}
+ <div>
+ <a
+ href="{{ .NextInSection.Permalink | relURL }}"
+ data-toggle="tooltip"
+ data-placement="top"
+ title="{{ .NextInSection.Title }}"
+ ><i class="fas fa-chevron-circle-left" style="font-size: 2em;"></i></a
+ >
+ </div>
+ {{- else }}
+ <div><i class="text-secondary fas fa-chevron-circle-left" style="font-size: 2em;"></i></div>
+ {{- end }}
+ {{- if .PrevInSection }}
+ <div>
+ <a
+ href="{{ .PrevInSection.Permalink | relURL }}"
+ data-toggle="tooltip"
+ data-placement="top"
+ title="{{ .PrevInSection.Title }}"
+ ><i class="fas fa-chevron-circle-right" style="font-size: 2em;"></i></a
+ >
+ </div>
+ {{- else }}
+ <div><i class="text-secondary fas fa-chevron-circle-right" style="font-size: 2em;"></i></div>
+ {{- end }}
+</div>
diff --git a/layouts/partials/readingtime.html b/layouts/partials/readingtime.html
new file mode 100644
index 0000000..132f979
--- /dev/null
+++ b/layouts/partials/readingtime.html
@@ -0,0 +1,7 @@
+{{ if lt .ReadingTime 1 }}
+< 1 min
+{{ else if eq .ReadingTime 1 }}
+1 min
+{{ else }}
+{{ .ReadingTime }} mins
+{{ end }} \ No newline at end of file
diff --git a/layouts/partials/recentarticles.html b/layouts/partials/recentarticles.html
new file mode 100644
index 0000000..e322dac
--- /dev/null
+++ b/layouts/partials/recentarticles.html
@@ -0,0 +1,18 @@
+<h4
+ class="pl-2 pr-2 bg-dark rounded border"
+ style="position: absolute; top: -0.7em; left: 0.5em;"
+>
+ <b>Recent</b>
+</h4>
+
+<div class="pt-2">
+ {{ range first 4 (where .Site.Pages "Kind" "page").ByDate.Reverse }}
+ <a class="ml-1 list-entry-link text-uppercase" href="{{ .Permalink }}">
+ {{ .Title }}
+ </a>
+ <p class="ml-2 mb-1">{{ .Description }}</p>
+ {{ end }}
+ <p class="text-right m-0">
+ <a href="{{ `/archive/` | relURL }}">See All</a>
+ </p>
+</div>
diff --git a/layouts/partials/taxa.html b/layouts/partials/taxa.html
new file mode 100644
index 0000000..38eae3a
--- /dev/null
+++ b/layouts/partials/taxa.html
@@ -0,0 +1,23 @@
+{{ $scratch := newScratch }}
+{{ $scratch.Delete "custom" }}
+{{ $flag := .showAll }}
+
+{{ range $name, $value := .this }}
+{{ $scratch.Add "custom" (slice (dict "Name" $name "Value" $value "Num" (len $value))) }}
+{{ end }}
+
+{{ range sort ($scratch.Get "custom") ".Num" "desc" }}
+<h4>
+ {{ .Name | humanize }}{{if $flag }}<small class="badge">({{ .Num }})</small
+ >{{ end }}
+</h4>
+{{ $nn := cond $flag .Num 15 }}
+{{ $ap := index $.this .Name }}
+<div class="d-flex flex-row flex-wrap ml-2">
+ {{ range first $nn $ap.ByCount }}
+ <div class="m-2 p-2 btn btn-dark shadow border border-light">
+ <a href="{{ .Page.Permalink }}">{{ .Page.Title }}</a><small class="badge">{{ .Count }}</small>
+ </div>
+ {{ end }}
+</div>
+{{ end }} \ No newline at end of file
diff --git a/layouts/section/alltaxa.html b/layouts/section/alltaxa.html
new file mode 100644
index 0000000..5d9ae3e
--- /dev/null
+++ b/layouts/section/alltaxa.html
@@ -0,0 +1,4 @@
+{{ define "main" }}
+<h1 class="mt-4">All Taxa</h1>
+{{ partial "taxa" (dict "this" $.Site.Taxonomies "showAll" true "heading" "All Taxa") }}
+{{ end }} \ No newline at end of file
diff --git a/layouts/section/archive.html b/layouts/section/archive.html
new file mode 100644
index 0000000..e05778f
--- /dev/null
+++ b/layouts/section/archive.html
@@ -0,0 +1,41 @@
+{{ define "main" }}
+{{- $paginator := .Paginate (where .Site.Pages "Kind" "page").ByDate.Reverse 20 }}
+<h1 class="h1 mt-4">{{ .Title }}</h1>
+<table class="shadow table table-dark table-striped table-sm">
+ <thead class="thead-dark">
+ <tr>
+ <th class="pt-2 pb-2" scope="col">Title</th>
+ <th class="pt-2 pb-2" scope="col" style="width: 100px;">Date</th>
+ </tr>
+ </thead>
+ <tbody class="archive-list">
+ {{ range $paginator.Pages }}
+ <tr class="archive-entries">
+ <td>
+ <p class="m-0">
+ <a href="{{ .Permalink | relURL }}" title="{{ .Params.description }}">
+ {{- .Title -}}
+ </a>
+ <span
+ class="more"
+ style="font-size: 1.2em;"
+ title="Show Metadata"
+ onclick="showMetadata(this)"
+ >
+ &#43;
+ </span>
+ </p>
+ {{- partial "metadata" . -}}
+ </td>
+ <td>
+ <time>
+ {{- .Date.Format (default "January 2, 2006" "Jan 2, 2006") -}}
+ </time>
+ </td>
+ </tr>
+ {{ end }}
+ </tbody>
+</table>
+{{ partial "metadataJS" . }}
+{{ template "_internal/pagination.html" . }}
+{{ end }}
diff --git a/static/css/mero.css b/static/css/mero.css
new file mode 100644
index 0000000..f5ecef6
--- /dev/null
+++ b/static/css/mero.css
@@ -0,0 +1,113 @@
+html,
+body {
+ height: 100%;
+}
+.wrapper {
+ min-height: 100%;
+ margin-bottom: -100px;
+ padding-bottom: 100px;
+}
+footer {
+ height: 100px;
+}
+a {
+ color: #ffc107 !important;
+}
+a:hover {
+ color: #a57e09 !important;
+}
+code {
+ font-family: "Roboto Mono", monospace;
+ color: #04dac6 !important;
+}
+a:hover {
+ text-decoration: none;
+}
+* {
+ font-family: "Overlock", cursive;
+}
+.bg-dark,
+.btn-dark {
+ background-color: rgb(37, 36, 36) !important;
+}
+.bg-dark2 {
+ background-color: #37393a !important;
+}
+.social-icon {
+ font-size: 1.7em;
+}
+.social-icon:hover {
+ font-size: 1.6em;
+}
+.menu-item {
+ font-size: 1em;
+}
+.shadow {
+ box-shadow: 0px 8px 9px 0px rgba(0, 0, 0, 0.75) !important;
+}
+.dropbtn:hover {
+ cursor: pointer;
+ color: #a57e09 !important;
+}
+.dropdown-content {
+ display: none;
+ position: absolute;
+ white-space: nowrap;
+ box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
+ z-index: 1;
+}
+.dropdown {
+ cursor: pointer;
+ position: relative !important;
+ display: inline-block !important;
+}
+.dropdown:hover {
+ box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
+}
+.dropdown:hover .dropdown-content {
+ display: block;
+}
+.page-link {
+ background-color: #262b30 !important;
+}
+.page-item.active .page-link {
+ border-color: #ffc107 !important;
+ background-color: #ffc107 !important;
+ color: black !important;
+}
+.page-item.disabled .page-link {
+ color: #4d4d4d !important;
+}
+.more {
+ color: #ffc107 !important;
+}
+.more:hover {
+ cursor: pointer;
+}
+.metadata {
+ transition: all 0.25s;
+}
+.metadata-value {
+ font-size: 0.8em;
+}
+.pagination {
+ display: flex;
+ justify-content: center;
+}
+@media only screen and (max-width: 750px) {
+ .home-flex-item {
+ width: 100% !important;
+ }
+}
+h1 {
+ font-size: 2.1rem;
+}
+h2 {
+ font-size: 1.8rem;
+}
+h3 {
+ font-size: 1.5rem;
+}
+h4 {
+ font-size: 1.2rem;
+}
diff --git a/static/images/post1/post1_skyline_tn.jpeg b/static/images/post1/post1_skyline_tn.jpeg
new file mode 100644
index 0000000..767b6fe
--- /dev/null
+++ b/static/images/post1/post1_skyline_tn.jpeg
Binary files differ
diff --git a/static/js/mero.js b/static/js/mero.js
new file mode 100644
index 0000000..0746922
--- /dev/null
+++ b/static/js/mero.js
@@ -0,0 +1,8 @@
+setColors = function() {
+ let images = Array.from(document.querySelectorAll("img"));
+ images.forEach(elem => elem.classList.add("img-fluid", "rounded"));
+
+ let imagecaption = Array.from(document.querySelectorAll("figcaption"));
+ imagecaption.forEach(elem => elem.classList.add("initialism"));
+};
+window.onload = setColors;
diff --git a/theme.toml b/theme.toml
index 2405102..adca751 100644
--- a/theme.toml
+++ b/theme.toml
@@ -5,7 +5,7 @@ description = "Theme for personal blogs"
homepage = "https://github.com/darshanbaral/mero"
tags = ["Personal", "Blog", "Dark"]
features = ["Responsive"]
-min_version = "0.41"
+min_version = "0.55"
[author]
name = "Darshan Baral"