Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Add Contentful to website build process #1204

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ on:
branches:
- main

workflow_dispatch:

jobs:
build:
name: Deploy docs
runs-on: ubuntu-latest
environment: github-pages
steps:
- name: Checkout master
uses: actions/checkout@v1
Expand All @@ -18,3 +21,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TRUFFLESUITE_COM_GH_API_USERNAME: ${{ secrets.TRUFFLESUITE_COM_GH_API_USERNAME }}
TRUFFLESUITE_COM_GH_API_KEY: ${{ secrets.TRUFFLESUITE_COM_GH_API_KEY }}
CONTENTFUL_SPACE_ID: ${{ secrets.CONTENTFUL_SPACE_ID }}
CONTENTFUL_ENVIRONMENT: ${{ secrets.CONTENTFUL_ENVIRONMENT }}
CONTENTFUL_TOKEN: ${{ secrets.CONTENTFUL_TOKEN }}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
site
src/boxes/*/
__pycache__
.DS_Store
.DS_Store
.env
src/blog
!src/blog/index.md
!src/blog/blog.html.jinja2
55 changes: 32 additions & 23 deletions custom_theme/blog.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@

{% extends "main.html" %}

{% block htmltitle %}
{% if config.extra.contentful_page.blog and config.extra.contentful_page.blog.seo %}
<title>{{config.extra.contentful_page.blog.seo.page_title}}</title>
<meta name="description" content="{{config.extra.contentful_page.blog.seo.page_description}}">
<meta property="og:site_name" content="{{config.site_name}}">
<meta property="og:url" content="{{ page.canonical_url }}">
<meta property="og:type" content="page">
<meta property="og:title" content="{{config.extra.contentful_page.blog.seo.page_title}}">
<meta property="og:description" content="{{config.extra.contentful_page.blog.seo.page_description}}">
<meta property="og:image" content="{{config.extra.contentful_page.blog.seo.featured_image.url()}}">
<meta name="twitter:url" content="{{ page.canonical_url }}">
<meta name="twitter:title" content="{{config.extra.contentful_page.blog.seo.page_title}}">
<meta name="twitter:description" content="{{config.extra.contentful_page.blog.seo.page_description}}">
<meta name="twitter:image" content="{{config.extra.contentful_page.blog.seo.featured_image.url()}}">
{% else %}
{{ super() }}
{% endif %}
{% endblock %}

<!-- Render hero under tabs -->
{% block tabs %}
{{ super() }}
Expand Down Expand Up @@ -41,30 +59,21 @@

<div class="container">
<section class="p-5">
<h1>Truffle Blog</h1>
{% for post in config.extra.posts %}
<a href="{{ post.route }}">
<div class="row pt-3 pb-3">
{% if post.image %}
<div class="col-md-3">
<img src="{{ post.image }}" class="rounded-circle img-fluid green" />
</div>
{% endif %}
<div class="col-md-9">
<h2>{{ post.title }}</h2>
<p>{{ post.date }}&nbsp;&nbsp;&nbsp;<i class="far fa-user"></i> {{ post.author }}</p>
{% if post.excerpt is not none %}
<p>{{ post.excerpt }}</p>
{% endif %}
<span class="btn btn-secondary">READ MORE</span>
</div>
</div>
</a>
{% endfor %}
<h1>{{config.extra.contentful_page.blog.title}}</h1>
{% with modules = config.extra.contentful_blogs %}
{% for module in modules %}
{% with %}
{% set props = module %}
<!-- {% set template = module.template %} -->
{% set template = config.extra.module_id_parse(module.sys['content_type'].id) %}
{% include 'partials/contentful/'+template+'.html' %}
{% endwith %}
{% endfor %}
{% endwith %}
</section>
</div>

{% endblock %}
{% endblock %}


<!-- Content -->
Expand All @@ -74,4 +83,4 @@ <h2>{{ post.title }}</h2>

{% block footer %}
{% include "partials/footer.html" %}
{% endblock %}
{% endblock %}
96 changes: 30 additions & 66 deletions custom_theme/community.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
{% extends "main.html" %}

{% block htmltitle %}
{% if config.extra.contentful_page.community and config.extra.contentful_page.community.seo %}
<title>{{config.extra.contentful_page.community.seo.page_title}}</title>
<meta name="description" content="{{config.extra.contentful_page.community.seo.page_description}}">
<meta property="og:site_name" content="{{config.site_name}}">
<meta property="og:url" content="{{ page.canonical_url }}">
<meta property="og:type" content="page">
<meta property="og:title" content="{{config.extra.contentful_page.community.seo.page_title}}">
<meta property="og:description" content="{{config.extra.contentful_page.community.seo.page_description}}">
<meta property="og:image" content="{{config.extra.contentful_page.community.seo.featured_image.url()}}">
<meta name="twitter:url" content="{{ page.canonical_url }}">
<meta name="twitter:title" content="{{config.extra.contentful_page.community.seo.page_title}}">
<meta name="twitter:description" content="{{config.extra.contentful_page.community.seo.page_description}}">
<meta name="twitter:image" content="{{config.extra.contentful_page.community.seo.featured_image.url()}}">
{% else %}
{{ super() }}
{% endif %}
{% endblock %}
<!-- Render hero under tabs -->
{% block tabs %}
{{ super() }}
Expand Down Expand Up @@ -37,73 +55,19 @@
width: 2.5rem;
max-height: 2.5rem;
}

</style>

<div class="container">
<section class="p-5">
<main role="main" class="container">
<div class="row align-items-center">
<div class="col-sm">
<h1><img class="support-heading" src="../img/support-header.svg" alt="Life Preserver" title="Support" /> COMMUNITY &amp; SUPPORT</h1>
<p class="mb-0"><strong>Help is close by!</strong> Truffle has a spectacular community of developers--the largest of any Ethereum development framework!</p>
</div>
</div>
</main>

<main class="banner banner-light-cream pt-5 pb-5">
<div class="container">
<div class="row">
<div class="col">
<div class="card">
<div class="card-body card-zendesk">
<h2>Open a Support Ticket! <span class="badge rounded-pill bg-success">NEW</span></h2>
<p>The easiest way to track your conversation and contribute to our knowledge base! Open a support ticket to begin talking to our support staff. Common questions will be added to our knowledge base to assist future Trufflers!</p>
<a href="https://trufflesuite.zendesk.com/hc/en-us/requests/new" class="btn btn-sm btn-truffle text-uppercase">Open a Support Ticket</a>
</div>
</div>

<h2 class="mt-5">A Little Help from Our Friends</h2>
<p>If you’re stuck trying to get something to work, have any questions, or suggestions, the fastest way to get help from the community. Truffle has the largest community of blockchain developers on Earth! Chat with hundreds of your fellow Trufflers on Gitter or Spectrum.</p>
<hr />
</div>
</div>

<div class="row">
<div class="col-6">
<h3>Chat on Gitter</h3>
<p class="mb-0">For a chatroom, <a class="minty" href="http://gitter.im/ConsenSys/truffle">check out Gitter</a>. It's very active; the quickest response is generally here but it's difficult to track longer threads or search.</p>
</div>

<div class="col-6">
<h3>Post on Spectrum</h3>
<p class="mb-0">For a forum, <a class="minty" href="https://spectrum.chat/trufflesuite?tab=posts">check out Spectrum</a>. Responses can be slower, but the post/response format lends itself to better tracking of your question and searchability of others.</p>
</div>
</div>

<div class="row">
<div class="col">
<h2 class="mt-5"><i class="fab fa-github"></i> Find us on GitHub!</h2>
<p>Truffle not behaving as intended? Know your issue is a bug? Want to suggest an improvement? This is the place to do it!</p>
<hr />
</div>
</div>

<div class="row">
<div class="col-6">
<h3>Submit an Issue on GitHub</h3>
<p>If something’s not working as expected, or you have an idea for a feature or change you’d like to see, please <a class="minty" href="https://github.com/trufflesuite/">open an issue</a> and start a discussion.</p>
</div>

<div class="col-6">
<h3>Help Improve the Documentation</h3>
<p>We’re only human, and need all the help you can give us to improve the documentation. If you’d like to submit any feedback or suggestions, please create a pull request on <a class="minty" href="https://github.com/trufflesuite/trufflesuite.com/">our documentation repository</a>.</p>
</div>
</div>
</div>
</main>
</section>
</div>
{% with modules = config.extra.contentful_page.community.modules %}
{% for module in modules %}
{% with %}
{% set props = module %}
<!-- {% set template = module.template %} -->
{% set template = config.extra.module_id_parse(module.sys['content_type'].id) %}
{% include 'partials/contentful/'+template+'.html' %}
{% endwith %}
{% endfor %}
{% endwith %}

{% endblock %}

Expand All @@ -114,4 +78,4 @@ <h3>Help Improve the Documentation</h3>

{% block footer %}
{% include "partials/footer.html" %}
{% endblock %}
{% endblock %}
Loading