From dd127ace35c39f599fc133ce7829a63e08fa8efe Mon Sep 17 00:00:00 2001 From: samaradel Date: Thu, 13 Jul 2023 16:14:21 +0300 Subject: [PATCH] fixs --- content/buynow/index.md | 2 +- templates/_default/base.html | 2 +- templates/blogPage.html | 93 ++++++++++++++++++++----- templates/partials/blogPosts.html | 12 ++-- templates/partials/featuredBlog.html | 57 ++++++++------- templates/partials/postCard.html | 100 ++++++++++++++++++--------- 6 files changed, 185 insertions(+), 81 deletions(-) diff --git a/content/buynow/index.md b/content/buynow/index.md index 5d9dfbc..d313e62 100644 --- a/content/buynow/index.md +++ b/content/buynow/index.md @@ -33,7 +33,7 @@ Pre-order **OurPhone™** and become one of the firsts to unlock a secured d ||| -![image](./img/3nodes.png) +![image](./img/3NODES.png) diff --git a/templates/_default/base.html b/templates/_default/base.html index 9a6d25a..b359405 100644 --- a/templates/_default/base.html +++ b/templates/_default/base.html @@ -5,7 +5,7 @@ {% include "partials/header.html" %} -
+
{% block content %}{% endblock %}
{% include "partials/footer.html" %} diff --git a/templates/blogPage.html b/templates/blogPage.html index 9fafb30..e5decb9 100644 --- a/templates/blogPage.html +++ b/templates/blogPage.html @@ -1,23 +1,82 @@ {% extends "_default/base.html" %} {% block content %} +{% if page.taxonomies.people %} +{% set people = get_section(path="people/_index.md") %} +{% set pages_str = people.pages | json_encode() | as_str %} +{% if pages_str is containing(page.taxonomies.people[0]) %} +{% set author_path = 'people/' ~ page.taxonomies.people[0] ~ '/index.md' %} +{% set author = get_page(path=author_path) %} +{% endif %} +{% endif %} + -
-
- -
-
-

- {{ page.title }} -

-

-

- - {{ page.content | safe }} -
-
-
-
+{% set split = page.content | split(pat="threefold.io") %} +{% if split | length < 2 %} {% set content=page.content %} {% else %} {% set content="" %} {% for part in split %} {% if + part is starting_with("/blog") %} {% set split_part=part | split(pat='/">' ) %} {% set link=split_part[0] %} {% set + link=link | replace(from="/blog/post" , to="/blog" ) %} {% set link=link | replace(from="_" , to="-" ) %} {% set + rest_part=split_part | slice(start=1) | join(sep='/"' ) %} {% set part=link ~ '/">' ~ rest_part %} {% endif %} {% if + loop.first %} {% set_global content=part%} {% else %} {% set_global content=content ~ "threefold.io" ~ part%} {% endif + %} {% endfor %} {% endif %}
-{% endblock content %} \ No newline at end of file +
+ +
+
+

+ {{ page.title }} +

+ +

+ {{ page.description }} +

+ + {% set img_url = get_url(path='/' ~ page.relative_path | replace(from='_', to='-') | replace(from='index.md', + to=page.extra.imgPath)) %} + {{page.title ~ 'Picture'}} +
{{ content | safe }}
+
+
+ + +
+
+ + {% endblock content %} \ No newline at end of file diff --git a/templates/partials/blogPosts.html b/templates/partials/blogPosts.html index a5b299a..f220970 100644 --- a/templates/partials/blogPosts.html +++ b/templates/partials/blogPosts.html @@ -1,13 +1,13 @@ {% block content %} -
+

{% set path_array = current_path | split(pat="/") %} {% set taxonomy = path_array[1] %} {% set category = path_array[2] %} - The Latest from ThreeFold + The Latest from OurPhone {% if taxonomy == "categories" %} - {{category | replace(from='-', to=' ' ) | title}} {% endif %} @@ -15,9 +15,9 @@
{%- for post in paginator.pages %} - {% if "Engineering" == "Engineering"%} + {% if not post.extra.hidden %} {% include "partials/postCard.html" %} - {%endif%} {%- endfor %} + {%endif%} {%- endfor %}

@@ -67,4 +67,4 @@

-{% endblock content %} +{% endblock content %} \ No newline at end of file diff --git a/templates/partials/featuredBlog.html b/templates/partials/featuredBlog.html index 80d2320..26731ef 100644 --- a/templates/partials/featuredBlog.html +++ b/templates/partials/featuredBlog.html @@ -1,29 +1,36 @@ - - -
-
-

FEATURED POST

- -

- {{ featured.title }} -

-
-

- {{featured.description}} -

- -

- {{ featured.date | date(format="%B %e, %Y", timezone="America/Chicago")}} - - {{ featured.extra.author }} -

- -
+{% if featured.taxonomies.people %} + {% set people = get_section(path="people/_index.md") %} + {% set pages_str = people.pages | json_encode() | as_str %} + {% if pages_str is containing(featured.taxonomies.people[0]) %} + {% set author_path = 'people/' ~ featured.taxonomies.people[0] ~ '/index.md' %} + {% set author = get_page(path=author_path) %} + {% endif %} +{% endif %} + + + +
+
+

FEATURED POST

+ +

+ {{ featured.title }} +

+
+

+ {{ featured.date | date(format="%B %e, %Y", timezone="America/Chicago")}} - +

-
- -
+
+ +
-
- \ No newline at end of file + +
+ +
+
+ \ No newline at end of file diff --git a/templates/partials/postCard.html b/templates/partials/postCard.html index 9cf0a57..b70123c 100644 --- a/templates/partials/postCard.html +++ b/templates/partials/postCard.html @@ -1,37 +1,75 @@ +{% if post.date %} +{% if post.taxonomies.people %} +{% set people = get_section(path="people/_index.md") %} +{% set pages_str = people.pages | json_encode() | as_str %} +{% if pages_str is containing(post.taxonomies.people[0]) %} +{% set author_path = 'people/' ~ post.taxonomies.people[0] ~ '/index.md' %} +{% set author = get_page(path=author_path) %} +{% set content = get_page(path=author_path) %} +{% endif %} +{% endif %} +
-
- -
-
-
- -

- {{ post.title }} -

- {% if post.description %} -

- {{ post.description }} +

+ + {% if post.extra.imgPath %} + {% set img_url = get_url(path='/' ~ post.relative_path | replace(from='_', to='-') | replace(from='index.md', + to=post.extra.imgPath)) %} +
+ {{post.title ~ ' Picture'}} +
+ {%endif%} +
-
-
-

- {{ post.extra.author }} -

-
- - - · - - - 6 min read - + + +
+
+
+
+
    + {% if author %} + {% set author_img = get_url(path='/' ~ author.relative_path | replace(from='_', to='-') | + replace(from='index.md', to=author.extra.imgPath)) %} +
  • {{author.title}}
  • + {% endif %} +
+
+
+ {% if author %} +

{{ author.title }}

+ {% endif %} +

+ +

+

+

+
+
+
-
-
+
+ +
+
+ + +{% endif %} \ No newline at end of file