Fix styling and chart

This commit is contained in:
Ratan Kulshreshtha 2020-09-07 00:14:01 +05:30
parent 1e59d2d9bd
commit c009060884
22 changed files with 481 additions and 326 deletions

BIN
.DS_Store vendored

Binary file not shown.

82
.gitignore vendored
View File

@ -1,14 +1,74 @@
# Binaries for programs and plugins
*.exe
*.dll
*.so
*.dylib
# Test binary, build with `go test -c`
*.test
# Created by https://www.toptal.com/developers/gitignore/api/linux,macos,windows
# Edit at https://www.toptal.com/developers/gitignore?templates=linux,macos,windows
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
### Linux ###
*~
# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736
.glide/
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
# End of https://www.toptal.com/developers/gitignore/api/linux,macos,windows

View File

@ -57,12 +57,12 @@ access_token = "<your_access_token>"
```
## Features
- [x] Pagination
- [x] Search
- [x] Charts
- [x] Maps
- [x] Diagrams
- [x] Analytics
- [x] Comments
- [x] Categories
- [ ] Social Links
- [x] Pagination
- [x] Search
- [x] Charts
- [x] Maps
- [x] Diagrams
- [x] Analytics
- [x] Comments
- [x] Categories
- [x] Social Links

View File

@ -10,7 +10,7 @@ taxonomies = [
{ name = "tags", fees = true, paginate_by = 10 },
]
languages = []
compile_sass = false
compile_sass = true
build_search_index = true
ignored_content = []
extra_syntaxes = []

BIN
content/.DS_Store vendored

Binary file not shown.

Binary file not shown.

View File

@ -9,30 +9,13 @@ tags = ["theme", "zola"]
[extra]
toc = true
comments = false
comments = true
+++
DeepThought theme provides multiple shortcodes on top of built-in ones in Zola.
<!-- more -->
# Quote
To put a quote in your post use the below snippet
**Code**
```markdown
{%/* quote(author="Winston Churchill") */%}
Success is not final, failure is not fatal: it is the courage to continue that counts.
{%/* end */%}
```
**Output**
{% quote(author="Winston Churchill") %}
Success is not final, failure is not fatal: it is the courage to continue that counts.
{% end %}
# Mermaid
[mermaid](https://mermaidjs.github.io/) is a library helping you to generate diagram and flowcharts from text, in a similar manner as Markdown.
@ -40,6 +23,7 @@ Success is not final, failure is not fatal: it is the courage to continue that c
## Flowchart
To put a flowchart in your post use below snippet
**Code**
```
@ -64,6 +48,7 @@ C-->D;
## Sequence Diagram
To put a sequence diagram in your post use below snippet
**Code**
```
@ -100,6 +85,7 @@ Bob-->>John: Jolly good!
## Gantt diagram
To put a gantt diagram in your post use below snippet
**Code**
```
@ -132,8 +118,9 @@ Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d
{% end %}
## Class diagram - exclamation experimental
## Class diagram - experimental
To put a class diagram in your post use below snippet
**Code**
```
@ -173,8 +160,9 @@ Class01 : int gorilla
Class08 <--> C2: Cool label
{% end %}
## Git graph - exclamation experimental
## Git graph - experimental
To put a git graph in your post use below snippet
**Code**
```
@ -218,7 +206,7 @@ commit
merge newbranch
{% end %}
## Entity Relationship Diagram - exclamation experimental
## Entity Relationship Diagram - experimental
To put an ER diagram in your post use below snippet
**Code**
@ -289,17 +277,33 @@ Sit down: 5: Me
```markdown
{%/* chart() */%}
{
"type": "bar",
"data": {
"labels": ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
"datasets": [{
"label": "# of Votes",
"data": [12, 19, 3, 5, 8, 3],
"backgroundColor": ["rgba(255, 99, 132, 0.2)", "rgba(54, 162, 235, 0.2)", "rgba(255, 206, 86, 0.2)", "rgba(75, 192, 192, 0.2)", "rgba(153, 102, 255, 0.2)", "rgba(255, 159, 64, 0.2)"],
"borderColor": ["rgba(255, 99, 132, 1)", "rgba(54, 162, 235, 1)", "rgba(255, 206, 86, 1)", "rgba(75, 192, 192, 1)", "rgba(153, 102, 255, 1)", "rgba(255, 159, 64, 1)"],
"borderWidth": 1
}]
}
"type": "bar",
"data": {
"labels": ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
"datasets": [
{
"label": "# of Votes",
"data": [12, 19, 3, 5, 8, 3],
"backgroundColor": [
"rgba(255, 99, 132, 0.2)",
"rgba(54, 162, 235, 0.2)",
"rgba(255, 206, 86, 0.2)",
"rgba(75, 192, 192, 0.2)",
"rgba(153, 102, 255, 0.2)",
"rgba(255, 159, 64, 0.2)"
],
"borderColor": [
"rgba(255, 99, 132, 1)",
"rgba(54, 162, 235, 1)",
"rgba(255, 206, 86, 1)",
"rgba(75, 192, 192, 1)",
"rgba(153, 102, 255, 1)",
"rgba(255, 159, 64, 1)"
],
"borderWidth": 1
}
]
}
}
{%/* end */%}
```
@ -307,16 +311,32 @@ Sit down: 5: Me
**Output**
{% chart() %}
{
"type": "bar",
"data": {
"labels": ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
"datasets": [{
"label": "# of Votes",
"data": [12, 19, 3, 5, 8, 3],
"backgroundColor": ["rgba(255, 99, 132, 0.2)", "rgba(54, 162, 235, 0.2)", "rgba(255, 206, 86, 0.2)", "rgba(75, 192, 192, 0.2)", "rgba(153, 102, 255, 0.2)", "rgba(255, 159, 64, 0.2)"],
"borderColor": ["rgba(255, 99, 132, 1)", "rgba(54, 162, 235, 1)", "rgba(255, 206, 86, 1)", "rgba(75, 192, 192, 1)", "rgba(153, 102, 255, 1)", "rgba(255, 159, 64, 1)"],
"borderWidth": 1
}]
}
"type": "bar",
"data": {
"labels": ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
"datasets": [
{
"label": "# of Votes",
"data": [12, 19, 3, 5, 8, 3],
"backgroundColor": [
"rgba(255, 99, 132, 0.2)",
"rgba(54, 162, 235, 0.2)",
"rgba(255, 206, 86, 0.2)",
"rgba(75, 192, 192, 0.2)",
"rgba(153, 102, 255, 0.2)",
"rgba(255, 159, 64, 0.2)"
],
"borderColor": [
"rgba(255, 99, 132, 1)",
"rgba(54, 162, 235, 1)",
"rgba(255, 206, 86, 1)",
"rgba(75, 192, 192, 1)",
"rgba(153, 102, 255, 1)",
"rgba(255, 159, 64, 1)"
],
"borderWidth": 1
}
]
}
}
{% end %}

View File

@ -83,10 +83,6 @@ We have them!
---
## BlockQuotes
{% quote(author="Noam Chomsky") %}Language is a process of free creation; its laws and principles are fixed, but the manner in which the principles of generation are used is free and infinitely varied. Even the interpretation and use of words involves a process of free creation.
{% end %}
## Youtube
with `youtube(id="the_id_here")`

43
sass/site.scss Normal file
View File

@ -0,0 +1,43 @@
@import "https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;515;600;700&display=swap";
$font-stack: "Fira Code", monospace;
$link: #363636;
$link-hover: #2d96bd;
$read-more: #2d96bd;
$read-more-hover: #ef3982;
body {
font: 100% $font-stack;
display: flex;
flex-direction: column;
min-height: 100vh;
}
main {
flex: 1;
}
.center {
display: flex;
justify-content: center;
align-items: center;
}
.link {
color: $link;
&:hover {
color: $link-hover;
}
}
.read-more {
color: $read-more;
&:hover {
color: $read-more-hover;
}
}
$breakpoint-mobile: 768px;
@media (max-width: $breakpoint-mobile) {
body {
font: 85% $font-stack;
}
}

BIN
static/.DS_Store vendored

Binary file not shown.

View File

@ -1 +0,0 @@
@import "https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;515;600;700&display=swap";body{font:100% "Fira Code",monospace;display:flex;flex-direction:column;min-height:100vh}main{flex:1}.center{display:flex;justify-content:center;align-items:center}.link{color:#363636}.link:hover{color:#2d96bd}.read-more{color:#2d96bd}.read-more:hover{color:#ef3982}

BIN
static/icons/.DS_Store vendored

Binary file not shown.

Binary file not shown.

View File

@ -1,3 +1,22 @@
document.addEventListener("DOMContentLoaded", () => {
const $navbarBurgers = Array.prototype.slice.call(
document.querySelectorAll(".navbar-burger"),
0
);
if ($navbarBurgers.length > 0) {
$navbarBurgers.forEach((el) => {
el.addEventListener("click", () => {
const target = el.dataset.target;
const $target = document.getElementById(target);
el.classList.toggle("is-active");
$target.classList.toggle("is-active");
});
});
}
});
function debounce(func, wait) {
var timeout;
@ -24,7 +43,7 @@ function makeTeaser(body, terms) {
});
var termFound = false;
var index = 0;
var weighted = []; // contains elements of ["word", weight, index_in_document]
var weighted = []; // contains elements of ['word', weight, index_in_document]
// split in sentences, then words
var sentences = body.toLowerCase().split(". ");
@ -113,13 +132,13 @@ function makeTeaser(body, terms) {
function formatSearchResultItem(item, terms) {
return (
`<article class="box">` +
`<h1 class="title is-4">` +
`<a class="link" class="link" href="${item.ref}">${item.doc.title}</a>` +
`<article class='box'>` +
`<h1 class='title is-4'>` +
`<a class='link' class='link' href='${item.ref}'>${item.doc.title}</a>` +
`</h1>` +
`<div class="content mt-2">` +
`<div class='content mt-2'>` +
`${makeTeaser(item.doc.body, terms)}` +
`<a class="read-more" href="${item.ref}">` +
`<a class='read-more' href='${item.ref}'>` +
`Read More` +
`</a>` +
`</div>` +
@ -203,7 +222,7 @@ document
modal.classList.remove("is-active");
html.classList.remove("is-clipped");
});
document.querySelector(".delete").addEventListener("click", function (e) {
e.preventDefault();
modal.classList.remove("is-active");

View File

@ -1,28 +1,28 @@
{% extends "base.html" %}
{% extends 'base.html' %}
{% block main %}
<main class="hero">
<div class="hero-body">
<div class="container">
<div class="columns">
<div class="column is-three-fifths is-offset-one-fifth">
<figure class="image center mb-2">
<img class="is-rounded card" src="{{config.extra.author.avatar}}" style="max-width: 150px">
<main class='hero'>
<div class='hero-body'>
<div class='container'>
<div class='columns'>
<div class='column is-three-fifths is-offset-one-fifth'>
<figure class='image center mb-2'>
<img class='is-rounded card' src='{{config.extra.author.avatar}}' style='max-width: 150px'>
</figure>
<div class="has-text-centered">
<h1 class="title">
<div class='has-text-centered'>
<h1 class='title'>
HTTP 404
</h1>
<h2 class="subtitle">
<h2 class='subtitle'>
It seems you are looking for something that I don't have.
</h2>
<p class="is-size-4">
<p class='is-size-4'>
{{ macros:: social_links( social_config=config.extra.social) }}
</p>
</div>
<hr />
<p class="has-text-centered">
<a class="link" href="{{ config.base_url }}">
<p class='has-text-centered'>
<a class='link' href='{{ config.base_url }}'>
Home
</a>
</p>

View File

@ -1,56 +1,65 @@
{% import "macros.html" as macros %}
{% import 'macros.html' as macros %}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<meta name="theme-color" content="#ffffff">
<meta name="msapplication-TileColor" content="#da532c">
<link rel="manifest" href="{{config.extra.favicon.webmanifest}}">
<link rel="mask-icon" href="{{config.extra.favicon.safari_pinned_tab}}" color="#5bbad5" />
<link rel="icon" type="image/png" sizes="16x16" href="{{config.extra.favicon.favicon_16x16}}" />
<link rel="icon" type="image/png" sizes="32x32" href="{{config.extra.favicon.favicon_32x32}}" />
<link rel="apple-touch-icon" sizes="180x180" href="{{config.extra.favicon.apple_touch_icon}}" />
<meta name='theme-color' content='#ffffff'>
<meta name='msapplication-TileColor' content='#da532c'>
<link rel='manifest' href='{{config.extra.favicon.webmanifest}}'>
<link rel='mask-icon' href='{{config.extra.favicon.safari_pinned_tab}}' color='#5bbad5' />
<link rel='icon' type='image/png' sizes='16x16' href='{{config.extra.favicon.favicon_16x16}}' />
<link rel='icon' type='image/png' sizes='32x32' href='{{config.extra.favicon.favicon_32x32}}' />
<link rel='apple-touch-icon' sizes='180x180' href='{{config.extra.favicon.apple_touch_icon}}' />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.0/css/bulma.min.css" />
<link rel="stylesheet" href="{{ get_url(path="css/style.min.css") }}" />
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/bulma@0.9.0/css/bulma.min.css' />
<link rel='stylesheet' href='{{ get_url(path='site.css') }}' />
<title>{% block title %}{{ config.title }}{% endblock title %}</title>
{{ macros::google_analytics(gtag=config.extra.analytics.google) }}
{% if config.extra.analytics.google %}
<script src='https://www.googletagmanager.com/gtag/js?id={{ config.extra.analytics.google }}' async></script>
<script type='text/javascript'>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', '{{ config.extra.analytics.google }}');
</script>
{% endif %}
</head>
<body class="site">
<body class='site'>
{% block nav %}
<nav class="navbar is-light" role="navigation" aria-label="main navigation">
<div class="container">
<div class="navbar-brand">
<a class="navbar-item has-text-weight-bold" href="/">{{ config.title }}</a>
<a role="button" class="navbar-burger burger" aria-label="menu" aria-expanded="false"
data-target="navMenu">
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<nav class='navbar is-light' role='navigation' aria-label='main navigation'>
<div class='container'>
<div class='navbar-brand'>
<a class='navbar-item has-text-weight-bold' href='/'>{{ config.title }}</a>
<a role='button' class='navbar-burger burger' aria-label='menu' aria-expanded='false'
data-target='navMenu'>
<span aria-hidden='true'></span>
<span aria-hidden='true'></span>
<span aria-hidden='true'></span>
</a>
</div>
<div id="navMenu" class="navbar-menu">
<div class="navbar-end">
<div id='navMenu' class='navbar-menu'>
<div class='navbar-end'>
{% for item in config.extra.navbar_items %}
<a href="{{ item.url | replace(from="$BASE_URL", to=config.base_url) }}" class="navbar-item">
<a href='{{ item.url | replace(from='$BASE_URL', to=config.base_url) }}' class='navbar-item'>
{{ item.name }}
</a>
{% endfor %}
<div class="navbar-item">
<div class="field has-addons">
<div class="control">
<input id="search-dialog" class="input is-small" type="search" placeholder="Search">
<div class='navbar-item'>
<div class='field has-addons'>
<div class='control'>
<input id='search-dialog' class='input is-small' type='search' placeholder='Search'>
</div>
<div class="control">
<a class="button is-small">
<span class="icon"><i class="fas fa-search"></i></span>
<div class='control'>
<a class='button is-small'>
<span class='icon'><i class='fas fa-search'></i></span>
</a>
</div>
</div>
@ -61,30 +70,34 @@
</nav>
{% endblock %}
<div class="modal">
<div class="modal-background"></div>
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">Search</p>
<button class="delete" aria-label="close"></button>
</header>
<section class="modal-card-body">
<section class="section">
<div class="container">
<div class='modal'>
<div class='modal-background'></div>
<div class='modal-card'>
<header class='modal-card-head'>
<p class='modal-card-title'>Search</p>
<button class='delete' aria-label='close'></button>
</header>
<section class='modal-card-body'>
<div class="field">
<p class="control has-icons-right">
<input id="search" class="input" type="search" placeholder="🔎 Search the website">
<span class="icon is-small is-right">
<i class="fas fa-search"></i>
</span>
</p>
<div class='field'>
<p class='control has-icons-right'>
<input id='search' class='input' type='search' placeholder='🔎 Search the website'>
<span class='icon is-small is-right'>
<i class='fas fa-search'></i>
</span>
</p>
</div>
<div class='search-results'>
<div class='search-results__items'>
</div>
</div>
</section>
</div>
<div class="search-results">
<div class="search-results__items">
</div>
</div>
</section>
</div>
</div>
</div>
</section>
{% block header %}
{% endblock %}
@ -93,51 +106,27 @@
{% endblock %}
{% block footer %}
<footer class="footer py-4">
<div class="has-text-centered">
<footer class='footer py-4'>
<div class='has-text-centered'>
<p>
Built with <span class="icon"><i class="fas fa-code"></i></span> code and <span class="icon">
<i class="fas fa-heart"></i></span> love
Built with <span class='icon'><i class='fas fa-code'></i></span> code and <span class='icon'>
<i class='fas fa-heart'></i></span> love
<br />
<span class="has-text-weight-bold">
Powered By <span class="icon"><i class="fas fa-power-off"></i></span> Zola
<span class='has-text-weight-bold'>
Powered By <span class='icon'><i class='fas fa-power-off'></i></span> Zola
</span>
</p>
</div>
</footer>
{% endblock %}
<script src="https://kit.fontawesome.com/201b8d5e05.js" crossorigin="anonymous"></script>
<script type="text/javascript" src="{{ get_url(path="elasticlunr.min.js") }}"></script>
<script type="text/javascript" src="{{ get_url(path="search_index.en.js") }}"></script>
<script type="text/javascript" src="{{ get_url(path="js/search.js") }}"></script>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', () => {
<script src='https://kit.fontawesome.com/201b8d5e05.js' crossorigin='anonymous'></script>
<script type='text/javascript' src='{{ get_url(path='elasticlunr.min.js') }}'></script>
<script type='text/javascript' src='{{ get_url(path='search_index.en.js') }}'></script>
<script type='text/javascript' src='{{ get_url(path='js/site.js') }}'></script>
// Get all "navbar-burger" elements
const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);
// Check if there are any navbar burgers
if ($navbarBurgers.length > 0) {
// Add a click event on each of them
$navbarBurgers.forEach(el => {
el.addEventListener('click', () => {
// Get the target from the "data-target" attribute
const target = el.dataset.target;
const $target = document.getElementById(target);
// Toggle the "is-active" class on both the "navbar-burger" and the "navbar-menu"
el.classList.toggle('is-active');
$target.classList.toggle('is-active');
});
});
}
});
</script>
{% block custom_javascript %}
{% endblock %}
</body>
</html>

View File

@ -1,23 +1,23 @@
{% extends "base.html" %}
{% extends 'base.html' %}
{% block main %}
<main class="hero">
<div class="hero-body">
<div class="container">
<div class="columns">
<div class="column is-three-fifths is-offset-one-fifth">
<figure class="image center mb-2">
<img class="is-rounded card" src="{{config.extra.author.avatar}}" style="max-width: 150px">
<main class='hero'>
<div class='hero-body'>
<div class='container'>
<div class='columns'>
<div class='column is-three-fifths is-offset-one-fifth'>
<figure class='image center mb-2'>
<img class='is-rounded card' src='{{config.extra.author.avatar}}' style='max-width: 150px'>
</figure>
<div class="has-text-centered">
<h1 class="title is-size-4">{{ section.title }}</h1>
<h2 class="subtitle">{{ section.description }}</h2>
<p class="is-size-4">
<div class='has-text-centered'>
<h1 class='title is-size-4'>{{ section.title }}</h1>
<h2 class='subtitle'>{{ section.description }}</h2>
<p class='is-size-4'>
{{ macros:: social_links( social_config=config.extra.social) }}
</p>
</div>
<hr />
<div class="content has-text-justified">
<div class='content has-text-justified'>
{{section.content | safe}}
</div>
</div>

View File

@ -1,89 +1,96 @@
{% macro social_links(social_config) %}
{% if social_config.facebook %}
<a class="link" href="https://facebook.com/{{social_config.facebook}}" target="_blank">
<i class="fab fa-facebook"></i>
<a class="link" href='https://facebook.com/{{social_config.facebook}}' target='_blank'>
<span class='icon'>
<i class='fab fa-facebook'></i>
</span>
</a>
{% endif %}
{% if social_config.twitter %}
<a class="link" href="https://twitter.com/{{social_config.twitter}}" target="_blank">
<i class="fab fa-twitter"></i>
<a class="link" href='https://twitter.com/{{social_config.twitter}}' target='_blank'>
<span class='icon'>
<i class='fab fa-twitter'></i>
</span>
</a>
{% endif %}
{% if social_config.linkedin %}
<a class="link" href="https://www.linkedin.com/in/{{social_config.linkedin}}" target="_blank"><i
class="fab fa-linkedin"></i></i></a>
<a class="link" href='https://www.linkedin.com/in/{{social_config.linkedin}}' target='_blank'>
<span class='icon'>
<i class='fab fa-linkedin'></i>
</span>
</a>
{% endif %}
{% if social_config.github %}
<a class="link" href="https://github.com/{{social_config.github}}" target="_blank"><i class="fab fa-github"></i></a>
<a class="link" href='https://github.com/{{social_config.github}}' target='_blank'>
<span class='icon'>
<i class='fab fa-github'></i>
</span>
</a>
{% endif %}
{% if social_config.stackoverflow %}
<a class="link" href="https://stackoverflow.com/users/{{social_config.stackoverflow}}" target="_blank"><i
class="fab fa-stack-overflow"></i></i></a>
<a class="link" href='https://stackoverflow.com/users/{{social_config.stackoverflow}}' target='_blank'>
<span class='icon'>
<i class='fab fa-stack-overflow'></i>
</span>
</a>
{% endif %}
{% if social_config.keybase %}
<a class="link" href="https://keybase.io/{{social_config.keybase}}" target="_blank"><i class="fab fa-keybase"></i></a>
<a class="link" href='https://keybase.io/{{social_config.keybase}}' target='_blank'>
<span class='icon'>
<i class='fab fa-keybase'></i>
</span>
</a>
{% endif %}
{% endmacro %}
{% macro page_publish_metadata(page) %}
<p class="has-text-grey">
<i class="fas fa-user"></i>
<p class='has-text-grey'>
<span class='icon'>
<i class='fas fa-user'></i>
</span>
{{ config.extra.author.name }}
published on
<i class="far fa-calendar-alt"></i>
<time datetime="{{page.date}}">{{ page.date | date(format="%B %d, %Y") }}</time>
<span class='icon'>
<i class='far fa-calendar-alt'></i>
</span>
<time datetime='{{page.date}}'>{{ page.date | date(format='%B %d, %Y') }}</time>
</p>
{% endmacro %}
{% macro page_content_metadata(page) %}
<p class="has-text-grey">
<i class="far fa-clock"></i>
<p class='has-text-grey'>
<span class='icon'>
<i class='far fa-clock'></i>
</span>
{{page.reading_time}} min,
<i class="fas fa-pencil-alt"></i>
<span class='icon'>
<i class='fas fa-pencil-alt'></i>
</span>
{{page.word_count}} words
</p>
{% endmacro %}
{% macro render_categories(categories) %}
Categories:
{% for category in categories %}
<a class="link" href="{{ get_taxonomy_url(kind="categories", name=category) }}">
<span class="icon"><i class="fas fa-folder"></i></span>{{ category }}{% if not loop.last %},{% endif %}
</a>
{% endfor %}
<p>
<span class="has-text-black has-text-weight-normal">Categories:</span>
{% for category in categories %}
<a class='link has-text-weight-light' href='{{ get_taxonomy_url(kind='categories', name=category) }}'>
<span class='icon is-small'><i class='fas fa-folder fa-xs'></i></span>{{ category }}
</a>
{% endfor %}
</p>
{% endmacro %}
{% macro render_tags(tags) %}
Tags:
{% for tag in tags %}
<a class="link" href="{{ get_taxonomy_url(kind="tags", name=tag) }}">
<span class="icon"><i class="fas fa-tag"></i></span>{{ tag }}{% if not loop.last %},{% endif %}
</a>
{% endfor %}
{% endmacro %}
{% macro google_analytics(gtag) %}
<script async src="https://www.googletagmanager.com/gtag/js?id={{ gtag }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', '{{ gtag }}');
</script>
{% endmacro %}
{% macro hyvor_talk(id) %}
<div id="hyvor-talk-view"></div>
<script type="text/javascript">
var HYVOR_TALK_WEBSITE = {{ id }}; // DO NOT CHANGE THIS
var HYVOR_TALK_CONFIG = {
url: window.location.href,
id: window.btoa(encodeURIComponent(escape(window.location.href)))
};
</script>
<script async type="text/javascript" src="//talk.hyvor.com/web-api/embed"></script>
<p>
<span class="has-text-black has-text-weight-normal">Tags:</span>
{% for tag in tags %}
<a class='link has-text-weight-light' href='{{ get_taxonomy_url(kind='tags', name=tag) }}'>
<span class='icon is-small'><i class='fas fa-tag fa-xs'></i></span>{{ tag }}
</a>
{% endfor %}
</p>
{% endmacro %}

View File

@ -1,40 +1,47 @@
{% extends "base.html" %}
{% extends 'base.html' %}
{% block header %}
{% endblock %}
{% block title %}{{ config.title }} | {{ page.title }}{% endblock title %}
{% block main %}
<main class="section">
<div class="container">
<div class="columns">
<div class="column is-three-fifths is-offset-one-fifth">
<main class='section'>
<div class='container'>
<div class='columns'>
<div class='column is-three-fifths is-offset-one-fifth'>
<article>
<h1 class="title">{{ page.title }}</h1>
<h2 class="subtitle">{{ page.description }}</h2>
<h1 class='title'>{{ page.title }}</h1>
<h2 class='subtitle'>{{ page.description }}</h2>
<p>{{ macros::page_content_metadata(page=page) }}</p>
<p>{{ macros::page_publish_metadata(page=page) }}</p>
{{ macros::page_content_metadata(page=page) }}
{{ macros::page_publish_metadata(page=page) }}
{% if page.taxonomies.categories %}
<p>{{ macros::render_categories(categories=page.taxonomies.categories) }}</p>
{% endif %}
{% if page.taxonomies.tags %}
<p>{{ macros::render_tags(tags=page.taxonomies.tags) }}</p>
{% endif %}
<br />
<div class='columns'>
<div class='column'>
{% if page.taxonomies.categories %}
{{ macros::render_categories(categories=page.taxonomies.categories) }}
{% endif %}
</div>
<div class='column'>
{% if page.taxonomies.tags %}
{{ macros::render_tags(tags=page.taxonomies.tags) }}
{% endif %}
</div>
</div>
{% if page.extra.toc %}
<hr />
<div class="content">
<p class="has-text-weight-bold">Table of Contents</p>
<div class='content'>
<p class='has-text-weight-bold'>Table of Contents</p>
<ul>
{% for h1 in page.toc %}
<li>
<a href="{{h1.permalink | safe}}">{{ h1.title }}</a>
<a href='{{h1.permalink | safe}}'>{{ h1.title }}</a>
{% if h1.children %}
<ul>
{% for h2 in h1.children %}
<li>
<a href="{{h2.permalink | safe}}">{{ h2.title }}</a>
<a href='{{h2.permalink | safe}}'>{{ h2.title }}</a>
</li>
{% endfor %}
</ul>
@ -46,44 +53,44 @@
{% endif %}
<hr />
<div class="content has-text-justified">
<div class='content has-text-justified'>
{{ page.content | safe }}
</div>
</article>
<hr />
{% if page.earlier or page.later or page.lighter or page.heavier %}
<nav class="level mt-2">
<nav class='level mt-2'>
{% if page.later %}
<div class="level-item has-text-centered">
<a href="{{ page.later.permalink }}" class="button is-black is-outlined">
<span class="icon mr-2"><i
class="fas fa-arrow-circle-left"></i></span>{{ page.later.title }}
<div class='level-item has-text-centered'>
<a href='{{ page.later.permalink }}' class='button is-black is-outlined'>
<span class='icon mr-2'><i
class='fas fa-arrow-circle-left'></i></span>{{ page.later.title }}
</a>
</div>
{% endif %}
{% if page.earlier %}
<div class="level-item has-text-centered">
<a href="{{ page.earlier.permalink }}" class="button is-black is-outlined">
{{ page.earlier.title }}<span class="icon ml-2"><i
class="fas fa-arrow-circle-right"></i></span>
<div class='level-item has-text-centered'>
<a href='{{ page.earlier.permalink }}' class='button is-black is-outlined'>
{{ page.earlier.title }}<span class='icon ml-2'><i
class='fas fa-arrow-circle-right'></i></span>
</a>
</div>
{% endif %}
{% if page.heavier %}
<div class="level-item has-text-centered">
<a href="{{ page.heavier.permalink }}" class="button is-black is-outlined">
<span class="icon mr-2"><i
class="fas fa-arrow-circle-left"></i></span>{{ page.heavier.title }}
<div class='level-item has-text-centered'>
<a href='{{ page.heavier.permalink }}' class='button is-black is-outlined'>
<span class='icon mr-2'><i
class='fas fa-arrow-circle-left'></i></span>{{ page.heavier.title }}
</a>
</div>
{% endif %}
{% if page.lighter %}
<div class="level-item has-text-centered">
<a href="{{ page.lighter.permalink }}" class="button is-black is-outlined">
{{ page.lighter.title }}<span class="icon ml-2"><i
class="fas fa-arrow-circle-right"></i></span>
<div class='level-item has-text-centered'>
<a href='{{ page.lighter.permalink }}' class='button is-black is-outlined'>
{{ page.lighter.title }}<span class='icon ml-2'><i
class='fas fa-arrow-circle-right'></i></span>
</a>
</div>
{% endif %}
@ -93,10 +100,23 @@
{% endif %}
{% if page.extra.comments and config.extra.commenting.hyvor %}
<hr />
{{ macros::hyvor_talk(id=config.extra.commenting.hyvor) }}
<section id='hyvor-talk-view'></section>
{% endif %}
</div>
</div>
</div>
</main>
{% endblock main %}
{% endblock main %}
{% block custom_javascript %}
{% if page.extra.comments and config.extra.commenting.hyvor %}
<script async type='text/javascript' src='https://talk.hyvor.com/web-api/embed'></script>
<script type='text/javascript'>
var HYVOR_TALK_WEBSITE = {{ config.extra.commenting.hyvor }};
var HYVOR_TALK_CONFIG = {
url: window.location.href,
id: window.btoa(encodeURIComponent(escape(window.location.href)))
};
</script>
{% endif %}
{% endblock %}

View File

@ -1,12 +1,14 @@
{% extends "base.html" %}
{% extends 'base.html' %}
{% block title %}{{ config.title }} | {{ section.title }}{% endblock title %}
{% block header %}
<header class="hero">
<div class="hero-body">
<div class="container">
<div class="has-text-centered">
<h1 class="title">{{ section.title }}</h1>
<h2 class="subtitle">{{ section.description }}</h2>
<header class='hero'>
<div class='hero-body'>
<div class='container'>
<div class='has-text-centered'>
<h1 class='title'>{{ section.title }}</h1>
<h2 class='subtitle'>{{ section.description }}</h2>
</div>
</div>
</div>
@ -14,54 +16,60 @@
{% endblock %}
{% block main %}
<main class="section pt-0">
<div class="container">
<div class="columns">
<div class="column is-8 is-offset-2">
<main class='section pt-0'>
<div class='container'>
<div class='columns'>
<div class='column is-8 is-offset-2'>
{% if paginator %}
{% set pages = paginator.pages %}
{% else %}
{% set pages = section.pages %}
{% endif %}
{% for page in pages %}
<article class="box">
<h1 class="title is-4">
<a class="link" class="link" href="{{ page.permalink }}">
<article class='box'>
<h1 class='title is-4'>
<a class='link' class='link' href='{{ page.permalink }}'>
{{ page.title }}
</a>
</h1>
<h2 class="subtitle is-6">{{ page.description }}</h2>
<h2 class='subtitle is-6'>{{ page.description }}</h2>
<p>{{ macros::page_publish_metadata(page=page) }}</p>
<div class="content mt-2">
<div class='content mt-2'>
{{ page.summary | safe }}
<a class="read-more" href="{{ page.permalink }}">
<a class='read-more' href='{{ page.permalink }}'>
Read More
</a>
</div>
{% if page.taxonomies.categories %}
<p>{{ macros::render_categories(categories=page.taxonomies.categories) }}</p>
{% endif %}
{% if page.taxonomies.tags %}
<p>{{ macros::render_tags(tags=page.taxonomies.tags) }}</p>
{% endif %}
<div class='columns'>
<div class='column'>
{% if page.taxonomies.categories %}
{{ macros::render_categories(categories=page.taxonomies.categories) }}
{% endif %}
</div>
<div class='column'>
{% if page.taxonomies.tags %}
{{ macros::render_tags(tags=page.taxonomies.tags) }}
{% endif %}
</div>
</div>
</article>
{% endfor %}
</div>
</div>
{% if paginator.previous or paginator.next %}
<nav class="level">
<nav class='level'>
{% if paginator.previous %}
<div class="level-item has-text-centered">
<a href="{{ paginator.previous }}" class="button is-black is-outlined">
<span class="icon mr-2"><i class="fas fa-arrow-circle-left"></i></span> Previous Page
<div class='level-item has-text-centered'>
<a href='{{ paginator.previous }}' class='button is-black is-outlined'>
<span class='icon mr-2'><i class='fas fa-arrow-circle-left'></i></span> Previous Page
</a>
</div>
{% endif %}
{% if paginator.next %}
<div class="level-item has-text-centered">
<a href="{{ paginator.next }}" class="button is-black is-outlined">
Next Page <span class="icon ml-2"><i class="fas fa-arrow-circle-right"></i></span>
<div class='level-item has-text-centered'>
<a href='{{ paginator.next }}' class='button is-black is-outlined'>
Next Page <span class='icon ml-2'><i class='fas fa-arrow-circle-right'></i></span>
</a>
</div>
{% endif %}

View File

@ -1,8 +1,8 @@
<canvas id="myChart" max-height="400px"></canvas>
<div id="chart-data" style="display: none">{{body | safe }}</div>
<script src="https://cdn.jsdelivr.net/npm/chart.js@2.9.3/dist/Chart.min.js"></script>
<script>
var chartData = {{body | safe }};
<script type='text/javascript'>
var chartData = document.getElementById('chart-data').textContent;
var ctx = document.getElementById('myChart').getContext('2d');
var myChart = new Chart(ctx, chartData);
var chart = new Chart(ctx, JSON.parse(chartData));
</script>

View File

@ -1,6 +0,0 @@
<blockquote>
{{body}}<br />
{% if author %}
-- {{ author }}
{% endif %}
</blockquote>