Skip to content

Commit

Permalink
feat(/partners/silicon/intel): Build page (#1484)
Browse files Browse the repository at this point in the history
* feat(/partners/intel): Build page

* chore(sitemap.xml): Add /partners/silicon/intel

* chore(test_routes.py): Add /partners/silicon/intel

* refactor: Use flask directory nesting to define url paths and remove unused python

* feat(_breadcrumbs.html): Allow breadcrumbs jinja module to consume any number of breadcrumbs

* refactor(/partners/silicon/intel): Remove partners footer

* fix(/partners/silicon/intel): Add absolute path for urls pointing to ubuntu.com
  • Loading branch information
petesfrench committed Jan 14, 2025
1 parent 077fbdf commit fee7c7f
Show file tree
Hide file tree
Showing 19 changed files with 2,365 additions and 1,237 deletions.
226 changes: 122 additions & 104 deletions templates/blog/article.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{% extends "base_index.html" %}

{% block title %}{{ article.title.rendered|safe }}{% endblock %}

{% block meta_description %}{{ article.excerpt.raw }}{% endblock %}
{% block body_class %}is-paper blog-article{% endblock body_class %}

{% block body_class %}
is-paper blog-article
{% endblock body_class %}

{% block meta_image %}{{ article.image.source_url }}{% endblock %}

{%- block canonical_url -%}
Expand All @@ -21,127 +26,140 @@

{% block extra_metatags %}

<script type="application/ld+json">
{
"@context": "http://schema.org",
"@id": "https://canonical.com/#article",
"@type": "Article",
"name": "{{ article.title.renderered|safe }}",
"headline": "{{ article.excerpt.raw }}",
"author": {
"@type": "Person",
"name": "{{ article.author.name }}"
},
"datePublished": "{{ article.date_gmt }}",
{% if article.image and article.image.source_url %}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@id": "https://canonical.com/#article",
"@type": "Article",
"name": "{{ article.title.renderered|safe }}",
"headline": "{{ article.excerpt.raw }}",
"author": {
"@type": "Person",
"name": "{{ article.author.name }}"
},
"datePublished": "{{ article.date_gmt }}",
{
%
if article.image and article.image.source_url %
}
"image": "{{ article.image.source_url }}",
{% endif %}
"url": "{{ request.url }}",
"publisher": {
"@type": "Organization",
"name": "Ubuntu"
{
%
endif %
}
"url": "{{ request.url }}",
"publisher": {
"@type": "Organization",
"name": "Ubuntu"
}
}
}
</script>
{% endblock %}

{% block content %}

{% with parent_name="Blog", parent_href="/blog", title="Article" %}
{% set breadcrumbs = [{"name": "Blog", "href": "/blog"}, {"name": "Article"}] %}
{% include '/partial/_breadcrumbs.html' %}
{% endwith %}

<article class="p-block">
<header class="row">
<div class="aside col-3 col-medium-2">
<div class="p-media-object">
{% if article.author %}
{% if article.author and article.author.id == 217 %}
<img src="https://assets.ubuntu.com/v1/f16c40d0-Favicon+-+CoF.svg" class="p-media-object__image" alt="" style="align-self: center;">
{% else %}
<img src="{{ article.author.avatar_urls['96'] }}" class="p-media-object__image is-round" alt="" style="align-self: center;">
{% endif %}
{% endif %}

<div class="p-media-object__details">
<p class="u-no-margin--bottom">
<article class="p-block">
<header class="row">
<div class="aside col-3 col-medium-2">
<div class="p-media-object">
{% if article.author %}
<span class="p-heading--5">
<a href="/blog/author/{{ article.author.slug }}" title="More about {{ article.author.name }}">{{ article.author.name }}</a>
</span>
<br>
{% if article.author and article.author.id == 217 %}
<img src="https://assets.ubuntu.com/v1/f16c40d0-Favicon+-+CoF.svg"
class="p-media-object__image"
alt=""
style="align-self: center" />
{% else %}
<img src="{{ article.author.avatar_urls['96'] }}"
class="p-media-object__image is-round"
alt=""
style="align-self: center" />
{% endif %}
<span>on {{ article.date }}</span>
</p>
{% endif %}

<div class="p-media-object__details">
<p class="u-no-margin--bottom">
{% if article.author %}
<span class="p-heading--5">
<a href="/blog/author/{{ article.author.slug }}"
title="More about {{ article.author.name }}">{{ article.author.name }}</a>
</span>
<br />
{% endif %}
<span>on {{ article.date }}</span>
</p>
</div>
</div>
</div>
</div>
<div class="p-block col-9 col-medium-4">
<div class="p-block">
<h1>{{ article.title.rendered|safe }}</h1>
</div>

{% if tags %}
<div class="p-block col-9 col-medium-4">
<div class="p-block">
{% for tag in tags %}
<a class="p-chip--information" href="/blog/tag/{{ tag.slug }}">
<span class="p-chip__value">
{{ tag.name }}
</span>
</a>
{% endfor %}
<h1>{{ article.title.rendered|safe }}</h1>
</div>
{% endif %}

<ul class="p-inline-list">
<li class="p-inline-list__item">
<span class="p-text--default">
Share on:
</span>
<li class="p-inline-list__item">
<a class="p-icon--facebook" title="Share on Facebook" href="https://www.facebook.com/sharer/sharer.php?u=https://www.canonical.com/blog/{{ article.slug }}">
Facebook
</a>
</li>
<li class="p-inline-list__item">
<a class="p-icon--twitter" title="Share on Twitter" href="https://twitter.com/share?text={{ article.title.rendered|safe|urlencode }}&amp;url=https://www.canonical.com/blog/{{ article.slug }}&amp;hashtags=ubuntu">
Twitter
</a>
</li>
<li class="p-inline-list__item">
<a class="p-icon--linkedin" title="Share on LinkedIn" href="https://www.linkedin.com/shareArticle?mini=true&amp;url=https://www.canonical.com/blog/{{ article.slug }}&amp;title={{ article.title.rendered|safe|urlencode }}">
LinkedIn
</a>
</li>
</ul>
</div>
</header>
<hr class="p-rule is-fixed-width">
<div class="row">
<aside class="aside col-3 col-medium-2">
<div class="p-section">
<div class="p-block">
<hr class="p-rule u-hide--medium u-hide--large">
<h2 class="p-muted-heading">Newsletter signup</h2>
{% if tags %}
<div class="p-block">
{% for tag in tags %}
<a class="p-chip--information" href="/blog/tag/{{ tag.slug }}">
<span class="p-chip__value">{{ tag.name }}</span>
</a>
{% endfor %}
</div>
{% endif %}

<ul class="p-inline-list">
<span class="p-text--default">Share on:</span>
<li class="p-inline-list__item">
<a class="p-icon--facebook"
title="Share on Facebook"
href="https://www.facebook.com/sharer/sharer.php?u=https://www.canonical.com/blog/{{ article.slug }}">
Facebook
</a>
</li>
<li class="p-inline-list__item">
<a class="p-icon--twitter"
title="Share on Twitter"
href="https://twitter.com/share?text={{ article.title.rendered|safe|urlencode }}&amp;url=https://www.canonical.com/blog/{{ article.slug }}&amp;hashtags=ubuntu">
Twitter
</a>
</li>
<li class="p-inline-list__item">
<a class="p-icon--linkedin"
title="Share on LinkedIn"
href="https://www.linkedin.com/shareArticle?mini=true&amp;url=https://www.canonical.com/blog/{{ article.slug }}&amp;title={{ article.title.rendered|safe|urlencode }}">
LinkedIn
</a>
</li>
</ul>
</div>
</header>
<hr class="p-rule is-fixed-width" />
<div class="row">
<aside class="aside col-3 col-medium-2">
<div class="p-section">
<div class="p-block">
<hr class="p-rule u-hide--medium u-hide--large" />
<h2 class="p-muted-heading">Newsletter signup</h2>
</div>
{% include 'blog/newsletter-form.html' %}
</div>
{% include 'blog/newsletter-form.html' %}
</aside>
<section class="p-section col-6 col-medium-4">
{{ article.content.rendered|safe }}
</section>
</div>
</article>

{% if related_articles %}
<section class="p-section">
<div class="u-fixed-width">
<h4 class="p-muted-heading">Related posts</h4>
</div>
</aside>
<section class="p-section col-6 col-medium-4">
{{ article.content.rendered|safe }}
{% for article in related_articles %}
{% include 'blog/blog-card.html' %}
{% endfor %}
</section>
</div>
</article>

{% if related_articles %}
<section class="p-section">
<div class="u-fixed-width">
<h4 class="p-muted-heading">Related posts</h4>
</div>
{% for article in related_articles %}
{% include 'blog/blog-card.html' %}
{% endfor %}
</section>
{% endif %}
{% endif %}

{% endblock %}
108 changes: 58 additions & 50 deletions templates/blog/author.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,68 +2,76 @@

{% block title %}Blog posts written by {{ author.name }}{% endblock %}

{% block description %}{% if author.id == 217 %}Canonical produces Ubuntu, provides commercial services for Ubuntu's users, and works with hardware manufacturers, software vendors and cloud partners to certify Ubuntu.{% else %}{{ author.description|safe }}{% endif %}{% endblock %}
{% block description %}
{% if author.id == 217 %}
Canonical produces Ubuntu, provides commercial services for Ubuntu's users, and works with hardware manufacturers, software vendors and cloud partners to certify Ubuntu.
{% else %}
{{ author.description|safe }}
{% endif %}
{% endblock %}

{% block body_class %}is-paper{% endblock body_class %}
{% block body_class %}
is-paper
{% endblock body_class %}

{% block content %}

{% with parent_name="Blog", parent_href="/blog", title=author.name %}
{% set breadcrumbs = [
{"name": "Blog", "href": "/blog"},
{"name": author.name}
] %}
{% include '/partial/_breadcrumbs.html' %}
{% endwith %}

<section class="p-strip">
<div class="row p-section">
<div class="col-3 col-medium-2 u-hide--small">
<div class="p-image-wrapper">
{% if author.id != 217 %}
<img src="{{ author.avatar_urls['96'] }}" alt="{{ author.name }}">
{% endif %}
<section class="p-strip">
<div class="row p-section">
<div class="col-3 col-medium-2 u-hide--small">
<div class="p-image-wrapper">
{% if author.id != 217 %}<img src="{{ author.avatar_urls['96'] }}" alt="{{ author.name }}" />{% endif %}
</div>
</div>
</div>
<div class="col-6 col-start-large-4 col-medium-4 col-start-medium-3 col-small-4">
<h1>{{ author.name }}</h1>
<p class="p-muted-heading">{{ total_posts }} posts </p>

{% if author.user_job_title %}
<h2>{{ author.user_job_title }}</h2>
{% endif %}
<div class="col-6 col-start-large-4 col-medium-4 col-start-medium-3 col-small-4">
<h1>{{ author.name }}</h1>
<p class="p-muted-heading">{{ total_posts }} posts</p>

{% if author.id == 217 %}
<p>Canonical produces Ubuntu, provides commercial services for Ubuntu's users, and works with hardware manufacturers, software vendors and cloud partners to certify Ubuntu.</p>
{% elif author.description %}
<p>{{ author.description | safe }}</p>
{% endif %}
{% if author.user_job_title %}<h2>{{ author.user_job_title }}</h2>{% endif %}

<ul class="p-inline-list u-no-margin--bottom">
{% if author.user_twitter %}
<li class="p-inline-list__item">
<a href="https://twitter.com/{{ author.user_twitter }}"><i class="p-icon--twitter"></i></a>
</li>
{% if author.id == 217 %}
<p>
Canonical produces Ubuntu, provides commercial services for Ubuntu's users, and works with hardware manufacturers, software vendors and cloud partners to certify Ubuntu.
</p>
{% elif author.description %}
<p>{{ author.description | safe }}</p>
{% endif %}

{% if author.user_facebook %}
<li class="p-inline-list__item">
<a href="https://www.facebook.com/{{ author.user_facebook }}"><i class="p-icon--facebook"></i></a>
</li>
{% endif %}
</ul>

<ul class="p-inline-list u-no-margin--bottom">
{% if author.user_twitter %}
<li class="p-inline-list__item">
<a href="https://twitter.com/{{ author.user_twitter }}"><i class="p-icon--twitter"></i></a>
</li>
{% endif %}

{% if author.user_facebook %}
<li class="p-inline-list__item">
<a href="https://www.facebook.com/{{ author.user_facebook }}"><i class="p-icon--facebook"></i></a>
</li>
{% endif %}
</ul>
</div>
</div>
</div>
</section>
</section>

<section class="p-section">
{% for article in articles %}
{% include 'blog/blog-card.html' %}
{% endfor %}
</section>
<section class="p-section">
{% for article in articles %}
{% include 'blog/blog-card.html' %}
{% endfor %}
</section>

<section class="p-section">
{% with %}
{% set total_pages = total_pages %}
{% set current_page = current_page %}
{% include "shared/_pagination.html" %}
{% endwith %}
</section>
<section class="p-section">
{% with %}
{% set total_pages = total_pages %}
{% set current_page = current_page %}
{% include "shared/_pagination.html" %}
{% endwith %}
</section>

{% endblock %}
Loading

0 comments on commit fee7c7f

Please sign in to comment.