Transform hard-coded theme into Jinja template
This commit is contained in:
parent
5190e4b812
commit
ba35bf5466
|
@ -1,5 +1,56 @@
|
|||
Title: My First Review
|
||||
Date: 2010-12-03 10:20
|
||||
Modified: 2020-05-09 5:12
|
||||
Category: Review
|
||||
Summary: test
|
||||
|
||||
Following is a review of my favorite mechanical keyboard.
|
||||
[TOC]
|
||||
|
||||
Following is a review of my favorite xyz.
|
||||
|
||||
asdfasdfasdfasdf
|
||||
|
||||
## header
|
||||
|
||||
test test
|
||||
|
||||
```
|
||||
this is a code block
|
||||
<html>
|
||||
|
||||
</html>
|
||||
```
|
||||
|
||||
### smaller header
|
||||
|
||||
hello world
|
||||
|
||||
#### Tiny header
|
||||
|
||||
paragraph
|
||||
|
||||
##### mini header
|
||||
|
||||
paragraph
|
||||
|
||||
### how to install
|
||||
|
||||
update packages:
|
||||
|
||||
```
|
||||
sudo apt update
|
||||
```
|
||||
|
||||
install packages:
|
||||
|
||||
```
|
||||
sudo apt install qot
|
||||
```
|
||||
|
||||
clone the repo:
|
||||
|
||||
```
|
||||
git clone https://example.com
|
||||
```
|
||||
|
||||
all done!
|
||||
|
|
|
@ -19,18 +19,21 @@ TRANSLATION_FEED_ATOM = None
|
|||
AUTHOR_FEED_ATOM = None
|
||||
AUTHOR_FEED_RSS = None
|
||||
|
||||
# Blogroll
|
||||
LINKS = (('Pelican', 'http://getpelican.com/'),
|
||||
('Python.org', 'http://python.org/'),
|
||||
('Jinja2', 'http://jinja.pocoo.org/'),
|
||||
('You can modify those links in your config file', '#'),)
|
||||
|
||||
# Social widget
|
||||
SOCIAL = (('You can add links in your config file', '#'),
|
||||
('Another social link', '#'),)
|
||||
|
||||
DEFAULT_PAGINATION = False
|
||||
|
||||
MARKDOWN = {
|
||||
'extension_configs': {
|
||||
'markdown.extensions.codehilite': {'css_class': 'highlight'},
|
||||
'markdown.extensions.extra': {},
|
||||
'markdown.extensions.meta': {},
|
||||
'markdown.extensions.toc': {
|
||||
'toc_depth': '2-3',
|
||||
'anchorlink': True,
|
||||
},
|
||||
},
|
||||
'output_format': 'html5',
|
||||
}
|
||||
|
||||
# Uncomment following line if you want document-relative URLs when developing
|
||||
#RELATIVE_URLS = True
|
||||
|
||||
|
|
20
themes/theme/templates/article.html
Normal file
20
themes/theme/templates/article.html
Normal file
|
@ -0,0 +1,20 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<header>
|
||||
<h1>{{ article.title }}</h1>
|
||||
<p class="metadata">
|
||||
{{ article.locale_date }}
|
||||
{% if article.modified %}
|
||||
— updated {{ article.locale_modified }}
|
||||
{% endif %}
|
||||
</p>
|
||||
<div class="summary">
|
||||
{{ article.summary }}
|
||||
</div>
|
||||
</header>
|
||||
<hr />
|
||||
<article>
|
||||
{{ article.content }}
|
||||
</article>
|
||||
{% endblock %}
|
|
@ -4,10 +4,13 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta charset="utf-8"/>
|
||||
|
||||
<title>Tanner Collin</title>
|
||||
<style>
|
||||
{% include 'style.css' %}
|
||||
</style>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/theme/style.css" />
|
||||
<link rel="stylesheet" type="text/css" href="/theme/fonts/fonts.css" />
|
||||
|
||||
<title>Tanner Collin</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
@ -35,35 +38,8 @@
|
|||
<li>Contact</li>
|
||||
</ul>
|
||||
</div>
|
||||
<header>
|
||||
<h1>My Title</h1>
|
||||
<p>May 7th, 2020</p>
|
||||
</header>
|
||||
<hr />
|
||||
<article>
|
||||
<div class="toc">
|
||||
<ol>
|
||||
<li>Section One</li>
|
||||
<li>Section Two</li>
|
||||
<ol type="a">
|
||||
<li>Subsection One</li>
|
||||
<li>Subsection Two</li>
|
||||
</ol>
|
||||
<li>Section Three</li>
|
||||
</ol>
|
||||
</div>
|
||||
<p>
|
||||
Lorem <a href="asdf">ipsum</a> dolor sit amet, consectetur adipiscing elit. Curabitur a semper lacus. Sed vulputate ligula eget odio mollis, sed dictum dui euismod. Vivamus quis gravida diam. Sed elementum dolor non augue egestas scelerisque. Donec odio diam, feugiat sit amet accumsan eget, lobortis vel mi. Mauris a ipsum ut urna vestibulum bibendum. Nunc ut placerat ex. Morbi eleifend risus in neque suscipit aliquet. Praesent sed dolor vel tellus sagittis viverra. Vestibulum et tincidunt sem. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vel laoreet nibh, pulvinar porta risus.
|
||||
<p>
|
||||
|
||||
<p>
|
||||
Nunc euismod nulla ac felis pellentesque auctor. Phasellus mi lacus, cursus id justo nec, finibus dictum velit. Pellentesque quis nisl sollicitudin, viverra mi vel, eleifend lectus. Morbi sollicitudin ultricies elementum. Sed ut feugiat neque, vel scelerisque dolor. Quisque quis luctus lectus, quis venenatis nisi. Proin massa tortor, luctus sed pharetra sit amet, interdum eget lacus. Integer vel arcu pretium ipsum venenatis porttitor a a dui. Nullam interdum vehicula efficitur. Nullam non consequat sem. Nunc finibus enim neque, a tristique massa aliquet rhoncus.
|
||||
<p>
|
||||
|
||||
<p>
|
||||
Nulla sapien odio, blandit ut pellentesque a, tincidunt id libero. Curabitur vitae lorem ullamcorper, vestibulum quam sed, pharetra ex. Pellentesque fermentum elit in facilisis bibendum. Duis porta ante felis, non molestie ipsum porta at. Interdum et malesuada fames ac ante ipsum primis in faucibus. Suspendisse ultrices erat ut dolor fermentum aliquet. Quisque condimentum sed arcu eget faucibus. Pellentesque eget nisl sit amet tortor blandit feugiat convallis in dolor. Sed ornare tristique nulla, in hendrerit neque condimentum id. Aenean sollicitudin, eros ut porttitor porta, risus sem auctor tortor, sed fringilla est odio ac odio. Nulla tempus odio magna, nec fringilla erat faucibus ac.
|
||||
</p>
|
||||
</article>
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
16
themes/theme/templates/index.html
Normal file
16
themes/theme/templates/index.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
{% for article in articles_page.object_list %}
|
||||
<h2><a href="{{ article.url }}">{{ article.title }}</a></h2>
|
||||
<p class="metadata">
|
||||
{{ article.locale_date }}
|
||||
{% if article.modified %}
|
||||
— updated {{ article.locale_modified }}
|
||||
{% endif %}
|
||||
</p>
|
||||
<div class="summary">
|
||||
{{ article.summary }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
|
@ -1,5 +1,4 @@
|
|||
body {
|
||||
text-rendering: optimizeLegibility;
|
||||
font: 1.2rem/1.0 Lato,sans-serif;
|
||||
background-color: rgb(245, 245, 245);
|
||||
}
|
||||
|
@ -10,9 +9,15 @@ a {
|
|||
outline: none;
|
||||
}
|
||||
|
||||
pre {
|
||||
font-size: 1rem;
|
||||
background-color: #eee;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 56rem;
|
||||
margin: 1rem auto 0 auto;
|
||||
margin: 2rem auto 0 auto;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
|
@ -37,7 +42,7 @@ a {
|
|||
display: block;
|
||||
}
|
||||
.sidebar a:hover {
|
||||
background-color: #eeeeee;
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
.topbar {
|
||||
|
@ -55,10 +60,28 @@ a {
|
|||
|
||||
.toc {
|
||||
float: right;
|
||||
background-color: #eee;
|
||||
padding: 0.75rem;
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.toc ul {
|
||||
padding-left: 1.2rem;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.toc li {
|
||||
margin-top: 0.5rem;
|
||||
margin-top: 0.75rem;
|
||||
}
|
||||
|
||||
.content p.metadata {
|
||||
color: #555;
|
||||
font: 1rem/1.0 Apparatus SIL,serif;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.content div.summary p {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.content {
|
Loading…
Reference in New Issue
Block a user