platzky 0.2.8__tar.gz → 0.2.10__tar.gz

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.
Files changed (35) hide show
  1. {platzky-0.2.8 → platzky-0.2.10}/PKG-INFO +1 -1
  2. {platzky-0.2.8 → platzky-0.2.10}/platzky/config.py +1 -0
  3. {platzky-0.2.8 → platzky-0.2.10}/platzky/platzky.py +2 -0
  4. {platzky-0.2.8 → platzky-0.2.10}/platzky/plugins/google-tag-manager/entrypoint.py +1 -0
  5. {platzky-0.2.8 → platzky-0.2.10}/platzky/seo/seo.py +17 -9
  6. {platzky-0.2.8 → platzky-0.2.10}/platzky/static/blog.css +3 -3
  7. {platzky-0.2.8 → platzky-0.2.10}/platzky/templates/base.html +17 -2
  8. {platzky-0.2.8 → platzky-0.2.10}/pyproject.toml +1 -1
  9. {platzky-0.2.8 → platzky-0.2.10}/README.md +0 -0
  10. {platzky-0.2.8 → platzky-0.2.10}/platzky/__init__.py +0 -0
  11. {platzky-0.2.8 → platzky-0.2.10}/platzky/blog/__init__.py +0 -0
  12. {platzky-0.2.8 → platzky-0.2.10}/platzky/blog/blog.py +0 -0
  13. {platzky-0.2.8 → platzky-0.2.10}/platzky/blog/comment_form.py +0 -0
  14. {platzky-0.2.8 → platzky-0.2.10}/platzky/db/__init__.py +0 -0
  15. {platzky-0.2.8 → platzky-0.2.10}/platzky/db/db.py +0 -0
  16. {platzky-0.2.8 → platzky-0.2.10}/platzky/db/db_loader.py +0 -0
  17. {platzky-0.2.8 → platzky-0.2.10}/platzky/db/google_json_db.py +0 -0
  18. {platzky-0.2.8 → platzky-0.2.10}/platzky/db/graph_ql_db.py +0 -0
  19. {platzky-0.2.8 → platzky-0.2.10}/platzky/db/json_db.py +0 -0
  20. {platzky-0.2.8 → platzky-0.2.10}/platzky/db/json_file_db.py +0 -0
  21. {platzky-0.2.8 → platzky-0.2.10}/platzky/models.py +0 -0
  22. {platzky-0.2.8 → platzky-0.2.10}/platzky/plugin_loader.py +0 -0
  23. {platzky-0.2.8 → platzky-0.2.10}/platzky/plugins/redirections/entrypoint.py +0 -0
  24. {platzky-0.2.8 → platzky-0.2.10}/platzky/plugins/sendmail/entrypoint.py +0 -0
  25. {platzky-0.2.8 → platzky-0.2.10}/platzky/templates/404.html +0 -0
  26. {platzky-0.2.8 → platzky-0.2.10}/platzky/templates/blog.html +0 -0
  27. {platzky-0.2.8 → platzky-0.2.10}/platzky/templates/body_meta.html +0 -0
  28. {platzky-0.2.8 → platzky-0.2.10}/platzky/templates/feed.xml +0 -0
  29. {platzky-0.2.8 → platzky-0.2.10}/platzky/templates/head_meta.html +0 -0
  30. {platzky-0.2.8 → platzky-0.2.10}/platzky/templates/home.html +0 -0
  31. {platzky-0.2.8 → platzky-0.2.10}/platzky/templates/page.html +0 -0
  32. {platzky-0.2.8 → platzky-0.2.10}/platzky/templates/post.html +0 -0
  33. {platzky-0.2.8 → platzky-0.2.10}/platzky/templates/robots.txt +0 -0
  34. {platzky-0.2.8 → platzky-0.2.10}/platzky/templates/sitemap.xml +0 -0
  35. {platzky-0.2.8 → platzky-0.2.10}/platzky/www_handler.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: platzky
3
- Version: 0.2.8
3
+ Version: 0.2.10
4
4
  Summary: Not only blog engine
5
5
  License: MIT
6
6
  Requires-Python: >=3.10,<4.0
@@ -15,6 +15,7 @@ class StrictBaseModel(BaseModel):
15
15
  class LanguageConfig(StrictBaseModel):
16
16
  name: str = Field(alias="name")
17
17
  flag: str = Field(alias="flag")
18
+ country: str = Field(alias="country")
18
19
  domain: t.Optional[str] = Field(default=None, alias="domain")
19
20
 
20
21
 
@@ -94,10 +94,12 @@ def create_engine(config: Config, db) -> Engine:
94
94
  def utils():
95
95
  locale = app.get_locale()
96
96
  flag = lang.flag if (lang := config.languages.get(locale)) is not None else ""
97
+ country = lang.country if (lang := config.languages.get(locale)) is not None else ""
97
98
  return {
98
99
  "app_name": config.app_name,
99
100
  "languages": languages_dict(config.languages),
100
101
  "current_flag": flag,
102
+ "current_lang_country": country,
101
103
  "current_language": locale,
102
104
  "url_link": url_link,
103
105
  "menu_items": app.db.get_menu_items(),
@@ -20,6 +20,7 @@ def process(app, plugin_config):
20
20
  <noscript><iframe src="https://www.googletagmanager.com/ns.html?id="""
21
21
  + gtm_id
22
22
  + """
23
+ "
23
24
  height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
24
25
  <!-- End Google Tag Manager (noscript) -->
25
26
  """
@@ -20,7 +20,19 @@ def create_seo_blueprint(db, config: dict[str, t.Any], locale_func: t.Callable[[
20
20
  response.headers["Content-Type"] = "text/plain"
21
21
  return response
22
22
 
23
- @seo.route("/sitemap.xml")
23
+ def get_blog_entries(host_base, lang, db, blog_prefix):
24
+ dynamic_urls = list()
25
+ print(blog_prefix)
26
+ for post in db.get_all_posts(
27
+ lang
28
+ ): # TODO add get_list_of_posts for faster getting just list of it
29
+ slug = post.slug
30
+ datet = post.date.split("T")[0]
31
+ url = {"loc": f"{host_base}{blog_prefix}/{slug}", "lastmod": datet}
32
+ dynamic_urls.append(url)
33
+ return dynamic_urls
34
+
35
+ @seo.route("/sitemap.xml") # TODO try to replace sitemap logic with flask-sitemap module
24
36
  def sitemap():
25
37
  """
26
38
  Route to dynamically generate a sitemap of your website/application.
@@ -40,14 +52,7 @@ def create_seo_blueprint(db, config: dict[str, t.Any], locale_func: t.Callable[[
40
52
  url = {"loc": f"{host_base}{rule!s}"}
41
53
  static_urls.append(url)
42
54
 
43
- # Dynamic routes with dynamic content
44
- dynamic_urls = list()
45
- seo_posts = db.get_all_posts(lang)
46
- for post in seo_posts:
47
- slug = post.slug
48
- datet = post.date.split("T")[0]
49
- url = {"loc": f"{host_base}/{slug}", "lastmod": datet}
50
- dynamic_urls.append(url)
55
+ dynamic_urls = get_blog_entries(host_base, lang, db, config["BLOG_PREFIX"])
51
56
 
52
57
  statics = list({v["loc"]: v for v in static_urls}.values())
53
58
  dynamics = list({v["loc"]: v for v in dynamic_urls}.values())
@@ -62,3 +67,6 @@ def create_seo_blueprint(db, config: dict[str, t.Any], locale_func: t.Callable[[
62
67
  return response
63
68
 
64
69
  return seo
70
+
71
+
72
+ # TODO add tests which would check that sitemap is different for different languages
@@ -107,7 +107,7 @@ img::-moz-selection {
107
107
  background: transparent;
108
108
  }
109
109
  #mainNav .navbar-brand {
110
- padding: 10px 20px;
110
+ padding: 0px 20px;
111
111
  color: #000;
112
112
  }
113
113
  #mainNav .navbar-brand:focus, #mainNav .navbar-brand:hover {
@@ -179,7 +179,7 @@ header.masthead .overlay {
179
179
  header.masthead .page-heading,
180
180
  header.masthead .post-heading,
181
181
  header.masthead .site-heading {
182
- padding: 200px 0 150px;
182
+ padding: 100px 0 85px;
183
183
  color: white;
184
184
  }
185
185
 
@@ -187,7 +187,7 @@ header.masthead .site-heading {
187
187
  header.masthead .page-heading,
188
188
  header.masthead .post-heading,
189
189
  header.masthead .site-heading {
190
- padding: 200px 0;
190
+ padding: 100px 0;
191
191
  }
192
192
  }
193
193
 
@@ -1,5 +1,5 @@
1
1
  <!doctype html>
2
- <html lang="{{ current_language }}">
2
+ <html lang="{{ current_language }}-{{ current_lang_country }}">
3
3
  <head>
4
4
  {% include "head_meta.html" %}
5
5
  {% block head_meta %}{% endblock %}
@@ -49,6 +49,19 @@
49
49
  max-width: 80vw;
50
50
  overflow-y: auto;
51
51
  color: white;
52
+ z-index: 999999999;
53
+ }
54
+
55
+ .language-indicator-text {
56
+ color: white;
57
+ font-weight: normal;
58
+ }
59
+
60
+ #languages-menu {
61
+ background-color: {{ secondary_color }};
62
+ padding: 5px 10px;
63
+ border-radius: 5px;
64
+ color: white;
52
65
  }
53
66
 
54
67
  .offcanvas-lg.offcanvas-start {
@@ -68,6 +81,7 @@
68
81
  .dropdown-menu {
69
82
  z-index: 1;
70
83
  }
84
+
71
85
  .btn {
72
86
  padding: 0;
73
87
  }
@@ -86,7 +100,7 @@
86
100
  {% endblock %}
87
101
  <div class="container-fluid d-flex flex-column h-100 g-0">
88
102
  <div class="row header-row bg-light g-0">
89
- <nav class="navbar navbar-expand-lg navbar-light p-3" id="mainNav">
103
+ <nav class="navbar navbar-expand-lg navbar-light px-3 py-1" id="mainNav">
90
104
  {% if self.left_panel() %}
91
105
  <button class="navbar-toggler" type="button" data-bs-toggle="offcanvas" data-bs-target="#left-panel" aria-label="Toggle left panel">
92
106
  <i class="fas fa-sliders-h"></i>
@@ -110,6 +124,7 @@
110
124
  <div id="language-dropdown" class="btn-group">
111
125
  <button type="button" class="nav-link dropdown-toggle btn btn-link" id="languages-menu" role="button"
112
126
  data-bs-toggle="dropdown" aria-expanded="false">
127
+ <span class="language-indicator-text">{{ current_language }}</i>
113
128
  <i class="fi fi-{{ current_flag }}"></i>
114
129
  </button>
115
130
  <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="languages-menu">
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "platzky"
3
- version = "0.2.8"
3
+ version = "0.2.10"
4
4
  description = "Not only blog engine"
5
5
  authors = []
6
6
  license = "MIT"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes