From 2a7fb8b8b29e72bc7f8fa9cebb3f813a94f7f4d2 Mon Sep 17 00:00:00 2001 From: shgn Date: Sat, 9 Jun 2018 16:25:11 +0430 Subject: [PATCH 1/4] adding simple language support. --- README.md | 1 + blo/blog.py | 2 +- blo/page_generator.py | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5557400..3729fd9 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ Create a new blog: Create a new page or post: blo post hello-world + blo post about --type page You can also use pipe with your favorite editor: diff --git a/blo/blog.py b/blo/blog.py index 9472a37..db797cc 100644 --- a/blo/blog.py +++ b/blo/blog.py @@ -15,7 +15,7 @@ from http.server import SimpleHTTPRequestHandler from http.server import HTTPServer -from .page_generator import PageGenerator +from page_generator import PageGenerator diff --git a/blo/page_generator.py b/blo/page_generator.py index a71e7dd..01c16c6 100644 --- a/blo/page_generator.py +++ b/blo/page_generator.py @@ -4,6 +4,7 @@ import codecs import os from datetime import datetime +from pprint import pprint import jinja2 import markdown @@ -70,7 +71,7 @@ def _generate_html_tag_pages(self, tag): items_pages = [] for page_number, item_set in enumerate(pages): page_vars = { - 'page_title': "Posts with tag '{0}'".format(tag), + 'page_title': self.config['lang'][self.config['site']['lang']]['Posts_with_tag']+" '{0}'".format(tag), 'tag': tag, 'page_items': item_set, 'page_number': page_number, From d4070ce024786d282571c907067a747848571077 Mon Sep 17 00:00:00 2001 From: Sajjad Shahcheraghian Date: Tue, 18 Aug 2020 18:59:05 +0430 Subject: [PATCH 2/4] finalizing the Farsi lang feature --- blo/default.json | 12 +++++++++++- setup.py | 6 +++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/blo/default.json b/blo/default.json index 207d2f4..dd243fa 100644 --- a/blo/default.json +++ b/blo/default.json @@ -15,5 +15,15 @@ } }, "date_format": "%Y-%m-%d %H:%M", - "items_per_page": 12 + "items_per_page": 12, + "lang":{ + "fa":{ + "Posts_with_tag": "پستهای تگ شده با ", + "List_of_tags": "لیست تگها" + }, + "en":{ + "Posts_with_tag":"Posts with tag ", + "List_of_tags": "List of tags" + } + } } diff --git a/setup.py b/setup.py index 1fc37cf..ad0b0b1 100644 --- a/setup.py +++ b/setup.py @@ -5,8 +5,8 @@ name='blo', version='0.6', license='BSD-3-clause', - author='Yann Savuir', - author_email='savuir@gmail.com', + author='Sajjad Shahcheraghian', + author_email='shgninc@gmail.com', packages=find_packages(), entry_points={ 'console_scripts': [ @@ -16,7 +16,7 @@ install_requires=['jinja2', 'markdown', 'PyRSS2Gen'], package_data={'': ['blo/default.json', 'blo/draft_templates.json',]}, include_package_data=True, - url='https://github.com/savuir/blo', # use the URL to the github repo + url='https://github.com/shgninc/blo', # use the URL to the github repo download_url='https://github.com/savuir/blo/tarball/0.1', # I'll explain this in a second keywords=['blogging', 'blog', 'static blog generator'], # arbitrary keywords ) From 8df94fc10488d6f09c8d9254e7783f8174477e22 Mon Sep 17 00:00:00 2001 From: Sajjad Shahcheraghian Date: Thu, 27 Aug 2020 17:29:52 +0430 Subject: [PATCH 3/4] adding dynamic scroll back top page button javascript feature --- blo/templates/base.html | 139 +++++++++++++++++++++++++++------------- 1 file changed, 96 insertions(+), 43 deletions(-) diff --git a/blo/templates/base.html b/blo/templates/base.html index 3bdbfa0..7b5e8e2 100644 --- a/blo/templates/base.html +++ b/blo/templates/base.html @@ -1,88 +1,141 @@ - + {% block title %}{% endblock %} - - + + - + - - - -
-
+
+
{% block content %} {% endblock %}
-
-
-
-
+
+
+
+
- Technical blog - + Technical blog +
- {% if site_footer_links %} - See also -
    - {% for title, link in site_footer_links.items() %} + {% if site_footer_links %} + See also +
      + {% for title, link in site_footer_links.items() %}
    • {{ title }}
    • - {% endfor %} -
    - {% endif %} + {% endfor %} +
+ {% endif %}
-

{{ site_url }} © 2015

+

{{ site_url }} © 2015

-
-
+
+ + + + + + + - - - + + + \ No newline at end of file From fb2bce8d271aaae633b02d8d3ca17b9fd5342767 Mon Sep 17 00:00:00 2001 From: Sajjad Shahcheraghian Date: Thu, 17 Sep 2020 19:53:54 +0430 Subject: [PATCH 4/4] upgrade bootstrap from 3.3.6 to 3.4.1 --- blo/templates/base.html | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/blo/templates/base.html b/blo/templates/base.html index 7b5e8e2..165b57c 100644 --- a/blo/templates/base.html +++ b/blo/templates/base.html @@ -11,8 +11,8 @@ - + @@ -109,10 +109,9 @@ - - - +