Skip to content

Commit

Permalink
Tailwind css
Browse files Browse the repository at this point in the history
  • Loading branch information
nilandev committed Dec 17, 2023
1 parent cb71afa commit b94df20
Show file tree
Hide file tree
Showing 17 changed files with 532 additions and 299 deletions.
Binary file modified .DS_Store
Binary file not shown.
6 changes: 3 additions & 3 deletions bloggy/templates/base-with-header-footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
</noscript>
<!-- End Google Tag Manager (noscript) -->
<header id="layout-header" class="sticky-top d-print-none">
{% include "partials/header.html" %}
{% include "partials/header2.html" %}
</header>
<div class="d-none d-print-block text-center py-5">
{% comment %}<div class="d-none d-print-block text-center py-5">
<a href="{% url 'index' %}">
<img src="{% static 'media/logo.png' %}" alt="StackTips" width="auto" height="80"
style="box-shadow: 5px 15px 15px rgb(89 152 152 / 5%);">
</a>
</div>
</div>{% endcomment %}
<main>
{% if messages %}
<div class="col-lg-5 mx-auto">
Expand Down
3 changes: 2 additions & 1 deletion bloggy/templates/base-with-header.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
</noscript>
<!-- End Google Tag Manager (noscript) -->
<header id="layout-header" class="sticky-top d-print-none">
{% include "partials/header.html" %}
{# {% include "partials/header.html" %}#}
{% include "partials/header2.html" %}
</header>
<main>
{% if messages %}
Expand Down
121 changes: 72 additions & 49 deletions bloggy/templates/pages/archive/categories.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
{% load static %}
{% spaceless %}
{% block content %}
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/masonry.pkgd.min.js"
integrity="sha384-GNFwBvfVxBkLMJpYMOABq3c+d3KnQxudP/mGPkzpZSTYykLBNsZEnG2D9G/X/+7D"
crossorigin="anonymous" async></script>
{# <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/masonry.pkgd.min.js"#}
{# integrity="sha384-GNFwBvfVxBkLMJpYMOABq3c+d3KnQxudP/mGPkzpZSTYykLBNsZEnG2D9G/X/+7D"#}
{# crossorigin="anonymous" async></script>#}

<div class=" container pt-5 pb-3">

<div class="max-w-screen-xl py-4 mx-auto">
<div id="homeIntroSection" class="hero" style="max-width: 860px;margin: 0 auto;text-align: center;">
<h1 class="display-1">
Browse tutorial by <br/><span
Expand All @@ -18,55 +19,77 @@ <h1 class="display-1">
</p>
</div>
</div>
<div class="container">
<div class="row row-eq-height archive-grid pb-4" data-masonry='{"percentPosition": true }'>
{% if categories|length <= 0 %}
<p class="lead my-3 text-muted">No contents found!</p>
{% endif %}

{% for category in categories %}
<div class="col-md-3">
<div class="py-2 h-100">
<div class="h-100 article-card p-3 p-lg-4"
style="border-bottom: 3px solid {{ category.color }};">
<div class="d-flex justify-content-between flex-row mb-1">
<div class="d-flex flex-column ml-2">
<h3 class="display-5 fw-500">{{ category.title }}</h3>
<small class="d-inline-block text-muted text-uppercase fw-bold font-xs">
{{ category.article_count }} article{{ category.article_count | pluralize }}
</small>
</div>
{% if category.thumbnail %}
<div style="width:42px;
height: 42px;
background-image: url('{{ category.thumbnail.url }}');
-o-object-fit: contain;
object-fit: contain;
text-align:center;
padding: 0px;
overflow: hidden;
background-size: contain;
position: absolute;
right: 1rem;
background-repeat: no-repeat;
top: 1rem;">
</div>
{% endif %}
</div>
<div class="max-w-screen-xl py-4 mx-auto">

<div class="grid grid-cols-2 md:grid-cols-4 gap-4">
{% for category in categories %}
<a href="{% url 'categories_single' slug=category.slug %}" class="block max-w-sm p-6 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700">
<h3 class="text-lg font-semibold">{{ category.title }}</h3>
<p class="text-sm text-gray-500">
{{ category.article_count }} article{{ category.article_count | pluralize }}
</p>

{% if category.excerpt %}
<small class="text-muted fw-normal mb-0 text-ellipsis"
style="line-clamp: 6;-webkit-line-clamp: 6">{{ category.excerpt }}</small>
<p class="text-sm">{{ category.excerpt | slice:"0:120"}}..</p>
{% endif %}
</a>
{% endfor %}

<div class="d-flex justify-content-start text-muted">
<a href="{% url 'categories_single' slug=category.slug %}"
style="text-decoration: none; color: initial" class="stretched-link"></a>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>



{# <div class="max-w-screen-xl py-4 mx-auto">#}
{# <div class="flex flex-row gap-5 px-4" data-masonry='{"percentPosition": true }'>#}
{# {% if categories|length <= 0 %}#}
{# <p class="lead my-3 text-muted">No contents found!</p>#}
{# {% endif %}#}
{##}
{# {% for category in categories %}#}
{# <div class="col-md-3">#}
{# <div class="py-2 h-100">#}
{# <div class="h-100 article-card p-3 p-lg-4"#}
{# style="border-bottom: 3px solid {{ category.color }};">#}
{# <div class="d-flex justify-content-between flex-row mb-1">#}
{# <div class="d-flex flex-column ml-2">#}
{# <h3 class="display-5 fw-500">{{ category.title }}</h3>#}
{# <small class="d-inline-block text-muted text-uppercase fw-bold font-xs">#}
{# {{ category.article_count }} article{{ category.article_count | pluralize }}#}
{# </small>#}
{# </div>#}
{# {% if category.thumbnail %}#}
{# <div style="width:42px;#}
{# height: 42px;#}
{# background-image: url('{{ category.thumbnail.url }}');#}
{# -o-object-fit: contain;#}
{# object-fit: contain;#}
{# text-align:center;#}
{# padding: 0px;#}
{# overflow: hidden;#}
{# background-size: contain;#}
{# position: absolute;#}
{# right: 1rem;#}
{# background-repeat: no-repeat;#}
{# top: 1rem;">#}
{# </div>#}
{# {% endif %}#}
{# </div>#}
{# {% if category.excerpt %}#}
{# <small class="text-muted fw-normal mb-0 text-ellipsis"#}
{# style="line-clamp: 6;-webkit-line-clamp: 6">{{ category.excerpt }}</small>#}
{# {% endif %}#}
{##}
{# <div class="d-flex justify-content-start text-muted">#}
{# <a href="{% url 'categories_single' slug=category.slug %}"#}
{# style="text-decoration: none; color: initial" class="stretched-link"></a>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# {% endfor %}#}
{# </div>#}
{# </div>#}
{% endblock content %}
{% endspaceless %}
40 changes: 19 additions & 21 deletions bloggy/templates/pages/archive/posts.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,32 @@
{% spaceless %}
{% load custom_widgets %}
{% block content %}
<div class="container">
{% include "partials/category_archive_banner.html" with category=selected_category %}
<div class="row">
<main id="main-content" class="col-12 col-lg-9 py-3 py-lg-4">

<div class="d-flex bd-highlight">
<div class="max-w-screen-xl py-4 mx-auto">
<div class="flex">
<main id="main-content" class="grow flex">
<div class="flex-none">
{% 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 %}
<p class="lead my-3 text-muted">No contents found!</p>
{% endif %}
</div>

{% 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 "partials/course_row_grid.html" with courses=courses %}
{% endif %}
<div class="grow px-8">
{% if posts|length <= 0 %}
<p class="lead my-3 text-muted">No contents found!</p>
{% endif %}

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

{% endfor %}
{% include "partials/paging.html" with posts=posts %}
</div>
</main>
<aside id="sidebar-right" class="flex-filled col-md-3">
<aside id="sidebar-right" class="flex-none w-80">
<div class="sidebar-content sticky-top" style="z-index: 99">
{% include 'partials/newsletter.html' %}
</div>
Expand Down
82 changes: 42 additions & 40 deletions bloggy/templates/pages/home.html
Original file line number Diff line number Diff line change
@@ -1,55 +1,57 @@
{% extends "base-with-header-footer.html" %}
{% load custom_widgets %}
{% spaceless %}
{% load static %}
{% block content %}
{% load static %}
<section id="homeIntroSection" class="container homeIntro">
<div class="hero jumbotron py-4 px-3 py-lg-5 text-center">
<div class="container">
<h1 class="display-1 px-lg-5">
Developer Friendly Way to Learn <span class="text-gradient text-primary">Programming.</span>
</h1>
<p class="lead px-lg-5 py-2" style="max-width: 900px;margin: 0 auto">
StackTips brings developer-friendly ways to learn programming. With courses, articles, and
how-to guides, we aim to teach in the ways developers learn best.
</p>
<a class="btn btn-primary btn-lg mt-4 ms-2" href="{% url 'login' %}?next={{ request.path }}">Create
free account!</a>

<section class="bg-white dark:bg-gray-900">
<div class="py-8 px-4 mx-auto max-w-screen-xl text-center lg:py-16 lg:px-12">
<h1 class="mb-4 text-4xl font-extrabold tracking-tight leading-none text-gray-900 md:text-5xl lg:text-6xl dark:text-white">
Developer Friendly Way to Learn <span class="text-primary">Programming.</span></h1>
<p class="mb-8 text-lg font-normal text-gray-500 lg:text-xl sm:px-16 xl:px-48 dark:text-gray-400">
StackTips brings developer-friendly ways to learn programming. With courses, articles, and how-to
guides, we aim to teach in the ways developers learn best. </p>
<div class="flex flex-col mb-8 lg:mb-16 space-y-4 sm:flex-row sm:justify-center sm:space-y-0 sm:space-x-4">
<a href="{% url 'login' %}?next={{ request.path }}"
class="inline-flex justify-center items-center py-3 px-5 text-base font-medium text-center text-white rounded-lg bg-primary hover:bg-primary-800 focus:ring-4 focus:ring-primary-300 dark:focus:ring-primary-900">
Create free account!
<svg class="ml-2 -mr-1 w-5 h-5" fill="currentColor" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd"
d="M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z"
clip-rule="evenodd"></path>
</svg>
</a>
<a href="/contribute"
class="inline-flex justify-center items-center py-3 px-5 text-base font-medium text-center text-gray-900 rounded-lg border border-gray-300 hover:bg-gray-100 focus:ring-4 focus:ring-gray-100 dark:text-white dark:border-gray-700 dark:hover:bg-gray-700 dark:focus:ring-gray-800">
Become a contributor
</a>
</div>
</div>
</section>

<section class="recent-articles py-3">
<div class="container">
<h2 class="h2 py-2">Recent posts</h2>
<div class="row row-cols-1 row-cols-md-1 row-cols-lg-2 g-3">
{% if posts|length <= 0 %}
<p class="lead my-3 text-muted">No contents found!</p>
{% endif %}
<div class="max-w-screen-xl py-4 mx-auto">
<h2 class="text-2xl font-light">Recent posts</h2>
{% if posts|length <= 0 %}
<p class="lead my-3 text-muted">No contents found!</p>
{% endif %}

{% for post in posts %}
<div class="col">
{% include "partials/post_list_item.html" with post=post cssClass="card-rounded" %}
</div>
{% endfor %}
</div>
<div class="text-center mt-5">
<a href="{% url 'posts' %}" class="btn btn-lg btn-primary">View all articles&nbsp;&nbsp<span
{% for post in posts %}
{% include "partials/post_list_item.html" with post=post cssClass="card-rounded" %}
{% endfor %}
<div class="text-center mt-5">
<a href="{% url 'posts' %}"
class="justify-center items-center py-3 px-5 text-base font-normal text-center text-white rounded-lg bg-primary hover:bg-primary-800 focus:ring-4 focus:ring-primary-300 dark:focus:ring-primary-900">View
all articles&nbsp;&nbsp<span
class="tag__chevron">&#8594</span></a>
</div>
</div>
</section>

<section class="hero mt-md-3 mt-lg-5">
{% load static %}
<div class="container p-5">
<h2 class="display-3 text-center mb-5 fw-600">
Browse by <span class="text-gradient text-primary">Categories</span>
</h2>
{% categories_widget count=15 widget_style="home" %}
</div>
</section>
</div>

<div class="max-w-screen-xl py-4 mx-auto">
<h2 class="text-2xl font-light">Browse by <span class="text-primary">Categories</span></h2>
{% categories_widget count=15 widget_style="home" %}
</div>

<section class="homeCourses__section my-md-3 my-lg-5">
{% load static %}
<div class="container">
Expand Down
Loading

0 comments on commit b94df20

Please sign in to comment.