Skip to content

Commit aa8010d

Browse files
committed
feature: Add meta keyword, robot options and new theme
* Add support for meta keywords #15 * Add support for meta robot options #16 * Add support for tags #15 * Add grey/blue theme #14
1 parent f19de7f commit aa8010d

File tree

8 files changed

+166
-1
lines changed

8 files changed

+166
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ The configuration file (default `blog.conf`) provides the following configuratio
5858
| name | manpageblog | Defines the first part of the title (and HTML title) |
5959
| subtitle | a small and lightweight blog engine. | Defines the second part of the title (and HTML title) |
6060
| description | This is the blog of manpageblog where you can find more information | Defines the HTML meta descriptions (for searchengines) |
61+
| keywords | manpageblog, simple, easy, lightweight, blog engine | Keywords and tags as a comma separated list |
62+
| keywords_show | `meta` or `html` | Meta: Keywords will only be used for `meta` section. If `html` a tag section will be created |
63+
| robots | `noindex,nofollow` or `index,follow` | Defines if a page should be indexed by search engines (can be set for each site) |
6164
| author | admin | A default name for the author of blog posts |
6265
| copyright | manpageblog | name of a copyright holder |
6366
| preview_words | 150 (default) | How many words should be displayed within the blog index page |

_assets/css/grey_blue.css

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
body {
2+
background-color: #3d3d3d;
3+
}
4+
5+
img {
6+
max-width: 100%;
7+
height: auto;
8+
}
9+
10+
a:link, a:visited {
11+
color: #6082B6;
12+
text-decoration: underline dotted;
13+
}
14+
15+
a:hover, a:active {
16+
color: #6082B6;
17+
text-decoration: underline dotted;
18+
}
19+
20+
header section, footer section, manpage {
21+
color: #6082B6;
22+
font-size: 14px;
23+
font-family: "Courier New", monospace;
24+
margin-left: 0%;
25+
max-width: 40em;
26+
}
27+
28+
main, nav section, name section {
29+
color: #6082B6;
30+
max-width: 60em;
31+
font-size: 14px;
32+
font-family: "Courier New", monospace;
33+
margin-left: 5%;
34+
margin-right: auto;
35+
padding: 0 0.5em;
36+
}
37+
38+
code {
39+
color: #6082B6;
40+
max-width: 60em;
41+
font-size: 14px;
42+
font-style: italic;
43+
font-family: "Courier New", monospace;
44+
margin-left: 10%;
45+
margin-right: auto;
46+
padding: 0 0.5em;
47+
}

_templates/page.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
<head>
44
<title>{{ title }} | {{ subtitle }}</title>
55
<meta name="description" content="{{ meta_description }}"/>
6+
<meta name="keywords" content="{{ keywords }}"/>
7+
<meta name="robots" content="{{ robots }}">
68
<meta property="og:image" content="{{ image_url }}"/>
79
<meta property="og:title" content="{{ title }}"/>
810
<meta property="og:description" content="{{ meta_description }}"/>

_templates/page_tags.html

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title>{{ title }} | {{ subtitle }}</title>
5+
<meta name="description" content="{{ meta_description }}"/>
6+
<meta name="keywords" content="{{ keywords }}"/>
7+
<meta name="robots" content="{{ robots }}">
8+
<meta property="og:image" content="{{ image_url }}"/>
9+
<meta property="og:title" content="{{ title }}"/>
10+
<meta property="og:description" content="{{ meta_description }}"/>
11+
<meta property="og:image:width" content="{{ image_width }}"/>
12+
<meta property="og:image:height" content="{{ image_height }}"/>
13+
<meta name="twitter:card" content="summary" />
14+
<meta name="twitter:site" content="{{ profile_twitter }}" />
15+
<meta name="twitter:title" content="{{ title }}" />
16+
<meta name="twitter:description" content="{{ meta_description }}" />
17+
<meta name="twitter:image" content="{{ image_url }}" />
18+
<meta charset="UTF-8">
19+
<meta name="viewport" content="width=device-width">
20+
<meta name="robots" content="INDEX,FOLLOW">
21+
<meta name="generator" content="manpageblog {{ _version }}" />
22+
<link rel="stylesheet" type="text/css" href="{{ base_path }}/assets/css/{{ theme }}.css">
23+
<link rel="shortcut icon" type="image/png" href="{{ logo_favicon }}"/>
24+
<link rel="icon" type="image/png" href="{{ logo_favicon }}"/>
25+
<link rel="apple-touch-icon" href="{{ logo_apple_touch }}"/>
26+
<link href="{{ profile_mastodon }}" rel="me">
27+
</head>
28+
29+
<body id="{{ slug }}">
30+
31+
<manpage>
32+
<b>NAME</b><br>
33+
</manpage>
34+
35+
<name>
36+
<section>
37+
<span class="name">
38+
{{ name }}
39+
</span>
40+
</section>
41+
</name>
42+
43+
<manpage>
44+
<br><b>OPTIONS</b><br>
45+
</manpage>
46+
47+
48+
<nav>
49+
<section>
50+
<span class="home">
51+
<a href="{{ base_path }}/">[home]</a>
52+
<a href="{{ base_path }}/blog/">[blog]</a>
53+
<a href="{{ base_path }}/about/">[about]</a>
54+
<a href="{{ base_path }}/contact/">[contact]</a>
55+
</span>
56+
</section>
57+
</nav>
58+
59+
<manpage>
60+
<br><b>CONTENT</b><br>
61+
</manpage>
62+
63+
<main>
64+
{{ content }}
65+
</main>
66+
67+
<manpage>
68+
<br><b>TAGS</b><br>
69+
</manpage>
70+
71+
<main>
72+
{{ keywords }}
73+
</main>
74+
75+
<footer>
76+
<section>
77+
<p>&copy; {{ current_year }} {{ copyright }}</p>
78+
</section>
79+
</footer>
80+
81+
</body>
82+
</html>

blog.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
[general]
22
name: manpageblog
33
description: This is the blog of manpageblog where you can find more information.
4+
keywords: blog, minimal, minimalism, manpageblog, pythonblog, blogengine, simple
5+
keywords_show: meta
6+
robots: index,follow
47
subtitle: manpageblog - a small and lightweight blog engine.
58
author: admin
69
copyright: manpageblog

content/_index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<!-- title: Welcome -->
22
<!-- meta_description: manpageblog is a small, lightweight blog engine written in Python and offers several advantages. Firstly, it provides simplicity and ease of use, making it accessible even for users with limited technical knowledge. -->
3+
<!-- keywords: manpageblog, blog, blogging, blog engine, engine, python, minimal, no php, lightweight, easy, freebsd, linux, static, hosting -->
4+
<!-- image_url: https://cdn.gyptazy.ch/images/manpageblog.jpg -->
35
<b>Welcome</b>
46
<p>
57
Hey and welcome to <a href="https://github.com/gyptazy/manpageblog">manpageblog</a> - a small, lightweight blog
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!-- title: manpageblog released in version 1.3 -->
2+
<!-- meta_description: Initial release of manpageblog 1.3. A simple and static blog generator in manpage design written in Python. -->
3+
<!-- image_url: https://cdn.gyptazy.ch/images/manpageblog.jpg -->
4+
<!-- keywords: manpageblog, version, version 1.3, 1.3, features, release, meta, keyword, robots, support, robot, blue, grey, theme -->
5+
6+
<a href="https://github.com/gyptazy/manpageblog">manpageblog</a> just got released in version 1.3 Version 1.3 comes along with
7+
several bug fixes and some new features.<br><br>
8+
9+
<b>Features</b><br>
10+
* Add meta keyword support <br>
11+
* Add tag support<br>
12+
* Add robot support<br>
13+
* Add blue/grey theme<br>
14+
<br>
15+
<b>Fixes</b><br>
16+
* Fixed rendering issue<br>
17+
18+
<br>
19+
Now, you can start blogging. More information can be found on <a href="https://github.com/gyptazy/manpageblog">manpageblog</a>.<br>
20+
<b>Download</b>: <a href="https://github.com/gyptazy/manpageblog">manpageblog</a>

manpageblog

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ def main():
246246
'_version': '1.1',
247247
'name': config['general']['name'],
248248
'description': config['general']['description'],
249+
'keywords': config['general'].get('keywords', 'unknown'),
250+
'keywords_show': config['general'].get('keywords_show', 'meta'),
251+
'robots': config['general'].get('robots', 'noindex,nofollow'),
249252
'subtitle': config['general']['subtitle'],
250253
'author': config['general'].get('author', 'unknown'),
251254
'copyright': config['general'].get('copyright', 'manpageblog'),
@@ -264,7 +267,10 @@ def main():
264267
}
265268

266269
# Load layouts
267-
page_layout = fread(f'{config["processing"]["template_path"]}/page.html')
270+
if params.get('keywords_show') != 'meta':
271+
page_layout = fread(f'{config["processing"]["template_path"]}/page_tags.html')
272+
else:
273+
page_layout = fread(f'{config["processing"]["template_path"]}/page.html')
268274
post_layout = fread(f'{config["processing"]["template_path"]}/post.html')
269275
list_layout = fread(f'{config["processing"]["template_path"]}/list.html')
270276
item_layout = fread(f'{config["processing"]["template_path"]}/item.html')

0 commit comments

Comments
 (0)