platzky 0.1.19__py3-none-any.whl → 0.2.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- platzky/blog/__init__.py +0 -0
- platzky/blog/blog.py +61 -35
- platzky/blog/comment_form.py +8 -4
- platzky/config.py +52 -49
- platzky/db/__init__.py +0 -0
- platzky/db/db.py +99 -0
- platzky/db/db_loader.py +32 -0
- platzky/db/google_json_db.py +33 -10
- platzky/db/graph_ql_db.py +113 -57
- platzky/db/json_db.py +81 -23
- platzky/db/json_file_db.py +25 -9
- platzky/models.py +64 -0
- platzky/platzky.py +122 -62
- platzky/plugin_loader.py +31 -34
- platzky/plugins/redirections/entrypoint.py +41 -19
- platzky/plugins/sendmail/entrypoint.py +31 -10
- platzky/seo/seo.py +34 -24
- platzky/static/blog.css +5 -12
- platzky/templates/base.html +137 -22
- platzky/templates/blog.html +3 -2
- platzky/templates/body_meta.html +4 -21
- platzky/templates/feed.xml +1 -1
- platzky/templates/head_meta.html +5 -15
- platzky/templates/post.html +2 -2
- platzky/www_handler.py +7 -4
- platzky-0.2.1.dist-info/METADATA +40 -0
- platzky-0.2.1.dist-info/RECORD +34 -0
- {platzky-0.1.19.dist-info → platzky-0.2.1.dist-info}/WHEEL +1 -1
- platzky/blog/db.py +0 -18
- platzky/blog/post_formatter.py +0 -16
- platzky/db_loader.py +0 -11
- platzky-0.1.19.dist-info/METADATA +0 -43
- platzky-0.1.19.dist-info/RECORD +0 -32
platzky/templates/base.html
CHANGED
|
@@ -1,16 +1,110 @@
|
|
|
1
1
|
<!doctype html>
|
|
2
2
|
<html lang="{{ language }}">
|
|
3
3
|
<head>
|
|
4
|
+
{% block head_meta %}
|
|
4
5
|
{% include "head_meta.html" %}
|
|
6
|
+
|
|
7
|
+
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"
|
|
8
|
+
integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A=="
|
|
9
|
+
crossorigin=""/>
|
|
10
|
+
<link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster@1.5.3/dist/MarkerCluster.css" />
|
|
11
|
+
<link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster@1.5.3/dist/MarkerCluster.Default.css" />
|
|
12
|
+
<link rel="stylesheet" href="{{ font.url }}">
|
|
13
|
+
{% endblock %}
|
|
5
14
|
<title>{% block title %}{% endblock %}</title>
|
|
6
15
|
<meta name="description" content=" {% block description %} {% endblock %} ">
|
|
16
|
+
<style>
|
|
17
|
+
html,
|
|
18
|
+
body {
|
|
19
|
+
height: 100%;
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
body {
|
|
23
|
+
font-family: {{ font.name }}
|
|
24
|
+
}
|
|
25
|
+
.logo {
|
|
26
|
+
max-height: 6rem;
|
|
27
|
+
max-width: 50vw;
|
|
28
|
+
}
|
|
29
|
+
.header-row {
|
|
30
|
+
z-index: 1;
|
|
31
|
+
background-color: {{ primary_color }};
|
|
32
|
+
height: min-content;
|
|
33
|
+
display: flex;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
align-items: center;
|
|
36
|
+
}
|
|
37
|
+
#main-row {
|
|
38
|
+
position: relative;
|
|
39
|
+
flex-grow: 1;
|
|
40
|
+
z-index: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.left-panel-contents {
|
|
44
|
+
padding: 16px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.left-panel {
|
|
48
|
+
background-color: {{ secondary_color }};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
#left-panel {
|
|
52
|
+
background-color: {{ secondary_color }};
|
|
53
|
+
position: absolute;
|
|
54
|
+
height: 100%;
|
|
55
|
+
max-width: 80vw;
|
|
56
|
+
overflow-y: auto;
|
|
57
|
+
color: white;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.offcanvas-lg.offcanvas-start {
|
|
61
|
+
top: auto;
|
|
62
|
+
width: auto;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
#filter-form form > div {
|
|
66
|
+
padding-bottom: 1rem;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
#filter-form form div > span {
|
|
70
|
+
font-weight: bold;
|
|
71
|
+
padding-bottom: 0.5rem;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.dropdown-menu {
|
|
75
|
+
z-index: 1;
|
|
76
|
+
}
|
|
77
|
+
.btn {
|
|
78
|
+
padding: 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.btn-close {
|
|
82
|
+
opacity: 1;
|
|
83
|
+
}
|
|
84
|
+
i.fi {
|
|
85
|
+
margin: 0 0.5em;
|
|
86
|
+
}
|
|
87
|
+
</style>
|
|
7
88
|
</head>
|
|
8
89
|
<body>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
90
|
+
{% block body_meta %}
|
|
91
|
+
{% include "body_meta.html" %}
|
|
92
|
+
{% endblock %}
|
|
93
|
+
<div class="container-fluid d-flex flex-column h-100 g-0">
|
|
94
|
+
<div class="row header-row bg-light g-0">
|
|
95
|
+
<nav class="navbar navbar-expand-lg navbar-light p-3" id="mainNav">
|
|
96
|
+
{% if self.left_panel() %}
|
|
97
|
+
<button class="navbar-toggler" type="button" data-bs-toggle="offcanvas" data-bs-target="#left-panel" aria-label="Toggle left panel">
|
|
98
|
+
<i class="fas fa-sliders-h"></i>
|
|
99
|
+
</button>
|
|
100
|
+
{% endif %}
|
|
101
|
+
<a class="navbar-brand" href="/">
|
|
102
|
+
{% if logo_url %}
|
|
103
|
+
<img src="{{ logo_url }}" class="logo" >
|
|
104
|
+
{% else %}
|
|
105
|
+
{{ _(app_name) }}
|
|
106
|
+
{% endif %}
|
|
107
|
+
</a>
|
|
14
108
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
|
|
15
109
|
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
|
16
110
|
<i class="fas fa-bars"></i>
|
|
@@ -19,34 +113,55 @@
|
|
|
19
113
|
<ul class="navbar-nav">
|
|
20
114
|
{% for menu_item in menu_items %}
|
|
21
115
|
<li class="nav-item">
|
|
22
|
-
<a class="nav-link" href={{menu_item
|
|
116
|
+
<a class="nav-link" href={{menu_item.url}} >{{_(menu_item.name)}}</a>
|
|
23
117
|
</li>
|
|
24
118
|
{% endfor %}
|
|
25
119
|
</ul>
|
|
26
120
|
<ul class="navbar-nav ms-auto">
|
|
27
121
|
<li class="nav-item dropdown">
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
122
|
+
<div id="language-dropdown" class="btn-group">
|
|
123
|
+
<button type="button" class="nav-link dropdown-toggle btn btn-link" id="languages-menu" role="button"
|
|
124
|
+
data-bs-toggle="dropdown" aria-expanded="false">
|
|
125
|
+
<i class="fi fi-{{ current_flag }}"></i>
|
|
126
|
+
</button>
|
|
127
|
+
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="languages-menu">
|
|
128
|
+
{% for lg,items in languages.items() %}
|
|
129
|
+
<a class="dropdown-item" href={{url_for('change_language', lang=lg, _external=True)}}>
|
|
130
|
+
<i class="fi fi-{{ items['flag'] }} "></i>{{ items['name'] }}</a>
|
|
131
|
+
{% endfor %}
|
|
132
|
+
</ul>
|
|
133
|
+
</div>
|
|
37
134
|
</li>
|
|
38
135
|
</ul>
|
|
39
136
|
</div>
|
|
40
|
-
</
|
|
41
|
-
</
|
|
42
|
-
|
|
137
|
+
</nav>
|
|
138
|
+
</div>
|
|
139
|
+
{% block header %}{% endblock %}
|
|
43
140
|
|
|
44
|
-
|
|
45
|
-
{%
|
|
141
|
+
<div class="row g-0" id="main-row">
|
|
142
|
+
{% if self.left_panel() %}
|
|
143
|
+
<div class="col-lg-2 left-panel" >
|
|
144
|
+
<div id="left-panel" class="left-panel offcanvas-lg offcanvas-start" aria-modal="true" role="dialog">
|
|
145
|
+
<div class="offcanvas-body d-flex">
|
|
146
|
+
<div class="left-panel-contents">
|
|
147
|
+
{% block left_panel %}{% endblock %}
|
|
148
|
+
</div>
|
|
149
|
+
<div class="offcanvas-header justify-content-between align-items-start">
|
|
150
|
+
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="offcanvas" data-bs-target="#left-panel" ></button>
|
|
151
|
+
</div>
|
|
46
152
|
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
47
155
|
|
|
48
|
-
|
|
49
|
-
{%
|
|
156
|
+
</div>
|
|
157
|
+
{% endif %}
|
|
158
|
+
<div class="h-100 {% if self.left_panel() %} col-lg-10 {% else %} col-lg-12 {% endif %}">
|
|
159
|
+
<main class="h-100">
|
|
160
|
+
{% block content %}{% endblock %}
|
|
161
|
+
</main>
|
|
162
|
+
</div>
|
|
163
|
+
</div>
|
|
50
164
|
|
|
165
|
+
</div>
|
|
51
166
|
</body>
|
|
52
167
|
</html>
|
platzky/templates/blog.html
CHANGED
|
@@ -9,12 +9,13 @@
|
|
|
9
9
|
{% endblock %}
|
|
10
10
|
|
|
11
11
|
{% block content %}
|
|
12
|
-
<div class="
|
|
12
|
+
<div class="blog-contents mx-auto w-75">
|
|
13
13
|
<h1>{% block title %}Blog {{ subtitle|default('', true) }} {% endblock %}</h1>
|
|
14
14
|
{% for post in posts %}
|
|
15
|
+
|
|
15
16
|
<div class="row align-items-center">
|
|
16
17
|
<div class="col-3">
|
|
17
|
-
<img src="{{ post.coverImage.
|
|
18
|
+
<img src="{{ post.coverImage.url }}" alt="{{ post.coverImage.alternateText }}" class="img-thumbnail align-middle">
|
|
18
19
|
</div>
|
|
19
20
|
<div class="col-8 mx-auto">
|
|
20
21
|
<div class="post-preview">
|
platzky/templates/body_meta.html
CHANGED
|
@@ -1,24 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-MRQ7FDB"
|
|
4
|
-
height="0" width="0" style="display:none;visibility:hidden"></iframe>
|
|
5
|
-
</noscript>
|
|
6
|
-
<!-- End Google Tag Manager (noscript) -->
|
|
1
|
+
{{ dynamic_body | safe }}
|
|
2
|
+
|
|
7
3
|
<!-- Optional JavaScript -->
|
|
8
4
|
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
|
|
9
|
-
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
|
|
10
|
-
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
|
|
11
|
-
crossorigin="anonymous"></script>
|
|
12
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js"
|
|
13
|
-
integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut"
|
|
14
|
-
crossorigin="anonymous"></script>
|
|
15
|
-
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"
|
|
16
|
-
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
|
|
17
|
-
crossorigin="anonymous"></script>
|
|
18
5
|
|
|
19
|
-
|
|
20
|
-
<
|
|
21
|
-
type="text/javascript"
|
|
22
|
-
src="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/3.0.0/mdb.min.js"
|
|
23
|
-
></script>
|
|
24
|
-
<!-- End MDB -->
|
|
6
|
+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>
|
|
7
|
+
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A==" crossorigin="">
|
platzky/templates/feed.xml
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
<channel>
|
|
5
5
|
<title>{{_(app_name)}}</title>
|
|
6
|
-
<link>{{ url_for("blog.
|
|
6
|
+
<link>{{ url_for("blog.all_posts", _external=True) }}</link>
|
|
7
7
|
<description>{{_("Everything about mailings and newsletters")}}</description>
|
|
8
8
|
{% for post in posts %}
|
|
9
9
|
<item>
|
platzky/templates/head_meta.html
CHANGED
|
@@ -7,32 +7,22 @@
|
|
|
7
7
|
<link rel="canonical" href="{{ request.base_url }}"/>
|
|
8
8
|
|
|
9
9
|
<!-- Bootstrap CSS -->
|
|
10
|
-
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.
|
|
11
|
-
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
|
|
10
|
+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
|
|
12
11
|
|
|
13
|
-
<!--
|
|
14
|
-
<link href="https://
|
|
15
|
-
<!-- End
|
|
12
|
+
<!-- Flag icons -->
|
|
13
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/lipis/flag-icons@6.6.6/css/flag-icons.min.css"/>
|
|
14
|
+
<!-- End Flag icons -->
|
|
16
15
|
|
|
17
16
|
<!-- Font Awesome -->
|
|
18
17
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.2/css/all.min.css" rel="stylesheet">
|
|
19
18
|
<!-- End Font Awesome -->
|
|
20
19
|
|
|
21
|
-
|
|
22
20
|
<!-- Custom fonts for this template -->
|
|
23
21
|
<link href='https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
|
|
24
22
|
<link
|
|
25
23
|
href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800'
|
|
26
24
|
rel='stylesheet' type='text/css'>
|
|
27
25
|
|
|
28
|
-
|
|
29
|
-
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
|
30
|
-
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
|
31
|
-
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|
32
|
-
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
|
33
|
-
})(window,document,'script','dataLayer','GTM-MRQ7FDB');
|
|
34
|
-
</script>
|
|
35
|
-
<!-- End Google Tag Manager -->
|
|
36
|
-
|
|
26
|
+
{{ dynamic_head | safe }}
|
|
37
27
|
|
|
38
28
|
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='blog.css') }}">
|
platzky/templates/post.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
{% endblock %}
|
|
6
6
|
|
|
7
7
|
{% block content %}
|
|
8
|
-
<header class="masthead" style="background-image: url({{post.coverImage.
|
|
8
|
+
<header class="masthead" style="background-image: url({{post.coverImage.url}})">
|
|
9
9
|
<div class="overlay"></div>
|
|
10
10
|
<div class="container">
|
|
11
11
|
<div class="row">
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
<div class="container">
|
|
24
24
|
<div class="row">
|
|
25
25
|
<div class="col-lg-8 col-md-10 mx-auto post-content">
|
|
26
|
-
{{post.
|
|
26
|
+
{{post.contentInMarkdown | markdown}}
|
|
27
27
|
</div>
|
|
28
28
|
</div>
|
|
29
29
|
</div>
|
platzky/www_handler.py
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import urllib.parse
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
from flask import redirect, request
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
def redirect_nonwww_to_www():
|
|
6
7
|
"""Redirect non-www requests to www."""
|
|
7
8
|
urlparts = urllib.parse.urlparse(request.url)
|
|
8
9
|
if not urlparts.netloc.startswith("www."):
|
|
9
|
-
urlparts = urlparts._replace(netloc=f
|
|
10
|
-
|
|
10
|
+
urlparts = urlparts._replace(netloc=f"www.{urlparts.netloc}")
|
|
11
|
+
url = urllib.parse.urlunparse(urlparts)
|
|
12
|
+
return redirect(url, code=301)
|
|
11
13
|
|
|
12
14
|
|
|
13
15
|
def redirect_www_to_nonwww():
|
|
@@ -15,4 +17,5 @@ def redirect_www_to_nonwww():
|
|
|
15
17
|
urlparts = urllib.parse.urlparse(request.url)
|
|
16
18
|
if urlparts.netloc.startswith("www."):
|
|
17
19
|
urlparts = urlparts._replace(netloc=urlparts.netloc.removeprefix("www."))
|
|
18
|
-
|
|
20
|
+
url = urllib.parse.urlunparse(urlparts)
|
|
21
|
+
return redirect(url, code=302)
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: platzky
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: Not only blog engine
|
|
5
|
+
License: MIT
|
|
6
|
+
Requires-Python: >=3.10,<4.0
|
|
7
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Requires-Dist: Flask (==3.0.3)
|
|
13
|
+
Requires-Dist: Flask-Babel (>=4.0.0,<5.0.0)
|
|
14
|
+
Requires-Dist: Flask-Minify (>=0.42,<0.43)
|
|
15
|
+
Requires-Dist: Flask-WTF (>=1.2.1,<2.0.0)
|
|
16
|
+
Requires-Dist: PyYAML (>=6.0,<7.0)
|
|
17
|
+
Requires-Dist: aiohttp (>=3.9.5,<4.0.0)
|
|
18
|
+
Requires-Dist: google-cloud-storage (>=2.5.0,<3.0.0)
|
|
19
|
+
Requires-Dist: gql (>=3.4.0,<4.0.0)
|
|
20
|
+
Requires-Dist: humanize (>=4.9.0,<5.0.0)
|
|
21
|
+
Requires-Dist: pydantic (>=2.7.1,<3.0.0)
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
|
|
24
|
+

|
|
25
|
+
[](https://coveralls.io/github/platzky/platzky?branch=main)
|
|
26
|
+
|
|
27
|
+
# platzky
|
|
28
|
+
|
|
29
|
+
Platzky is engine which aims to provide simple and easy way to create and run web applications in python.
|
|
30
|
+
|
|
31
|
+
# How to use?
|
|
32
|
+
|
|
33
|
+
1. Install platzky with your favorite dependency management tool (`pip install platzky` or `poetry add platzky`).
|
|
34
|
+
2. Copy `config-template.yml` to your project directory and fill it with your data.
|
|
35
|
+
3. Run `flask --app "platzky.platzky:create_app(config_path='PATH_TO_YOUR_CONFIG_FILE')`
|
|
36
|
+
|
|
37
|
+
## Example
|
|
38
|
+
|
|
39
|
+
For examples check e2e tests in `tests/e2e` directory and Makefile.
|
|
40
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
platzky/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
platzky/blog/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
platzky/blog/blog.py,sha256=R1Otio2Ix5d02CT9mtYZ_kKMbKJArsuJdJLjCfc4Qxg,3031
|
|
4
|
+
platzky/blog/comment_form.py,sha256=4lkNJ_S_2DZmJBbz-NPDqahvy2Zz5AGNH2spFeGIop4,513
|
|
5
|
+
platzky/config.py,sha256=XL4oASEZQtc6iNfiLkAJaHp9fUX3A53DEpCXznYyOrQ,2203
|
|
6
|
+
platzky/db/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
platzky/db/db.py,sha256=0smTAiP4MDKOF_t60-KVKs1h-oTGydrWvAgPavFjDDo,2660
|
|
8
|
+
platzky/db/db_loader.py,sha256=CuEiXxhIa4bFMm0vi7ugzm7j3WycilGRKCU6smgIImE,905
|
|
9
|
+
platzky/db/google_json_db.py,sha256=65NKwbalGA1FfQz724dAK_3PS9e-MeLUb7WZkVU6nBo,1513
|
|
10
|
+
platzky/db/graph_ql_db.py,sha256=OiYxRJ7SwpKTEKNRLC5mvnDs5IYPh6Lsry7PGtl3oS4,6111
|
|
11
|
+
platzky/db/json_db.py,sha256=lbDZiEDWZebd9sssF8td1HKod4o7CdIvHu2fcPFgs7U,3184
|
|
12
|
+
platzky/db/json_file_db.py,sha256=UQ8TadELmqOzj_tgNfmzhtCkDkMAgcB9vaUy0GQXUY4,1010
|
|
13
|
+
platzky/models.py,sha256=8ATKVrGRtQ1JV_z7IdYbx1cxBU7ISoXjTmNxTlxok-k,1450
|
|
14
|
+
platzky/platzky.py,sha256=3KljmS4lTB1yscOSDoavZ2yFwHcdQ_K8Om8qlJBA73U,4649
|
|
15
|
+
platzky/plugin_loader.py,sha256=KYLDSEd_hseAgBuSbikerU_IFx-YmcYK5UwYw7kla2E,1106
|
|
16
|
+
platzky/plugins/redirections/entrypoint.py,sha256=HZsZBr8f7UkdYW0AJfUuG1vdEvWcpjoWMfm3cUXVHD4,1565
|
|
17
|
+
platzky/plugins/sendmail/entrypoint.py,sha256=ioVUh_YgxyA4DnHRBUbg9ze08EKX_iCbFhbK145icjE,1237
|
|
18
|
+
platzky/seo/seo.py,sha256=5Rl-ZQ3DWw65x0V7mpIkmUfxXTb6i5PEbIrAX7pzV70,2710
|
|
19
|
+
platzky/static/blog.css,sha256=jF-8ykgpbPp58SCUqygBhCm4o7ggULojbxpnk6Jbx3c,7895
|
|
20
|
+
platzky/templates/404.html,sha256=EheoLSWylOscLH8FmcMA4c6Jw14i5HkSvE_GXzGIrUo,78
|
|
21
|
+
platzky/templates/base.html,sha256=D9W3UHz3SmLBcqzCexD3pfvQWhK3c5crKvoa0SaaST4,4966
|
|
22
|
+
platzky/templates/blog.html,sha256=aPl-DzLX85bHv7tN8UjlABR086PUJ9IGlGbIBioFHGA,1281
|
|
23
|
+
platzky/templates/body_meta.html,sha256=au61f54ZK8SdovSpoUROjyy5fi3K6n_N5P-QjW7S5-8,526
|
|
24
|
+
platzky/templates/feed.xml,sha256=I9cz7vnxx-TfbLIDHFXfrC3S2Nt9B6PrWf3u4zSIi78,863
|
|
25
|
+
platzky/templates/head_meta.html,sha256=yFHTEYrVd8QsGPVJK4M-NsZ1OcDO8PU5qTvhP9mkPTk,1370
|
|
26
|
+
platzky/templates/home.html,sha256=nqoVVvaNBd1ceun6KOZB_eY20xf4Mjtu8LTl1Q_Ap6c,3900
|
|
27
|
+
platzky/templates/page.html,sha256=8tS9K5dXfCKItvOlpEuURnWohnWjs6WW6zeBJFLARUM,647
|
|
28
|
+
platzky/templates/post.html,sha256=GSgjIZsOQKtNx3cEbquSjZ5L4whPnG6MzRyoq9k4B8Q,1906
|
|
29
|
+
platzky/templates/robots.txt,sha256=2_j2tiYtYJnzZUrANiX9pvBxyw5Dp27fR_co18BPEJ0,116
|
|
30
|
+
platzky/templates/sitemap.xml,sha256=iIJZ91_B5ZuNLCHsRtsGKZlBAXojOTP8kffqKLacgvs,578
|
|
31
|
+
platzky/www_handler.py,sha256=pF6Rmvem1sdVqHD7z3RLrDuG-CwAqfGCti50_NPsB2w,725
|
|
32
|
+
platzky-0.2.1.dist-info/METADATA,sha256=v-9-GEm_sYhckJIS0V6XfCpAbttu_urTW7xm1X9SZtg,1591
|
|
33
|
+
platzky-0.2.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
34
|
+
platzky-0.2.1.dist-info/RECORD,,
|
platzky/blog/db.py
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
class DB:
|
|
2
|
-
def get_all_posts(self, lang):
|
|
3
|
-
pass
|
|
4
|
-
|
|
5
|
-
def get_post(self, slug):
|
|
6
|
-
pass
|
|
7
|
-
|
|
8
|
-
def get_page(self, slug):
|
|
9
|
-
pass
|
|
10
|
-
|
|
11
|
-
def get_posts_by_tag(self, tag, lang):
|
|
12
|
-
pass
|
|
13
|
-
|
|
14
|
-
def get_menu(self):
|
|
15
|
-
pass
|
|
16
|
-
|
|
17
|
-
def add_comment(self, author_name, comment, post_slug):
|
|
18
|
-
pass
|
platzky/blog/post_formatter.py
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import datetime
|
|
2
|
-
import humanize
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
def get_delta(now, date_in):
|
|
6
|
-
date = datetime.datetime.strptime(date_in.split(".")[0], "%Y-%m-%dT%H:%M:%S")
|
|
7
|
-
delta = humanize.naturaltime(now - date)
|
|
8
|
-
return delta
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def format_post(post):
|
|
12
|
-
now = datetime.datetime.now()
|
|
13
|
-
for comment in post["comments"]:
|
|
14
|
-
comment.update({"time_delta": get_delta(now, comment["date"])})
|
|
15
|
-
post["comments"].sort(key=lambda x: x["date"], reverse=True)
|
|
16
|
-
return post
|
platzky/db_loader.py
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
from platzky.db import json_file_db, graph_ql_db, google_json_db
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def load_db_driver(db_type):
|
|
5
|
-
db_type_to_db_loader = {
|
|
6
|
-
"json_file": json_file_db,
|
|
7
|
-
"google_json": google_json_db,
|
|
8
|
-
"graph_ql": graph_ql_db
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
return db_type_to_db_loader[db_type]
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: platzky
|
|
3
|
-
Version: 0.1.19
|
|
4
|
-
Summary: Another blog in python
|
|
5
|
-
License: MIT
|
|
6
|
-
Requires-Python: >=3.10,<4.0
|
|
7
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
|
9
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
11
|
-
Requires-Dist: Flask (>=2.2.2,<3.0.0)
|
|
12
|
-
Requires-Dist: Flask-Babel (>=2.0.0,<3.0.0)
|
|
13
|
-
Requires-Dist: Flask-Minify (>=0.39,<0.40)
|
|
14
|
-
Requires-Dist: Flask-WTF (>=1.0.1,<2.0.0)
|
|
15
|
-
Requires-Dist: PyYAML (>=6.0,<7.0)
|
|
16
|
-
Requires-Dist: aiohttp (>=3.8.3,<4.0.0)
|
|
17
|
-
Requires-Dist: google-cloud-storage (>=2.5.0,<3.0.0)
|
|
18
|
-
Requires-Dist: gql (>=3.4.0,<4.0.0)
|
|
19
|
-
Requires-Dist: humanize (>=4.3.0,<5.0.0)
|
|
20
|
-
Description-Content-Type: text/markdown
|
|
21
|
-
|
|
22
|
-

|
|
23
|
-
[](https://coveralls.io/github/platzky/platzky?branch=main)
|
|
24
|
-
|
|
25
|
-
# platzky
|
|
26
|
-
|
|
27
|
-
Blog engine in python
|
|
28
|
-
|
|
29
|
-
# How to run?
|
|
30
|
-
|
|
31
|
-
1. Install platzky with your favorite dependency management tool (`pip install platzky`)
|
|
32
|
-
2. run `flask --app "platzky:create_app(PATH_TO_YOUR_CONFIG_FILE)" run`
|
|
33
|
-
|
|
34
|
-
## Configuration
|
|
35
|
-
|
|
36
|
-
For details check `config.yml.tpl` file.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
# API
|
|
40
|
-
`platzky.config.from_file(path_to_config)` - creates _platzky_ config from file (see __config.yml.tpl__)
|
|
41
|
-
`platzky.create_app_from_config(config)` - creates _platzky_ application.
|
|
42
|
-
`platzky.sendmail(receiver_email, subject, message)`- sends email from configured account
|
|
43
|
-
|
platzky-0.1.19.dist-info/RECORD
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
platzky/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
platzky/blog/blog.py,sha256=XczGxFKM3znNRzM9u1gGOiVXAtR1-TkHUoT1wUyiuAs,2590
|
|
3
|
-
platzky/blog/comment_form.py,sha256=kBHN4IQGyDQrz_Fabh9UqtLi0yv22Rt6uTYCVgCs0U4,467
|
|
4
|
-
platzky/blog/db.py,sha256=ZAyn663IYPxd1Qeff6m6jF4Cd7kf01Xg3h-M69y_Ytw,315
|
|
5
|
-
platzky/blog/post_formatter.py,sha256=puS1P1z9nnWBK1_94VFvgNSeT2RmDrcVMnlSUS4AjxI,456
|
|
6
|
-
platzky/config.py,sha256=Nxqy7vNoGEwvwG55cyUrrMzTdARmk48GdFxw-OcMD7w,1941
|
|
7
|
-
platzky/db/google_json_db.py,sha256=RYFD3iXx0FtsD3DgxGZwqISt-P19WOF2TuY2GwFxdo8,951
|
|
8
|
-
platzky/db/graph_ql_db.py,sha256=i1bKD9klOzvyGf_vSkmnh_5mJMRtXgW9SsBs6jSjKC0,5021
|
|
9
|
-
platzky/db/json_db.py,sha256=wIo0yWtei12j36BzUyeDmqic5_qx4gouvh82fGd9XdE,1403
|
|
10
|
-
platzky/db/json_file_db.py,sha256=wRk09EUSTDF_oxEEf97MxZnmmbffYy_FXtQznt59_rw,671
|
|
11
|
-
platzky/db_loader.py,sha256=nfLU4YfqQlRNazddljopDWImDfQy3gUWFo81Xe1HIfI,279
|
|
12
|
-
platzky/platzky.py,sha256=dy6KrOdHm18YbBMOIeMjnmdGKEZWaKAg1FslFru0WS0,3115
|
|
13
|
-
platzky/plugin_loader.py,sha256=I-mUeXFTot7d4MNEgksVtD4b2tPSNvUFjzzi5ERBWTU,1407
|
|
14
|
-
platzky/plugins/redirections/entrypoint.py,sha256=6d4DjmLvF4ioULE27jJWS9W_6zIz7yfKzufED569cIg,1145
|
|
15
|
-
platzky/plugins/sendmail/entrypoint.py,sha256=4YSsdYXnXi6vFDFrVfuZxCDC3PYWo-j--8lh0rWSNeE,735
|
|
16
|
-
platzky/seo/seo.py,sha256=s8zmN6vzO-jKJCbfbCNNTJJdz9crdv0LM-_sxU7PAS4,2665
|
|
17
|
-
platzky/static/blog.css,sha256=4yBmwfATrDboZ6E8RSsr3kN3wGKEpnZfWHd_hCR_870,8079
|
|
18
|
-
platzky/templates/404.html,sha256=EheoLSWylOscLH8FmcMA4c6Jw14i5HkSvE_GXzGIrUo,78
|
|
19
|
-
platzky/templates/base.html,sha256=gGoQbRwDRqqYXX2dhJQ7E6iX1nhLx0X85Sf1VL4NVUw,1868
|
|
20
|
-
platzky/templates/blog.html,sha256=8Ggb1VXAuP1oNUXn5CrtjB4kAyH0TfboDia6zs9Y2dw,1269
|
|
21
|
-
platzky/templates/body_meta.html,sha256=JWJbpD3pDrJwtsk6-UJefOIVHQBbW3oXJskhlVcYXNk,1141
|
|
22
|
-
platzky/templates/feed.xml,sha256=Ej0xPVZquxe2o9i0P2X0qwyBa0JFXoDjJthCm3X2-Ds,859
|
|
23
|
-
platzky/templates/head_meta.html,sha256=pNxy48tC6CRHzpN03txWFM2efgcQSCshp_YR-u7Desg,1782
|
|
24
|
-
platzky/templates/home.html,sha256=nqoVVvaNBd1ceun6KOZB_eY20xf4Mjtu8LTl1Q_Ap6c,3900
|
|
25
|
-
platzky/templates/page.html,sha256=8tS9K5dXfCKItvOlpEuURnWohnWjs6WW6zeBJFLARUM,647
|
|
26
|
-
platzky/templates/post.html,sha256=sjjYZJZNzj1iivhdJlJDWpOnO5ZNb_pWfubj5xdDVZA,1921
|
|
27
|
-
platzky/templates/robots.txt,sha256=2_j2tiYtYJnzZUrANiX9pvBxyw5Dp27fR_co18BPEJ0,116
|
|
28
|
-
platzky/templates/sitemap.xml,sha256=iIJZ91_B5ZuNLCHsRtsGKZlBAXojOTP8kffqKLacgvs,578
|
|
29
|
-
platzky/www_handler.py,sha256=J2ShAxLC1SZcKODeCfUVXhnzmbRDf--ZMVAOUn-y6co,688
|
|
30
|
-
platzky-0.1.19.dist-info/METADATA,sha256=NAOsvs7mgN_Dcxcd-tH8-ZVxhthgoB5e9X29o2-xAF0,1555
|
|
31
|
-
platzky-0.1.19.dist-info/WHEEL,sha256=vVCvjcmxuUltf8cYhJ0sJMRDLr1XsPuxEId8YDzbyCY,88
|
|
32
|
-
platzky-0.1.19.dist-info/RECORD,,
|