Skip to content

Commit

Permalink
Improve metadata and blog index
Browse files Browse the repository at this point in the history
For #22 #23
  • Loading branch information
khawkins98 committed Mar 10, 2020
1 parent 839b95e commit 1b040a8
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 8 deletions.
2 changes: 1 addition & 1 deletion eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = function(config) {
// });

// Add any utiliuty filters
config.addFilter("dateDisplay", (dateObj, format = "LLL d, y") => {
config.addFilter("dateDisplay", (dateObj, format = "d LLL y") => {
return DateTime.fromJSDate(dateObj, {
zone: "utc"
}).toFormat(format);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visual-framework/vf-boilerplate-eleventy",
"version": "2.0.0-alpha.16",
"version": "2.0.0-alpha.17",
"description": "Build a site with Visual Framework components using the the Eleventy templating engine.",
"repository": {
"type": "git",
Expand Down
34 changes: 29 additions & 5 deletions src/site/_includes/layouts/base.njk
Original file line number Diff line number Diff line change
@@ -1,20 +1,45 @@
<!doctype html>
<html lang="en" class="vf-no-js">
<head>
{% render '@vf-no-js' -%}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{# <link rel="stylesheet" media="all" href="https://dev.assets.emblstatic.net/vf/develop/css/styles.css" /> #}
<link rel="stylesheet" media="all" href="{{ '/css/styles.css' | url }}" />
<title>{{ title or (renderData and renderData.title) or siteConfig.siteInformation.title}}</title>
{% render '@vf-no-js' %}
<link href="{{ siteConfig.siteInformation.url }}feed.xml" type="application/rss+xml" rel="alternate" title="{{ siteConfig.siteInformation.title }} RSS Feed">
{% render '@vf-favicon' -%}

<!-- Descriptive meta -->
<meta name="title" content="{{ title or (renderData and renderData.title) or siteConfig.siteInformation.title}}">
<meta name="author" content="{{ meta.author }}">
<meta name="robots" content="index, follow">
<meta name="keywords" content="{{ meta.keywords }}">
<meta name="description" content="{{ meta.description }}">

<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="{{ siteConfig.siteInformation.url }}{{ page.url.slice(1) }}">
<meta property="og:title" content="{{ title or (renderData and renderData.title) or siteConfig.siteInformation.title}}">
<meta property="og:description" content="{{ meta.description }}">
{% if meta.image -%}
<meta property="og:image" content="{{ meta.image | url }}">
{%- endif %}

<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="og:url" content="{{ siteConfig.siteInformation.url }}{{ page.url.slice(1) }}">
<meta property="twitter:title" content="{{ title or (renderData and renderData.title) or siteConfig.siteInformation.title}}">
<meta property="twitter:description" content="{{ meta.description }}">
{% if meta.image -%}
<meta property="twitter:image" content="{{ meta.image | url }}">
{%- endif %}

</head>
<body class="{{ bodyClass }} vf-body">
<header class="vf-global-header">

<div class="vf-global-header__inner">
{% render '@vf-logo', {href: 'https://visual-framework.github.io/vf-welcome/' | url, sreen_reader_text: 'Visual Framework 2.0', image: siteConfig.siteInformation.url + 'assets/vf-logo/assets/logo.svg' } %}
{# <a href="{{ '/' | url }}" class="vf-link | vf-global-header__site-name">{{ siteConfig.siteInformation.title }}</a> #}

<nav class="vf-navigation vf-navigation--global">
<ul class="vf-navigation__list | vf-list--inline">
<li class="vf-navigation__item">
Expand All @@ -28,7 +53,6 @@
</li>
</ul>
</nav>

</div>

</header>
Expand Down
8 changes: 7 additions & 1 deletion src/site/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ subtitle: No homepage, yet.
date: 2018-08-22 12:24:50
layout: layouts/base.njk
templateEngineOverride: njk, md
meta:
author: Page Author
image: your-image-here.png
description: "Page description"
keywords: "Tags"
---

{% render '@vf-intro', {"vf_intro_phase": "alpha", "vf_intro_heading": siteConfig.siteInformation.title,
Expand Down Expand Up @@ -51,7 +56,8 @@ templateEngineOverride: njk, md
## What you get

- the Eleventy static site generator
- access to the Visual Framework component system
- [initial templating setup]({{'posts' | url}})
- [access to the Visual Framework component system](https://visual-framework.github.io/vf-core/)

### Component installation

Expand Down
56 changes: 56 additions & 0 deletions src/site/posts/index.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: I'm a blog-like index
subtitle: This aggregates all of your posts and shows them here.
date: 2019-04-09 12:24:50
layout: layouts/base.njk
meta:
author: Page Author
image: your-image-here.png
description: "Page description"
keywords: "Tags"
---

{% render '@vf-intro', {"vf_intro_phase": "", "vf_intro_heading": title,
"vf_intro_lede": subtitle,
"vf_intro_text": [
""
]
} %}


<section class="embl-grid embl-grid--has-centered-content">
<div>
<!-- empty -->
</div>
<div class="">
{%- for post in collections.posts %}
<article class="vf-summary vf-summary--news">
<span class="vf-summary__date">22 June 2018</span>
<img class="vf-summary__image" src="{{ post.data.meta.image | url }}" alt="">
<h3 class="vf-summary__title">
<a href="{{ post.url }}" class="vf-summary__link">{{ post.data.title }}</a>
</h3>
<p class="vf-summary__text">
{{ post.data.subtitle }}
</p>
</article>
{%- endfor %}
</div>
<div></div>
</section>

<hr class="vf-divider" />

<section class="embl-grid embl-grid--has-centered-content">
<div>
<!-- empty -->
</div>
<div class="vf-content">
{% markdown %}

Need more text?

{% endmarkdown %}
</div>
<div></div>
</section>
6 changes: 6 additions & 0 deletions src/site/posts/sample-post.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
---
title: I'm an update
subtitle: I'm a subtitle or summary
date: 2019-04-09 12:24:50
tags: posts
layout: layouts/post.njk
meta:
author: Page Author
image: /images/test-image.png
description: "Page description"
keywords: "Tags"
---

I'm some content.
Expand Down

0 comments on commit 1b040a8

Please sign in to comment.