diff --git a/en/404.md b/404.md
similarity index 93%
rename from en/404.md
rename to 404.md
index 51a5e48..bd51f61 100644
--- a/en/404.md
+++ b/404.md
@@ -1,5 +1,5 @@
---
-layout: layouts/home.webc
+layout: layouts/home.njk
permalink: 404.html
eleventyExcludeFromCollections: true
---
diff --git a/README.md b/README.md
index 6441ff0..7dfd105 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# eleventy-base-blog
-A starter repository showing how to build a (multi-language friendly) blog with the [Eleventy](https://github.com/11ty/eleventy) static site generator.
+A starter repository showing how to build a blog with the [Eleventy](https://github.com/11ty/eleventy) site generator.
[![Build Status](https://travis-ci.org/11ty/eleventy-base-blog.svg?branch=master)](https://travis-ci.org/11ty/eleventy-base-blog)
@@ -33,7 +33,7 @@ git clone https://github.com/11ty/eleventy-base-blog.git my-blog-name
cd my-blog-name
```
-Specifically have a look at `.eleventy.js` to see if you want to configure any Eleventy options differently.
+Specifically have a look at `eleventy.config.js` to see if you want to configure any Eleventy options differently.
### 3. Install dependencies
@@ -63,14 +63,12 @@ DEBUG=Eleventy* npx @11ty/eleventy
### Implementation Notes
-- `en` is the folder for content (written using the primary language for project, here we’re using English)
-- `en/about/index.md` is an example of an English content page.
-- `en/blog/` has the English blog posts but really they can live in any directory. They need only the `post` tag to be included in the blog posts [collection](https://www.11ty.dev/docs/collections/).
- - To localize a blog post you will need to add a top level folder for that language (`es` for Spanish, `ja` for Japanese, `en-us` for American English) and match the rest of the file path to the primary language folder. For example `en/blog/my-post.md` could have `ja/blog/my-post.md` or `es/blog/my-post.md`. Read more about [best practices for organizing files for internationalization (i18n) in Eleventy projects](https://www.11ty.dev/docs/i18n/).
-- Use the `eleventyNavigation` key in your front matter to add a template to the top level site navigation. For example, this is in use on `index.njk` and `about/index.md`.
+- `about/index.md` is an example of a content page.
+- `blog/` has the blog posts but really they can live in any directory. They need only the `post` tag to be included in the blog posts [collection](https://www.11ty.dev/docs/collections/).
+- Use the `eleventyNavigation` key in your front matter to add a template to the top level site navigation. This is in use on `index.njk` and `about/index.md`.
- This makes use of the [Eleventy Navigation plugin](https://www.11ty.dev/docs/plugins/navigation/)
-- Content can be any template format (blog posts needn’t be markdown, for example). Configure your supported templates in `.eleventy.js` -> `templateFormats`.
-- The `public` folder in your input directory will be copied to the output folder (via `addPassthroughCopy()` in the `.eleventy.js` file). This means `./public/css/*` will live at `./_site/css/*` after your build completes. [When using `--serve` this behavior is emulated](/docs/copy/#passthrough-during-serve) (the files will not show up in `_site`).
+- Content can be any template format (blog posts needn’t be markdown, for example). Configure your supported templates in `eleventy.config.js` -> `templateFormats`.
+- The `public` folder in your input directory will be copied to the output folder (via `addPassthroughCopy` in the `eleventy.config.js` file). This means `./public/css/*` will live at `./_site/css/*` after your build completes.
- The blog post feed template is in `feed/feed.njk`. This is also a good example of using a global data files in that it uses `_data/metadata.json`.
- This project uses three layouts:
- `_includes/layouts/base.njk`: the top level HTML structure
diff --git a/_includes/components/infobox.webc b/_includes/components/infobox.webc
deleted file mode 100644
index 9160048..0000000
--- a/_includes/components/infobox.webc
+++ /dev/null
@@ -1,24 +0,0 @@
-
@@ -16,27 +15,13 @@ templateClass: tmpl-post
-{% set i18nLinks = page.url | locale_links %}
-{% if i18nLinks.length %}
-
-
- {{ "i18n.also" | i18n }}
- {%- for link in i18nLinks %}
- {{ link.label }}
- {%- if not loop.last %},{% endif %}
- {%- endfor -%}
-
-
-{% endif %}
-
{%- if collections.posts %}
-{# these filters are locale-aware in 2.0.0-canary.14 #}
{%- set previousPost = collections.posts | getPreviousCollectionItem %}
{%- set nextPost = collections.posts | getNextCollectionItem %}
{%- if nextPost or previousPost %}
{%- endif %}
{%- endif %}
diff --git a/about/index.md b/about/index.md
new file mode 100644
index 0000000..18367d8
--- /dev/null
+++ b/about/index.md
@@ -0,0 +1,9 @@
+---
+layout: layouts/base.njk
+eleventyNavigation:
+ key: About Me
+ order: 3
+---
+# About Me
+
+I am a person that writes stuff.
diff --git a/en/blog.njk b/blog.njk
similarity index 73%
rename from en/blog.njk
rename to blog.njk
index 0ea7d16..c7e04d6 100644
--- a/en/blog.njk
+++ b/blog.njk
@@ -1,10 +1,9 @@
---
-layout: layouts/home.webc
+layout: layouts/home.njk
eleventyNavigation:
- key: nav.archive
+ key: Archive
order: 2
---
-
Archive
{% set postslist = collections.posts %}
diff --git a/en/blog/blog.json b/blog/blog.json
similarity index 100%
rename from en/blog/blog.json
rename to blog/blog.json
diff --git a/en/blog/firstpost.md b/blog/firstpost.md
similarity index 93%
rename from en/blog/firstpost.md
rename to blog/firstpost.md
index ec2a42d..0557716 100644
--- a/en/blog/firstpost.md
+++ b/blog/firstpost.md
@@ -9,13 +9,11 @@ Leverage agile frameworks to provide a robust synopsis for high level overviews.
Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring.
-{{ "/" | locale_url }}
-
## Section Header
Capitalize on low hanging fruit to identify a ballpark value added activity to beta test. Override the digital divide with additional clickthroughs from DevOps. Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line.
-
+```
diff --git a/en/blog/fourthpost.md b/blog/fourthpost.md
similarity index 100%
rename from en/blog/fourthpost.md
rename to blog/fourthpost.md
diff --git a/en/blog/secondpost.md b/blog/secondpost.md
similarity index 100%
rename from en/blog/secondpost.md
rename to blog/secondpost.md
diff --git a/en/blog/thirdpost.md b/blog/thirdpost.md
similarity index 95%
rename from en/blog/thirdpost.md
rename to blog/thirdpost.md
index 7516d38..c57ab3b 100644
--- a/en/blog/thirdpost.md
+++ b/blog/thirdpost.md
@@ -8,7 +8,7 @@ tags:
---
Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment.
-
+```
Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring.
diff --git a/eleventy.config.js b/eleventy.config.js
index 2e3080f..56f1ea4 100644
--- a/eleventy.config.js
+++ b/eleventy.config.js
@@ -1,19 +1,10 @@
const { DateTime } = require("luxon");
-const rosetta = require("rosetta");
const markdownItAnchor = require("markdown-it-anchor");
const pluginRss = require("@11ty/eleventy-plugin-rss");
const pluginSyntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
const pluginNavigation = require("@11ty/eleventy-navigation");
-const pluginWebc = require("@11ty/eleventy-plugin-webc");
-
-const {
- EleventyRenderPlugin,
- EleventyI18nPlugin,
- EleventyHtmlBasePlugin
-} = require("@11ty/eleventy");
-
-const languageStrings = require("./i18n.js");
+const { EleventyHtmlBasePlugin } = require("@11ty/eleventy");
module.exports = function(eleventyConfig) {
eleventyConfig.ignores.add("README.md");
@@ -22,23 +13,18 @@ module.exports = function(eleventyConfig) {
// For example, `./public/css/` ends up in `_site/css/`
eleventyConfig.addPassthroughCopy({
"./public/": "/",
+ "./node_modules/prismjs/themes/prism-okaidia.css": "/css/prism-okaidia.css"
});
+ // If your passthrough copy gets heavy and cumbersome, add this line
+ // to emulate the file copy on the dev server. Learn more: https://www.11ty.dev/docs/copy/#emulate-passthrough-copy-during-serve
+ // eleventyConfig.setServerPassthroughCopyBehavior("passthrough");
+
// Add plugins
eleventyConfig.addPlugin(pluginRss);
eleventyConfig.addPlugin(pluginSyntaxHighlight);
eleventyConfig.addPlugin(pluginNavigation);
eleventyConfig.addPlugin(EleventyHtmlBasePlugin);
- eleventyConfig.addPlugin(EleventyRenderPlugin);
-
- eleventyConfig.addPlugin(pluginWebc, {
- components: "./_includes/components/**/*.webc"
- });
-
- eleventyConfig.addPlugin(EleventyI18nPlugin, {
- defaultLanguage: "en",
- errorMode: "allow-fallback",
- });
eleventyConfig.addFilter("readableDate", (dateObj, format = "dd LLLL yyyy") => {
return DateTime.fromJSDate(dateObj, {zone: 'utc'}).toFormat(format);
@@ -79,7 +65,7 @@ module.exports = function(eleventyConfig) {
return (tags || []).filter(tag => ["all", "nav", "post", "posts"].indexOf(tag) === -1);
});
- // Customize Markdown library and settings:
+ // Customize Markdown library settings:
eleventyConfig.amendLibrary("md", mdLib => {
mdLib.use(markdownItAnchor, {
permalink: markdownItAnchor.permalink.ariaHidden({
@@ -88,28 +74,10 @@ module.exports = function(eleventyConfig) {
symbol: "#",
}),
level: [1,2,3,4],
- slugify: eleventyConfig.getFilter("slug")
+ slugify: eleventyConfig.getFilter("slugify")
});
});
- // Override @11ty/eleventy-dev-server defaults (used only with --serve)
- eleventyConfig.setServerOptions({
- showVersion: true,
- });
-
- // i18n filter using Rosetta
- const rosettaLib = rosetta(languageStrings);
-
- eleventyConfig.addFilter("i18n", function (key, lang) {
- const I18N_PREFIX = "i18n.";
- if(key.startsWith(I18N_PREFIX)) {
- key = key.slice(I18N_PREFIX.length);
- }
- // depends on page.lang in 2.0.0-canary.14+
- let page = this.page || this.ctx?.page || this.context?.environments?.page || {};
- return rosettaLib.t(key, {}, lang || page.lang);
- });
-
return {
// Control which files Eleventy will process
// e.g.: *.md, *.njk, *.html, *.liquid
@@ -126,20 +94,6 @@ module.exports = function(eleventyConfig) {
// Pre-process *.html files with: (default: `liquid`)
htmlTemplateEngine: "njk",
- // -----------------------------------------------------------------
- // If your site deploys to a subdirectory, change `pathPrefix`.
- // Don’t worry about leading and trailing slashes, we normalize these.
-
- // If you don’t have a subdirectory, use "" or "/" (they do the same thing)
- // This is only used for link URLs (it does not affect your file structure)
- // Best paired with the `url` filter: https://www.11ty.dev/docs/filters/url/
-
- // You can also pass this in on the command line using `--pathprefix`
-
- // Optional (default is shown)
- pathPrefix: "/",
- // -----------------------------------------------------------------
-
// These are all optional (defaults are shown):
dir: {
input: ".",
@@ -147,5 +101,19 @@ module.exports = function(eleventyConfig) {
data: "_data",
output: "_site"
}
+
+ // -----------------------------------------------------------------
+ // Optional:
+
+ // If your site deploys to a subdirectory, change `pathPrefix`.
+ // Read more: https://www.11ty.dev/docs/config/#deploy-to-a-subdirectory-with-a-path-prefix
+
+ // When paired with the HTML plugin https://www.11ty.dev/docs/plugins/html-base/
+ // it will transform any absolute URLs in your HTML to include this
+ // folder name and does **not** affect where things go in the output folder.
+
+ // Optional (default is shown)
+ // pathPrefix: "/",
+ // -----------------------------------------------------------------
};
};
diff --git a/en/about/index.md b/en/about/index.md
deleted file mode 100644
index f9b74ce..0000000
--- a/en/about/index.md
+++ /dev/null
@@ -1,11 +0,0 @@
----
-layout: layouts/base.njk
-title: About Me
-templateClass: tmpl-post
-eleventyNavigation:
- key: nav.about
- order: 3
----
-#
-
-I am a person that writes stuff.
diff --git a/en/en.11tydata.js b/en/en.11tydata.js
deleted file mode 100644
index 77633c0..0000000
--- a/en/en.11tydata.js
+++ /dev/null
@@ -1,11 +0,0 @@
-module.exports = {
- lang: "en",
- permalink: function(data) {
- // Change (English) /en/blog/my-post URLs to have an implied language code /blog/my-post URLs instead.
- let [slashPrefixEmpty, langCode, ...stem] = data.page.filePathStem.split("/");
- let path = stem.join("/");
-
- // Account for `permalink: 404.html` style
- return stem[stem.length - 1] === "index" ? `${path}.html` : `${path}/index.html`;
- }
-}
diff --git a/en/index.njk b/en/index.njk
deleted file mode 100644
index 947702e..0000000
--- a/en/index.njk
+++ /dev/null
@@ -1,22 +0,0 @@
----
-layout: layouts/home.webc
-eleventyNavigation:
- key: i18n.nav.home
- order: 1
----
-{% set maxPosts = collections.posts.length | min(3) %}
-
-#}
diff --git a/es/blog/fourthpost.md b/es/blog/fourthpost.md
deleted file mode 100644
index 6c3c565..0000000
--- a/es/blog/fourthpost.md
+++ /dev/null
@@ -1,14 +0,0 @@
----
-title: Esta es mi cuarta publicación.
-slugOverride: cuarta publicación
-date: 2018-09-30
-layout: layouts/post.njk
----
-Aproveche los marcos ágiles para proporcionar una sinopsis sólida para descripciones generales de alto nivel. Los enfoques iterativos de la estrategia corporativa fomentan el pensamiento colaborativo para promover la propuesta de valor general. Hacer crecer orgánicamente la visión holística del mundo de la innovación disruptiva a través de la diversidad y el empoderamiento en el lugar de trabajo.
-
-Traiga a la mesa estrategias de supervivencia de ganar-ganar para asegurar una dominación proactiva. Al final del día, en el futuro, una nueva normalidad que ha evolucionado desde la generación X está en camino hacia una solución de nube optimizada. El contenido generado por el usuario en tiempo real tendrá múltiples puntos de contacto para la deslocalización.
-
-## Encabezado de sección
-
-Saque provecho de la fruta al alcance de la mano para identificar una actividad de valor agregado de estadio de béisbol para la prueba beta. Supere la brecha digital con clics adicionales de DevOps. La inmersión en nanotecnología a lo largo de la autopista de la información cerrará el círculo centrándose únicamente en el resultado final.
-
diff --git a/es/blog/thirdpost.md b/es/blog/thirdpost.md
deleted file mode 100644
index 23690e2..0000000
--- a/es/blog/thirdpost.md
+++ /dev/null
@@ -1,24 +0,0 @@
----
-title: Esta es mi tercer publicación.
-date: 2018-09-30
-layout: layouts/post.njk
----
-Aproveche los marcos ágiles para proporcionar una sinopsis sólida para descripciones generales de alto nivel. Los enfoques iterativos de la estrategia corporativa fomentan el pensamiento colaborativo para promover la propuesta de valor general. Hacer crecer orgánicamente la visión holística del mundo de la innovación disruptiva a través de la diversidad y el empoderamiento en el lugar de trabajo.
-
-```js
-// this is a command
-function myCommand() {
- let counter = 0;
- counter++;
-}
-
-// Test with a line break above this line.
-console.log('Test');
-```
-
-Traiga a la mesa estrategias de supervivencia de ganar-ganar para asegurar una dominación proactiva. Al final del día, en el futuro, una nueva normalidad que ha evolucionado desde la generación X está en camino hacia una solución de nube optimizada. El contenido generado por el usuario en tiempo real tendrá múltiples puntos de contacto para la deslocalización.
-
-## Encabezado de sección
-
-Saque provecho de la fruta al alcance de la mano para identificar una actividad de valor agregado de estadio de béisbol para la prueba beta. Supere la brecha digital con clics adicionales de DevOps. La inmersión en nanotecnología a lo largo de la autopista de la información cerrará el círculo centrándose únicamente en el resultado final.
-
diff --git a/es/es.11tydata.js b/es/es.11tydata.js
deleted file mode 100644
index 4267c79..0000000
--- a/es/es.11tydata.js
+++ /dev/null
@@ -1,11 +0,0 @@
-module.exports = {
- "lang": "es",
- "permalink": function(data) {
- // Slug override is set in the post for localized URL slugs
- // e.g. /es/blog/fourthpost.md will optionally write to
- // /es/blog/cuarta-publicacion/ instead of /es/blog/fourth-post/
- if(data.slugOverride) {
- return `/${data.lang}/blog/${this.slugify(data.slugOverride)}/`;
- }
- }
-}
diff --git a/i18n.js b/i18n.js
deleted file mode 100644
index 3feb584..0000000
--- a/i18n.js
+++ /dev/null
@@ -1,22 +0,0 @@
-module.exports = {
- en: {
- also: "This page is also available in:",
- previous: "Previous",
- next: "Next",
- nav: {
- home: "Home",
- archive: "Archive",
- about: "About Me",
- }
- },
- es: {
- also: "Esta página también está disponible en:",
- previous: "Anterior",
- next: "Siguiente",
- nav: {
- home: "Página de inicio",
- archive: "Archivo",
- about: "Acerca de mí",
- }
- }
-};
diff --git a/index.njk b/index.njk
new file mode 100644
index 0000000..193f0e6
--- /dev/null
+++ b/index.njk
@@ -0,0 +1,26 @@
+---
+layout: layouts/home.njk
+eleventyNavigation:
+ key: Home
+ order: 1
+---
+{% set postsCount = collections.posts | length %}
+{% set latestPostsCount = postsCount | min(3) %}
+