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

Commit

Permalink
Remove url piping, use new 11ty base plugin instead
Browse files Browse the repository at this point in the history
  • Loading branch information
jhirvioja committed Mar 9, 2024
1 parent 02c1fd1 commit e32f8fe
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 28 deletions.
4 changes: 3 additions & 1 deletion .eleventy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const eleventyNavigationPlugin = require("@11ty/eleventy-navigation");
const {documentToHtmlString} = require('@contentful/rich-text-html-renderer');
const { EleventyHtmlBasePlugin } = require("@11ty/eleventy");
const { documentToHtmlString } = require('@contentful/rich-text-html-renderer');
const { BLOCKS } = require('@contentful/rich-text-types');
const htmlmin = require("html-minifier");

Expand All @@ -22,6 +23,7 @@ module.exports = function(eleventyConfig) {
eleventyConfig.addPassthroughCopy("src/robots.txt");
eleventyConfig.addPassthroughCopy("src/manifest.json");
eleventyConfig.addPlugin(eleventyNavigationPlugin);
eleventyConfig.addPlugin(EleventyHtmlBasePlugin);
eleventyConfig.addFilter("renderRichTextAsHtml", (value) => documentToHtmlString(value));
eleventyConfig.addFilter("renderRichTextWithAssets", (value) => documentToHtmlString(value, options));

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "",
"main": "index.js",
"scripts": {
"build": "env NODE_ENV=production npx eleventy",
"build": "env NODE_ENV=production npx @11ty/eleventy --pathprefix=turkublacksox-11ty",
"serve": "npx eleventy --serve"
},
"keywords": [],
Expand Down
14 changes: 7 additions & 7 deletions src/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,30 @@
<link
rel="icon"
type="image/x-icon"
href="{{ '/img/favicon.ico' | url }}"
href="/img/favicon.ico"
/>
<link
rel="apple-touch-icon"
sizes="180x180"
href="{{ '/img/apple-touch-icon.png' | url }}"
href="/img/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="{{ '/img/favicon-32x32.png' | url }}"
href="/img/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="{{ '/img/favicon-16x16.png' | url }}"
href="/img/favicon-16x16.png"
/>
<link rel="manifest" href="{{ '/manifest.json' | url }}"/>
<link rel="manifest" href="/manifest.json"/>
<link
rel="stylesheet"
type="text/css"
href="{{ '/css/styles.css' | url }}"
href="/css/styles.css"
/>
</head>
</head>
Expand All @@ -57,7 +57,7 @@
<div class="container" style="padding: 20px; text-align: center">
<h1>404 - Sivua ei löydy</h1>
<br/>
<a href="{{ '/' | url }}">Takaisin etusivulle</a>
<a href="/">Takaisin etusivulle</a>
</div>
</main>
</body>
Expand Down
14 changes: 7 additions & 7 deletions src/_includes/layouts/base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
<meta name="description" content="Baseballia Varsinais-Suomen alueella jo vuodesta 2011. Liity mukaan!"/>
<meta name="theme-color" content="#222222"/>
<link rel="preconnect" href="//cdn.jsdelivr.net">
<link rel="stylesheet" type="text/css" href="{{ '/css/normalize.css' | url }}"/>
<link rel="stylesheet" type="text/css" href="/css/normalize.css"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="{{ '/css/styles.css' | url }}"/>
<link rel="icon" type="image/x-icon" href="{{ '/img/favicon.ico' | url }}"/>
<link rel="icon" type="image/png" sizes="32x32" href="{{ '/img/favicon-32x32.png' | url }}"/>
<link rel="icon" type="image/png" sizes="16x16" href="{{ '/img/favicon-16x16.png' | url }}"/>
<link rel="apple-touch-icon" sizes="180x180" href="{{ '/img/apple-touch-icon.png' | url }}"/>
<link rel="manifest" href="{{ '/manifest.json' | url }}"/>
<link rel="stylesheet" type="text/css" href="/css/styles.css"/>
<link rel="icon" type="image/x-icon" href="/img/favicon.ico"/>
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png"/>
<link rel="icon" type="image/png" sizes="16x16" href="/img/favicon-16x16.png"/>
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png"/>
<link rel="manifest" href="/manifest.json"/>
<link rel="prefetch" href="/info"/>
<link rel="prefetch" href="/joukkue"/>
<link rel="prefetch" href="/ottelut"/>
Expand Down
4 changes: 2 additions & 2 deletions src/_includes/layouts/nav.njk
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<span class="icon-bar"></span>
</button>
<img
src="{{ '/img/blacksox-small250.png' | url }}"
src="/img/blacksox-small250.png"
alt="Turku Black Sox Logo Small"
class="headerlogo"
style="padding: 10px;width: 150px;height: 150px"
Expand All @@ -23,7 +23,7 @@
<ul class="nav navbar-nav">
{%- for entry in collections.all | eleventyNavigation %}
<li class="{% if entry.url == page.url %}active{% endif %}">
<a href="{{ entry.url | url }}">{{ entry.title }}</a>
<a href="{{ entry.url }}">{{ entry.title }}</a>
</li>
{%- endfor %}
</ul>
Expand Down
6 changes: 3 additions & 3 deletions src/_includes/layouts/sponsors.njk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="col-md-4">
<a href="https://krktukkuri.fi/">
<img
src="{{ '/img/keijorantamo.png' | url }}"
src="/img/keijorantamo.png"
class="img-responsive"
style="width:50%;min-width:200px;margin-left:auto;margin-right:auto"
alt="Keijo Rantamo"
Expand All @@ -20,7 +20,7 @@
<div class="col-md-4">
<a href="https://www.shaveclub.fi/">
<img
src="{{ '/img/shaveclubfinland.png' | url }}"
src="/img/shaveclubfinland.png"
class="img-responsive"
style="width:50%;min-width:200px;margin-left:auto;margin-right:auto"
alt="Shave Club Finland"
Expand All @@ -33,7 +33,7 @@

<div class="col-md-4">
<a href="http://www.taloset.fi/">
<img src="{{ '/img/taloset.png' | url }}"
<img src="/img/taloset.png"
class="img-responsive"
style="width:40%;min-width:200px;margin-left:auto;margin-right:auto"
alt="Taloset"
Expand Down
12 changes: 6 additions & 6 deletions src/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ eleventyNavigation:
<div class="carousel-inner" role="tablist">
<div class="item active" role="tab" id="tab-1">
<img
src="{{ '/img/karuselli-1.webp' | url }}"
src="/img/karuselli-1.webp"
alt="Turku Black Sox player batting"
width="750px"
height="307px"
Expand All @@ -37,7 +37,7 @@ eleventyNavigation:
</div>
<div class="item" role="tab" id="tab-2">
<img
src="{{ '/img/karuselli-2.webp' | url }} "
src="/img/karuselli-2.webp"
alt="Turku Black Sox player reaching base"
width="750px"
height="307px"
Expand All @@ -51,7 +51,7 @@ eleventyNavigation:
</div>
<div class="item" role="tab" id="tab-3">
<img
src="{{ '/img/karuselli-3.webp' | url }}"
src="/img/karuselli-3.webp"
alt="Turku Black Sox team dugout"
width="750px"
height="307px"
Expand Down Expand Up @@ -102,7 +102,7 @@ eleventyNavigation:
<div class="col-md-4">
<a href="https://www.pesis.fi/baseball/kilpailu/fat-lizard-league/"
><img
src="{{ '/img/fatlizard.png' | url }}"
src="/img/fatlizard.png"
class="img-responsive"
alt="Fat Lizard League Logo"
style="width:60%;min-width:200px;margin-left:auto;margin-right:auto"
Expand All @@ -120,7 +120,7 @@ eleventyNavigation:
<div class="col-md-4">
<a href="http://www.baseball.fi/"
><img
src="{{ '/img/baseballfinland.png' | url }}"
src="/img/baseballfinland.png"
class="img-responsive"
alt="Baseball Finland Logo"
style="width:60%;min-width:200px;margin-left:auto;margin-right:auto"
Expand All @@ -138,7 +138,7 @@ eleventyNavigation:
<div class="col-md-4">
<a href="https://www.pesis.fi/"
><img
src="{{ '/img/pesapalloliitto.png' | url }}"
src="/img/pesapalloliitto.png"
class="img-responsive"
alt="Pesäpalloliitto Logo"
style="width:60%;min-width:200px;margin-left:auto;margin-right:auto"
Expand Down
2 changes: 1 addition & 1 deletion src/sitemap.njk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ eleventyExcludeFromCollections: true
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% for page in collections.all %}
<url>
<loc>https://www.turkublacksox.fi{{ site.url }}{{ page.url | url }}</loc>
<loc>https://www.turkublacksox.fi{{ site.url }}{{ page.url }}</loc>
<lastmod>{{ page.date.toISOString().slice(0,10) }}</lastmod>
</url>
{% endfor %}
Expand Down

0 comments on commit e32f8fe

Please sign in to comment.