Skip to content

Commit

Permalink
Merge pull request #35 from StackTipsLab/feature/layout-improvements
Browse files Browse the repository at this point in the history
Added adsense
  • Loading branch information
nilandev authored Dec 19, 2023
2 parents 64a35f6 + 0aaa1a3 commit 9334937
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 8 deletions.
Binary file modified bloggy/.DS_Store
Binary file not shown.
8 changes: 6 additions & 2 deletions bloggy/templates/pages/archive/posts.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@
{% categories_widget count=99 content_type="post" widget_style="list" %}
<div class="flex-grow-1">
<div class="row row-cols-1 row-cols-md-2 row-cols-lg-1 latest-feed-container">
{% if posts|length <= 0 %}
{% if posts|length <= 0 %}
<p class="lead my-3 text-muted">No contents found!</p>
{% endif %}
{% endif %}

{% for post in posts %}
<div class="col mb-3">
{% include "partials/post_list_item.html" with post=post cssClass="card-rounded" %}
</div>
{% if forloop.counter == 3 %}
{% include "widgets/ad-unit-in-feed.html" %}
{% endif %}
{% if forloop.counter == 2 %}
{% include "partials/course_row_grid.html" with courses=courses %}
{% endif %}

Expand All @@ -32,6 +35,7 @@
</main>
<aside id="sidebar-right" class="flex-filled col-md-3">
<div class="sidebar-content sticky-top" style="z-index: 99">
{% include 'widgets/ad-unit-vertical-responsive.html' %}
{% include 'partials/newsletter.html' %}
</div>
</aside>
Expand Down
1 change: 1 addition & 0 deletions bloggy/templates/pages/search_result.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ <h3 class="h4 fw-normal mb-0 result-heading">{{ post.title | highlight_search:se
</main>

<aside id="sidebar-right" class="col-md-4">
{% include 'widgets/ad-unit-vertical-responsive.html' %}
<div class="bordered my-4">
{% include "errors/error_page_links.html" %}
</div>
Expand Down
2 changes: 1 addition & 1 deletion bloggy/templates/pages/single/course.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ <h3 class=""><a href="{% url 'lesson_single' course=course.slug slug=lesson.slug
</main>

<aside id="right-sidebar" class="col-12 col-md-3 col-lg-3 d-print-none">

{% include 'widgets/ad-unit-vertical-responsive.html' %}
</aside>
</div>
{% endwith %}
Expand Down
1 change: 1 addition & 0 deletions bloggy/templates/pages/single/lesson.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<aside id="right-sidebar" class="col-12 col-md-3 col-lg-3 d-print-none">
<div class="sidebar-content" style="z-index: 99">
{% include 'partials/lesson_single_toc.html' %}
{% include 'widgets/ad-unit-vertical-responsive.html' %}
{% include 'partials/video_widget.html' %}
{% include "partials/home_widget_contribute_cta.html" %}
{% include 'partials/newsletter.html' %}
Expand Down
13 changes: 11 additions & 2 deletions bloggy/templates/pages/single/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
{% spaceless %}
{% block content %}
{% include 'partials/home_article_breadcrumb.html' %}
<div class="container mt-3">
{% include 'widgets/ad-unit-horizontal-responsive.html' %}
</div>
<div class="container mt-lg-5 mt-md-3">
<div class="row">
<main id="main-content" class="hero col-12 col-md-9 col-lg-9 col-print-12 pe-lg-2">
Expand All @@ -27,7 +30,8 @@
<div class="flex-grow-1" style="overflow: hidden">
<div class="article-details-card mb-4 me-lg-3">
<div class="padding-medium relative">
<h1 class="display-2 fw-600" style="line-height: 1.2;letter-spacing: -0.055rem">{{ post.title }}</h1>
<h1 class="display-2 fw-600"
style="line-height: 1.2;letter-spacing: -0.055rem">{{ post.title }}</h1>

{% if post.thumbnail and post.template_type == "cover" %}
<div class="article-single-thumbnails my-4">
Expand Down Expand Up @@ -57,18 +61,21 @@ <h1 class="display-2 fw-600" style="line-height: 1.2;letter-spacing: -0.055rem">
</article>
{% include "partials/social_share.html" with object=post authorName=post.author.get_full_name_or_username %}
{% include 'partials/author_widget.html' with author=post.author %}

{% comment %}<section id="vueRoot" class="d-print-none my-5">
<comments post-id="{{ post.id }}" post-type="{{ post.post_type }}" current-user="{{ user }}"></comments>
</section>{% endcomment %}
</div>
</div>
</div>
</div>


</main>

<aside id="right-sidebar" class="col-12 col-md-3 col-lg-3 d-print-none">
{% include 'partials/video_widget.html' %}
{% include 'widgets/ad-unit-vertical-responsive.html' %}
{% if post %}
{% include 'partials/toc_widget.html' %}
{% include 'partials/github_widget.html' with githubLink=post.github_link %}
Expand All @@ -78,8 +85,10 @@ <h1 class="display-2 fw-600" style="line-height: 1.2;letter-spacing: -0.055rem">
{% include "partials/home_widget_contribute_cta.html" %}
{% include 'partials/newsletter.html' %}
</div>
{% include 'widgets/ad-unit-vertical-responsive.html' %}
</aside>
</div>
{% include 'widgets/ad-unit-horizontal-responsive.html' %}
</div>

<div class="bg-light border-bottom py-5">
Expand Down
2 changes: 1 addition & 1 deletion bloggy/templates/pages/single/quiz.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@

<aside id="sidebar" class="flex-filled col-12 px-3 col-md-4 pt-0">
<div class="sidebar-content sticky-top ms-lg-3" style="z-index: 99">
{% include 'widgets/ad-unit-vertical-responsive.html' %}
{% include "partials/home_widget_contribute_cta.html" %}
{% related_article_widget count=6 slug=quiz.slug widget_title='Recent posts' widget_style="list" %}
{# {% include 'partials/newsletter.html' %}#}
</div>
</aside>
</div>
Expand Down
18 changes: 18 additions & 0 deletions bloggy/templates/widgets/ad-unit-horizontal-responsive.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% if LOAD_GOOGLE_ADS %}
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5125794458843883"
crossorigin="anonymous"></script>
<!-- horizontal-ad-units -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-5125794458843883"
data-ad-slot="7213333503"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
{% else %}
<div class="d-flex align-items-center bg-light my-3" style="width:100%;height:120px;">
<small class="text-center font-xs text-muted mx-auto">AD-SPACE</small>
</div>
{% endif %}
17 changes: 17 additions & 0 deletions bloggy/templates/widgets/ad-unit-in-feed.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% if LOAD_GOOGLE_ADS %}
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5125794458843883"
crossorigin="anonymous"></script>
<ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-gt+x-w-gx+x2"
data-ad-client="ca-pub-5125794458843883"
data-ad-slot="7331401939"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
{% else %}
<div class="d-flex align-items-center bg-light my-3" style="width:100%;height:100px;">
<small class="text-center font-xs text-muted mx-auto">AD-SPACE</small>
</div>
{% endif %}
18 changes: 18 additions & 0 deletions bloggy/templates/widgets/ad-unit-vertical-responsive.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% if LOAD_GOOGLE_ADS %}
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5125794458843883"
crossorigin="anonymous"></script>
<!-- vertical-ad-units -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-5125794458843883"
data-ad-slot="6704715971"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
{% else %}
<div class="d-flex align-items-center bg-light my-3" style="width:100%;height:500px;">
<small class="text-center font-xs text-muted mx-auto">AD-SPACE</small>
</div>
{% endif %}
2 changes: 1 addition & 1 deletion bloggy_frontend/sass/content/_home.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

@media screen and (min-width: 992px) {
.latest-feed-container {
padding: 0 1rem;
padding: 0 2rem;
margin: 0 0 0 1rem;

//.col:first-child {
Expand Down
2 changes: 1 addition & 1 deletion bloggy_frontend/sass/content/post.scss
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ article {
}

.feed-card {
padding: 1rem;
padding: 1rem 0;
}

}
Expand Down

0 comments on commit 9334937

Please sign in to comment.