first commit
This commit is contained in:
commit
379b9d1a62
24 files changed
+3828
No files matched your search
@@ -0,0 +1,13 @@
|
||||
article.post
|
||||
header: h1 Write a post!
|
||||
.post-content
|
||||
p Go to <code>./src/pages/p</code> folder and create your first post, creating <code>first-post.md</code> file filled with the following content:
|
||||
pre.
|
||||
---
|
||||
title: First post
|
||||
tags:
|
||||
- news
|
||||
---
|
||||
# This is my first post!
|
||||
p Any questions? More info: <a href="https://github.com/codemotion/cogear-template-blog">https://github.com/codemotion/cogear-template-blog</a>
|
||||
a(href="https://cogearjs.org"): img(src="https://cogearjs.org/images/cogearjs.jpg")
|
||||
@@ -0,0 +1,13 @@
|
||||
head
|
||||
title=title
|
||||
link(rel="shortcut icon" href=`${cogear.config.baseUrl || "/"}favicon.ico` type="image/png")
|
||||
body
|
||||
.navbar
|
||||
.container
|
||||
.brand
|
||||
a(href="/") Blog
|
||||
if cogear.blog.tags
|
||||
ul
|
||||
each t in cogear.blog.tags
|
||||
- tName = t[0].toUpperCase() + t.slice(1)
|
||||
li: a(href=`/tags/${t}`)= tName
|
||||
@@ -0,0 +1,21 @@
|
||||
mixin post(post)
|
||||
.card.p-2.post(class=`${post.teaser ? 'teaser' : 'full'}`)
|
||||
.post-meta.mb-3
|
||||
.float-right
|
||||
+date(post.date)
|
||||
.post-meta--author
|
||||
a(href=`${post.author.link}`): img.mr-3(src=`${post.author.avatar}`)
|
||||
a(href=`${post.author.link}`)= post.author.login
|
||||
header
|
||||
if post.teaser
|
||||
h2: a(href=`/${post.uri}`)= post.title
|
||||
else
|
||||
h1= post.title
|
||||
.post-content!= post.teaser ? post.teaser : post.content
|
||||
if !post.teaser
|
||||
a(href="javascript: history.back()") ← Back
|
||||
mixin date(date)
|
||||
- let months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
|
||||
- let d = new Date(date)
|
||||
- month = months[d.getMonth()]
|
||||
time= `${month} ${d.getDate()}`
|
||||
@@ -0,0 +1,21 @@
|
||||
extends layout.pug
|
||||
block head
|
||||
if tag
|
||||
- tagName = tag[0].toUpperCase() + tag.slice(1)
|
||||
- title= `${tagName} | ${title}`
|
||||
if paginator && paginator.current > 1
|
||||
- title = `Page ${paginator.current} | ${title}`
|
||||
title= title
|
||||
block content
|
||||
if tag
|
||||
h1.tag= tagName
|
||||
if content
|
||||
article.page!= content
|
||||
else if posts
|
||||
- let now = new Date()
|
||||
each post in posts
|
||||
if new Date(post.date) < now
|
||||
+post(post)
|
||||
include paginator
|
||||
else
|
||||
include includes/empty
|
||||
@@ -0,0 +1,20 @@
|
||||
include includes/mixins
|
||||
head
|
||||
block head
|
||||
title= title
|
||||
meta(content="width=device-width, height=device-height, initial-scale=1, minimum-scale=1.0, maximum-scale=1" name="viewport")
|
||||
link(rel="shortcut icon" href=`${cogear.config.baseUrl || "/"}favicon.png` type="image/png")
|
||||
link(rel='stylesheet' href='https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css' integrity='sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T' crossorigin='anonymous')
|
||||
body
|
||||
nav.navbar.navbar-dark.bg-success
|
||||
a.ml-3.navbar-brand(href=cogear.config.baseUrl || "/")= cogear.config.blog.title || "BLOG"
|
||||
.container.mt-3
|
||||
.row
|
||||
.col-lg-8.col-md-12
|
||||
block content
|
||||
.col-lg-4.col-md-12
|
||||
include sidebar
|
||||
|
||||
script(src='https://code.jquery.com/jquery-3.3.1.slim.min.js' integrity='sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo' crossorigin='anonymous')
|
||||
script(src='https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js' integrity='sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1' crossorigin='anonymous')
|
||||
script(src='https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js' integrity='sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM' crossorigin='anonymous')
|
||||
@@ -0,0 +1,23 @@
|
||||
if paginator
|
||||
nav.mt-3
|
||||
ul.pagination
|
||||
if paginator.prev !== null
|
||||
li.page-item
|
||||
a.page-link(href=`${cogear.config.baseUrl || "/"}${paginator.prev}`) ← Prev
|
||||
- let page = 1
|
||||
while page <= paginator.total
|
||||
- let range = 2
|
||||
if page == 1 || page == paginator.total || (page >= paginator.current - range && page <= paginator.current + range)
|
||||
if page == paginator.current
|
||||
li.page-item.active
|
||||
a.page-link(href=`${paginator.baseUri}/${page}`)= page
|
||||
else
|
||||
li.page-item
|
||||
a.page-link(href=`${paginator.baseUri}/${page}`)= page
|
||||
else if paginator.current < paginator.total - range && page == paginator.total - 1 || paginator.current > 1+range && page == range
|
||||
li.page-item
|
||||
a.page-link.ellipsis …
|
||||
- page=page+1
|
||||
if paginator.next !== null
|
||||
li.page-item
|
||||
a.page-link(href=`/${paginator.next}`) Next →
|
||||
@@ -0,0 +1,12 @@
|
||||
extends layout.pug
|
||||
block content
|
||||
+post({
|
||||
title:title,
|
||||
teaser: false,
|
||||
tags:tags,
|
||||
content:content,
|
||||
date:date,
|
||||
author: author
|
||||
})
|
||||
|
||||
#disqus_thread
|
||||
@@ -0,0 +1,7 @@
|
||||
aside.card.p-3
|
||||
block sidebar
|
||||
:markdown-it
|
||||
#### Record my journey to Chinese by [@polvcode](https://polvcode.dev)
|
||||
|
||||
a.twitter-timeline(href="https://twitter.com/ChinesePol" data-height="600") Tweets by ChinesePol
|
||||
script(async src="https://platform.twitter.com/widgets.js" charset="utf-8")
|
||||
Reference in new issue
Block a user