Skip to content

Commit

Permalink
…Aaand adding the actual head changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
eaton committed Nov 25, 2020
1 parent 52aaf0d commit 100b9db
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .eleventy.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
const pluginRss = require('@11ty/eleventy-plugin-rss')
const pluginNavigation = require('@11ty/eleventy-navigation')
const tufteWrapper = require('./util/tufteWrapper')
const linkToHead = require("./util/linkToHead");

module.exports = function (eleventyConfig) {
// Plugins
eleventyConfig.addPlugin(pluginRss)
eleventyConfig.addPlugin(pluginNavigation)


eleventyConfig.addFilter("linkToHead", linkToHead);

// Asset Watch Targets
eleventyConfig.addWatchTarget('./src/assets')

Expand Down
23 changes: 14 additions & 9 deletions src/_includes/head.njk
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
<!-- Required meta tags -->
{% set metaTitle = page.title or meta.title %}
{% set metaDescription = page.description or meta.description %}
{% set metaDescription = page.subtitle or meta.subtitle %}

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

<title>{{ metaTitle }}</title>
<meta name="description" content="{{ metaDescription }}">
<title>{{ metaTitle | markdownInline | striptags }}</title>
<meta name="description" content="{{ metaDescription | markdownInline | striptags }}">
<link type="application/atom+xml" rel="alternate" href="{{ meta.url }}/feed.xml" title="{{ meta.title }}">

{% set css = '/assets/tufte-css' %}
<link rel="preload" as="font" type="font/woff2" crossorigin href="{{ css }}/et-book/et-book-roman-line-figures/et-book-roman-line-figures.woff" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="{{ css }}/et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.woff" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="{{ css }}/et-book/et-book-bold-line-figures/et-book-bold-line-figures.woff" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="{{ css }}/et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.woff" />
<link rel="stylesheet" href="{{ css }}/tufte.min.css">
<link rel="preload" as="font" type="font/woff2" crossorigin href="/assets/tufte-css/et-book/et-book-roman-line-figures/et-book-roman-line-figures.woff" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="/assets/tufte-css/et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.woff" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="/assets/tufte-css/et-book/et-book-bold-line-figures/et-book-bold-line-figures.woff" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="/assets/tufte-css/et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.woff" />

<link rel="stylesheet" href="/assets/main.css">
<link rel="stylesheet" href="/assets/tufte-css/tufte.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/3434e84155.css">

{% if attachments %}{{ attachments | linkToHead | safe }}{% endif %}
{% if libraries %}{{ libraries | linkToHead | safe }}{% endif %}

0 comments on commit 100b9db

Please sign in to comment.