diff options
| author | 2021-03-26 14:40:59 +0800 | |
|---|---|---|
| committer | 2021-03-26 14:40:59 +0800 | |
| commit | 494c63a51a778253e8f90868338d42bd41a700a9 (patch) | |
| tree | b48cf80d9b5af914e058d5bd0c616f81972e040b /pydis_site/templates/content | |
| parent | Merge pull request #427 from python-discord/ks123/dewikification/event-pages (diff) | |
| parent | Remove guide reference to `markdown2`. (diff) | |
Merge pull request #393 from ks129/guides-app
Dewikification - Create content app
Diffstat (limited to 'pydis_site/templates/content')
| -rw-r--r-- | pydis_site/templates/content/base.html | 36 | ||||
| -rw-r--r-- | pydis_site/templates/content/listing.html | 27 | ||||
| -rw-r--r-- | pydis_site/templates/content/page.html | 31 | 
3 files changed, 94 insertions, 0 deletions
| diff --git a/pydis_site/templates/content/base.html b/pydis_site/templates/content/base.html new file mode 100644 index 00000000..19eec5d4 --- /dev/null +++ b/pydis_site/templates/content/base.html @@ -0,0 +1,36 @@ +{% extends 'base/base.html' %} +{% load static %} + +{% block title %}{{ page_title }}{% endblock %} +{% block head %} +    <meta property="og:title" content="Python Discord - {{ page_title }}" /> +    <meta property="og:type" content="website" /> +    <meta property="og:description" content="{{ page_description }}" /> +    <link rel="stylesheet" href="{% static "css/content/page.css" %}"> +{% endblock %} + +{% block content %} +    {% include "base/navbar.html" %} + +    <section class="breadcrumb-section section"> +        <div class="container"> +            <nav class="breadcrumb is-pulled-left" aria-label="breadcrumbs"> +                <ul> +                    {% for item in breadcrumb_items %} +                        <li><a href="{% url "content:page_category" location=item.path %}">{{ item.name }}</a></li> +                    {% endfor %} +                    <li class="is-active"><a href="#">{{ page_title }}</a></li> +                </ul> +            </nav> +        </div> +    </section> + +    <section class="section"> +        <div class="container"> +            <div class="content"> +                <h1 class="title">{{ page_title }}</h1> +                {% block page_content %}{% endblock %} +            </div> +        </div> +    </section> +{% endblock %} diff --git a/pydis_site/templates/content/listing.html b/pydis_site/templates/content/listing.html new file mode 100644 index 00000000..6de306b0 --- /dev/null +++ b/pydis_site/templates/content/listing.html @@ -0,0 +1,27 @@ +{% extends 'content/base.html' %} + +{% block page_content %} +    {% for category, data in categories.items %} +        <div class="box" style="max-width: 800px;"> +            <span class="icon is-size-4 is-medium"> +                <i class="fas fa-folder is-size-3 is-black has-icon-padding" aria-hidden="true"></i> +            </span> + +            <a href="{% url "content:page_category" location=path|add:category %}"> +                <span class="is-size-4 has-text-weight-bold">{{ data.name }}</span> +            </a> +            <p class="is-italic">{{ data.description }}</p> +        </div> +    {% endfor %} +    {% for page, data in pages.items %} +        <div class="box" style="max-width: 800px;"> +            <span class="icon is-size-4 is-medium"> +                <i class="{{ data.icon_class|default:"fab" }} {{ data.icon|default:"fa-python" }} is-size-3 is-black has-icon-padding" aria-hidden="true"></i> +            </span> +            <a href="{% url "content:page_category" location=path|add:page %}"> +                <span class="is-size-4 has-text-weight-bold">{{ data.title }}</span> +            </a> +            <p class="is-italic">{{ data.description }}</p> +        </div> +    {% endfor %} +{% endblock %} diff --git a/pydis_site/templates/content/page.html b/pydis_site/templates/content/page.html new file mode 100644 index 00000000..06d74208 --- /dev/null +++ b/pydis_site/templates/content/page.html @@ -0,0 +1,31 @@ +{% extends 'content/base.html' %} + +{% block head %} +    {{ block.super }} +    <link rel="stylesheet" +      href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.1/styles/atom-one-dark-reasonable.min.css"> +    <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.1/highlight.min.js"></script> +    <script>hljs.initHighlightingOnLoad();</script> +{% endblock %} + +{% block page_content %} +    {% if relevant_links|length > 0 %} +        <div class="columns is-variable is-8"> +            <div class="column is-two-thirds"> +                {{ page|safe }} +            </div> +            <div class="column"> +                <div class="box"> +                    <p class="menu-label">Relevant links</p> +                    <ul class="menu-list"> +                        {% for value, link in relevant_links.items %} +                            <li><a class="has-text-link" href="{{link}}">{{ value }}</a></li> +                        {% endfor %} +                    </ul> +                </div> +            </div> +        </div> +    {% else %} +        <div>{{ page|safe }}</div> +    {% endif %} +{% endblock %} | 
