Initial commit
Initial commit with lektor: ```bash lektor quickstart ```
This commit is contained in:
commit
b9bbd07e6e
16 changed files with 221 additions and 0 deletions
42
assets/static/style.css
Normal file
42
assets/static/style.css
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
body {
|
||||||
|
font-family: 'Verdana', sans-serif;
|
||||||
|
margin: 50px 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: #2a99b6;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
color: #33bbdf;
|
||||||
|
}
|
||||||
|
|
||||||
|
header, footer, div.page {
|
||||||
|
width: 760px;
|
||||||
|
margin: 0 auto;
|
||||||
|
background: #daeef3;
|
||||||
|
padding: 20px 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
header h1 {
|
||||||
|
color: #169bbd;
|
||||||
|
margin: 0;
|
||||||
|
font-weight: normal;
|
||||||
|
font-size: 42px;
|
||||||
|
}
|
||||||
|
|
||||||
|
header nav ul {
|
||||||
|
list-style: none;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
header nav ul li {
|
||||||
|
display: inline;
|
||||||
|
margin: 0 8px 0 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.page {
|
||||||
|
background: #f1fbfe;
|
||||||
|
}
|
2
c3woc-podcast.lektorproject
Normal file
2
c3woc-podcast.lektorproject
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
[project]
|
||||||
|
name = c3woc-podcast
|
7
content/about/contents.lr
Normal file
7
content/about/contents.lr
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
title: About this Website
|
||||||
|
---
|
||||||
|
body:
|
||||||
|
|
||||||
|
This is a website that was made with the Lektor quickstart.
|
||||||
|
|
||||||
|
And it does not contain a lot of information.
|
3
content/blog/contents.lr
Normal file
3
content/blog/contents.lr
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
_model: blog
|
||||||
|
---
|
||||||
|
title: Blog
|
9
content/blog/first-post/contents.lr
Normal file
9
content/blog/first-post/contents.lr
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
title: Hello Website
|
||||||
|
---
|
||||||
|
pub_date: 2019-05-25
|
||||||
|
---
|
||||||
|
author: L3D
|
||||||
|
---
|
||||||
|
body:
|
||||||
|
|
||||||
|
This is an example blog post. Not much here but that's not the point :)
|
6
content/contents.lr
Normal file
6
content/contents.lr
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
title: Welcome to c3woc-podcast!
|
||||||
|
---
|
||||||
|
body:
|
||||||
|
|
||||||
|
This is a basic demo website that shows how to use Lektor for a basic
|
||||||
|
website with some pages and a blog.
|
9
content/projects/contents.lr
Normal file
9
content/projects/contents.lr
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
title: Projects
|
||||||
|
---
|
||||||
|
body:
|
||||||
|
|
||||||
|
This is a list of the projects:
|
||||||
|
|
||||||
|
* Project 1
|
||||||
|
* Project 2
|
||||||
|
* Project 3
|
29
models/blog-post.ini
Normal file
29
models/blog-post.ini
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
[model]
|
||||||
|
name = Blog Post
|
||||||
|
label = {{ this.title }}
|
||||||
|
hidden = yes
|
||||||
|
|
||||||
|
[fields.title]
|
||||||
|
label = Title
|
||||||
|
type = string
|
||||||
|
size = large
|
||||||
|
|
||||||
|
[fields.author]
|
||||||
|
label = Author
|
||||||
|
type = string
|
||||||
|
width = 1/2
|
||||||
|
|
||||||
|
[fields.twitter_handle]
|
||||||
|
label = Twitter Handle
|
||||||
|
type = string
|
||||||
|
width = 1/4
|
||||||
|
addon_label = @
|
||||||
|
|
||||||
|
[fields.pub_date]
|
||||||
|
label = Publication date
|
||||||
|
type = date
|
||||||
|
width = 1/4
|
||||||
|
|
||||||
|
[fields.body]
|
||||||
|
label = Body
|
||||||
|
type = markdown
|
16
models/blog.ini
Normal file
16
models/blog.ini
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
[model]
|
||||||
|
name = Blog
|
||||||
|
label = Blog
|
||||||
|
hidden = yes
|
||||||
|
|
||||||
|
[fields.title]
|
||||||
|
label = Title
|
||||||
|
type = string
|
||||||
|
|
||||||
|
[children]
|
||||||
|
model = blog-post
|
||||||
|
order_by = -pub_date, title
|
||||||
|
|
||||||
|
[pagination]
|
||||||
|
enabled = yes
|
||||||
|
per_page = 10
|
11
models/page.ini
Normal file
11
models/page.ini
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
[model]
|
||||||
|
name = Page
|
||||||
|
label = {{ this.title }}
|
||||||
|
|
||||||
|
[fields.title]
|
||||||
|
label = Title
|
||||||
|
type = string
|
||||||
|
|
||||||
|
[fields.body]
|
||||||
|
label = Body
|
||||||
|
type = markdown
|
6
templates/blog-post.html
Normal file
6
templates/blog-post.html
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{% extends "layout.html" %}
|
||||||
|
{% from "macros/blog.html" import render_blog_post %}
|
||||||
|
{% block title %}{{ this.title }}{% endblock %}
|
||||||
|
{% block body %}
|
||||||
|
{{ render_blog_post(this) }}
|
||||||
|
{% endblock %}
|
11
templates/blog.html
Normal file
11
templates/blog.html
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{% extends "layout.html" %}
|
||||||
|
{% from "macros/blog.html" import render_blog_post %}
|
||||||
|
{% from "macros/pagination.html" import render_pagination %}
|
||||||
|
{% block title %}{{ this.title }}{% endblock %}
|
||||||
|
{% block body %}
|
||||||
|
{% for child in this.pagination.items %}
|
||||||
|
{{ render_blog_post(child, from_index=true) }}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{{ render_pagination(this.pagination) }}
|
||||||
|
{% endblock %}
|
29
templates/layout.html
Normal file
29
templates/layout.html
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
<!doctype html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<link rel="stylesheet" href="{{ '/static/style.css'|url }}">
|
||||||
|
<title>{% block title %}Welcome{% endblock %} — c3woc-podcast</title>
|
||||||
|
<body>
|
||||||
|
<header>
|
||||||
|
<h1>c3woc-podcast</h1>
|
||||||
|
<nav>
|
||||||
|
<ul class="nav navbar-nav">
|
||||||
|
<li{% if this._path == '/' %} class="active"{% endif
|
||||||
|
%}><a href="{{ '/'|url }}">Welcome</a></li>
|
||||||
|
{% for href, title in [
|
||||||
|
['/blog', 'Blog'],
|
||||||
|
['/projects', 'Projects'],
|
||||||
|
['/about', 'About']
|
||||||
|
] %}
|
||||||
|
<li{% if this.is_child_of(href) %} class="active"{% endif
|
||||||
|
%}><a href="{{ href|url }}">{{ title }}</a></li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</header>
|
||||||
|
<div class="page">
|
||||||
|
{% block body %}{% endblock %}
|
||||||
|
</div>
|
||||||
|
<footer>
|
||||||
|
© Copyright 2019 by L3D.
|
||||||
|
</footer>
|
||||||
|
</body>
|
20
templates/macros/blog.html
Normal file
20
templates/macros/blog.html
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
{% macro render_blog_post(post, from_index=false) %}
|
||||||
|
<div class="blog-post">
|
||||||
|
{% if from_index %}
|
||||||
|
<h2><a href="{{ post|url }}">{{ post.title }}</a></h2>
|
||||||
|
{% else %}
|
||||||
|
<h2>{{ post.title }}</h2>
|
||||||
|
{% endif %}
|
||||||
|
<p class="meta">
|
||||||
|
written by
|
||||||
|
{% if post.twitter_handle %}
|
||||||
|
<a href="https://twitter.com/{{ post.twitter_handle
|
||||||
|
}}">{{ post.author or post.twitter_handle }}</a>
|
||||||
|
{% else %}
|
||||||
|
{{ post.author }}
|
||||||
|
{% endif %}
|
||||||
|
on {{ post.pub_date }}
|
||||||
|
</p>
|
||||||
|
{{ post.body }}
|
||||||
|
</div>
|
||||||
|
{% endmacro %}
|
15
templates/macros/pagination.html
Normal file
15
templates/macros/pagination.html
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{% macro render_pagination(pagination) %}
|
||||||
|
<div class="pagination">
|
||||||
|
{% if pagination.has_prev %}
|
||||||
|
<a href="{{ pagination.prev|url }}">« Previous</a>
|
||||||
|
{% else %}
|
||||||
|
<span class="disabled">« Previous</span>
|
||||||
|
{% endif %}
|
||||||
|
| {{ pagination.page }} |
|
||||||
|
{% if pagination.has_next %}
|
||||||
|
<a href="{{ pagination.next|url }}">Next »</a>
|
||||||
|
{% else %}
|
||||||
|
<span class="disabled">Next »</span>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
{% endmacro %}
|
6
templates/page.html
Normal file
6
templates/page.html
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{% extends "layout.html" %}
|
||||||
|
{% block title %}{{ this.title }}{% endblock %}
|
||||||
|
{% block body %}
|
||||||
|
<h2>{{ this.title }}</h2>
|
||||||
|
{{ this.body }}
|
||||||
|
{% endblock %}
|
Loading…
Reference in a new issue