From 92f6f7c8c5b622b081afba52a34c11df0893d979 Mon Sep 17 00:00:00 2001 From: Nicolas Doby Date: Fri, 14 Oct 2022 17:14:38 +0200 Subject: [PATCH] feat: first commit --- .editorconfig | 9 ++ .gitignore | 5 + .nojekyll | 0 .nvmrc | 1 + README.md | 80 ++++++++++++ _data/metadata.json | 6 + _includes/layouts/base.njk | 50 ++++++++ _includes/layouts/home.njk | 5 + _includes/layouts/post.njk | 42 +++++++ _includes/postslist.njk | 20 +++ eleventy.config.js | 140 +++++++++++++++++++++ feed/feed.11tydata.js | 3 + feed/feed.njk | 27 ++++ feed/json.njk | 29 +++++ fr/404.md | 17 +++ fr/about/index.md | 11 ++ fr/blog.njk | 10 ++ fr/blog/blog.json | 5 + fr/blog/fourthpost.md | 15 +++ fr/blog/new_post.md | 42 +++++++ fr/blog/nouveau_post.md | 27 ++++ fr/blog/nouveau_post2.md | 27 ++++ fr/blog/secondpost.md | 18 +++ fr/blog/thirdpost.md | 27 ++++ fr/fr.11tydata.js | 11 ++ fr/index.njk | 22 ++++ fr/tags-list.njk | 12 ++ fr/tags.njk | 22 ++++ i18n.js | 12 ++ package.json | 24 ++++ public/css/index.css | 249 +++++++++++++++++++++++++++++++++++++ public/css/prism-diff.css | 45 +++++++ public/img/.gitkeep | 0 public/img/favicon.svg | 1 + public/img/logo.svg | 1 + sitemap/sitemap.xml.njk | 21 ++++ 36 files changed, 1036 insertions(+) create mode 100644 .editorconfig create mode 100644 .gitignore create mode 100644 .nojekyll create mode 100644 .nvmrc create mode 100644 README.md create mode 100644 _data/metadata.json create mode 100644 _includes/layouts/base.njk create mode 100644 _includes/layouts/home.njk create mode 100644 _includes/layouts/post.njk create mode 100644 _includes/postslist.njk create mode 100644 eleventy.config.js create mode 100644 feed/feed.11tydata.js create mode 100755 feed/feed.njk create mode 100644 feed/json.njk create mode 100644 fr/404.md create mode 100644 fr/about/index.md create mode 100644 fr/blog.njk create mode 100644 fr/blog/blog.json create mode 100644 fr/blog/fourthpost.md create mode 100644 fr/blog/new_post.md create mode 100644 fr/blog/nouveau_post.md create mode 100644 fr/blog/nouveau_post2.md create mode 100644 fr/blog/secondpost.md create mode 100644 fr/blog/thirdpost.md create mode 100644 fr/fr.11tydata.js create mode 100644 fr/index.njk create mode 100644 fr/tags-list.njk create mode 100644 fr/tags.njk create mode 100644 i18n.js create mode 100644 package.json create mode 100644 public/css/index.css create mode 100644 public/css/prism-diff.css create mode 100644 public/img/.gitkeep create mode 100644 public/img/favicon.svg create mode 100644 public/img/logo.svg create mode 100644 sitemap/sitemap.xml.njk diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..d415404 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +charset = utf-8 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d1aa60a --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.idea +*iml +_site/ +node_modules/ +package-lock.json diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..b6a7d89 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +16 diff --git a/README.md b/README.md new file mode 100644 index 0000000..6441ff0 --- /dev/null +++ b/README.md @@ -0,0 +1,80 @@ +# 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. + +[![Build Status](https://travis-ci.org/11ty/eleventy-base-blog.svg?branch=master)](https://travis-ci.org/11ty/eleventy-base-blog) + +## Demos + +- [Netlify](https://eleventy-base-blog.netlify.com/) +- [GitHub Pages](https://11ty.github.io/eleventy-base-blog/) +- [Remix on Glitch](https://glitch.com/~11ty-eleventy-base-blog) + +## Deploy this to your own site + +Deploy this Eleventy site in just a few clicks on these services: + +- [Get your own Eleventy web site on Netlify](https://app.netlify.com/start/deploy?repository=https://github.com/11ty/eleventy-base-blog) +- [Get your own Eleventy web site on Vercel](https://vercel.com/import/project?template=11ty%2Feleventy-base-blog) + +Or, read more about [Deploying an Eleventy project](https://www.11ty.dev/docs/deployment/). + +## Getting Started + +### 1. Clone this Repository + +``` +git clone https://github.com/11ty/eleventy-base-blog.git my-blog-name +``` + +### 2. Navigate to the directory + +``` +cd my-blog-name +``` + +Specifically have a look at `.eleventy.js` to see if you want to configure any Eleventy options differently. + +### 3. Install dependencies + +``` +npm install +``` + +### 4. Edit \_data/metadata.json + +### 5. Run Eleventy + +``` +npx @11ty/eleventy +``` + +Or build and host locally for local development + +``` +npx @11ty/eleventy --serve +``` + +Or in debug mode: + +``` +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`. + - 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`). +- 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 + - `_includes/layouts/home.njk`: the home page template (wrapped into `base.njk`) + - `_includes/layouts/post.njk`: the blog post template (wrapped into `base.njk`) +- `_includes/postslist.njk` is a Nunjucks include and is a reusable component used to display a list of all the posts. `index.njk` has an example of how to use it. + diff --git a/_data/metadata.json b/_data/metadata.json new file mode 100644 index 0000000..05c4774 --- /dev/null +++ b/_data/metadata.json @@ -0,0 +1,6 @@ +{ + "title": "Blog IT's on us", + "url": "https://blog.itsonus.fr/", + "language": "fr", + "description": "Blog traitant de numérique responsable" +} diff --git a/_includes/layouts/base.njk b/_includes/layouts/base.njk new file mode 100644 index 0000000..cf1778c --- /dev/null +++ b/_includes/layouts/base.njk @@ -0,0 +1,50 @@ + + + + + + {{ title or metadata.title }} + + + {#- Uncomment this if you’d like folks to know that you used Eleventy to build your site! #} + + + + + + + + + + {%- set alternateUrls = page.url | locale_links %} + {% if alternateUrls.length %} + + {%- for link in alternateUrls %} + + {%- endfor %} + {%- endif %} + + +
+
+ + {#- Read more about `eleventy-navigation` at https://www.11ty.dev/docs/plugins/navigation/ #} + +
+
+ + + {{ content | safe }} + + +
+ +{# #} + + diff --git a/_includes/layouts/home.njk b/_includes/layouts/home.njk new file mode 100644 index 0000000..ebba6b3 --- /dev/null +++ b/_includes/layouts/home.njk @@ -0,0 +1,5 @@ +--- +layout: layouts/base.njk +templateClass: tmpl-home +--- +{{ content | safe }} diff --git a/_includes/layouts/post.njk b/_includes/layouts/post.njk new file mode 100644 index 0000000..b4049d7 --- /dev/null +++ b/_includes/layouts/post.njk @@ -0,0 +1,42 @@ +--- +layout: layouts/base.njk +templateClass: tmpl-post +--- +

{{ title }}

+ + + +{{ content | safe }} + +
+ +{% set i18nLinks = page.url | locale_links %} +{% if i18nLinks.length %} + +{% 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/_includes/postslist.njk b/_includes/postslist.njk new file mode 100644 index 0000000..5a18bd5 --- /dev/null +++ b/_includes/postslist.njk @@ -0,0 +1,20 @@ +{% for post in postslist | reverse %} + +{% endfor %} diff --git a/eleventy.config.js b/eleventy.config.js new file mode 100644 index 0000000..28a142e --- /dev/null +++ b/eleventy.config.js @@ -0,0 +1,140 @@ +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 { EleventyI18nPlugin, EleventyHtmlBasePlugin } = require("@11ty/eleventy"); + +const languageStrings = require("./i18n.js"); + +module.exports = function(eleventyConfig) { + eleventyConfig.ignores.add("README.md"); + + // Copy the contents of the `public` folder to the output folder + // For example, `./public/css/` ends up in `_site/css/` + eleventyConfig.addPassthroughCopy({ + "./public/": "/", + "./node_modules/prismjs/themes/prism-okaidia.css": "/css/prism-theme.css", + }); + + // Add plugins + eleventyConfig.addPlugin(pluginRss); + eleventyConfig.addPlugin(pluginSyntaxHighlight); + eleventyConfig.addPlugin(pluginNavigation); + eleventyConfig.addPlugin(EleventyHtmlBasePlugin); + + eleventyConfig.addPlugin(EleventyI18nPlugin, { + defaultLanguage: "fr", + errorMode: "allow-fallback", + }); + + eleventyConfig.addFilter("readableDate", (dateObj, format = "dd LLLL yyyy") => { + return DateTime.fromJSDate(dateObj, {zone: 'utc', locale: 'fr'}).toFormat(format); + }); + + // https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-date-string + eleventyConfig.addFilter('htmlDateString', (dateObj) => { + return DateTime.fromJSDate(dateObj, {zone: 'utc', locale: 'fr'}).toFormat('yyyy-LL-dd'); + }); + + // Get the first `n` elements of a collection. + eleventyConfig.addFilter("head", (array, n) => { + if(!Array.isArray(array) || array.length === 0) { + return []; + } + if( n < 0 ) { + return array.slice(n); + } + + return array.slice(0, n); + }); + + // Return the smallest number argument + eleventyConfig.addFilter("min", (...numbers) => { + return Math.min.apply(null, numbers); + }); + + // Return all the tags used in a collection + eleventyConfig.addFilter("getAllTags", collection => { + let tagSet = new Set(); + for(let item of collection) { + (item.data.tags || []).forEach(tag => tagSet.add(tag)); + } + return Array.from(tagSet); + }); + + eleventyConfig.addFilter("filterTagList", function filterTagList(tags) { + return (tags || []).filter(tag => ["all", "nav", "post", "posts"].indexOf(tag) === -1); + }); + + // Customize Markdown library and settings: + eleventyConfig.amendLibrary("md", mdLib => { + mdLib.use(markdownItAnchor, { + permalink: markdownItAnchor.permalink.ariaHidden({ + placement: "after", + class: "direct-link", + symbol: "#", + }), + level: [1,2,3,4], + slugify: eleventyConfig.getFilter("slug") + }); + }); + + // 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 + templateFormats: [ + "md", + "njk", + "html", + "liquid" + ], + + // Pre-process *.md files with: (default: `liquid`) + markdownTemplateEngine: "njk", + + // 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: ".", + includes: "_includes", + data: "_data", + output: "_site" + } + }; +}; diff --git a/feed/feed.11tydata.js b/feed/feed.11tydata.js new file mode 100644 index 0000000..f3e7f32 --- /dev/null +++ b/feed/feed.11tydata.js @@ -0,0 +1,3 @@ +module.exports = { + eleventyExcludeFromCollections: true +} diff --git a/feed/feed.njk b/feed/feed.njk new file mode 100755 index 0000000..7b41d07 --- /dev/null +++ b/feed/feed.njk @@ -0,0 +1,27 @@ +--- +# Metadata comes from _data/metadata.json +permalink: /feed/feed.xml +--- + + + {{ metadata.title }} + {{ metadata.description }} + + + {{ collections.posts | getNewestCollectionItemDate | dateToRfc3339 }} + {{ metadata.url }} + + {{ metadata.author.name }} + {{ metadata.author.email }} + + {%- for post in collections.posts | reverse %} + {% set absolutePostUrl %}{{ post.url | htmlBaseUrl(metadata.url) }}{% endset %} + + {{ post.data.title }} + + {{ post.date | dateToRfc3339 }} + {{ absolutePostUrl }} + {{ post.templateContent | transformWithHtmlBase(absolutePostUrl, post.url) }} + + {%- endfor %} + diff --git a/feed/json.njk b/feed/json.njk new file mode 100644 index 0000000..0f1b135 --- /dev/null +++ b/feed/json.njk @@ -0,0 +1,29 @@ +--- +# Metadata comes from _data/metadata.json +permalink: /feed/feed.json +--- +{ + "version": "https://jsonfeed.org/version/1.1", + "title": "{{ metadata.title }}", + "language": "{{ metadata.language }}", + "home_page_url": "{{ metadata.url | addPathPrefixToFullUrl }}", + "feed_url": "{{ permalink | htmlBaseUrl(metadata.url) }}", + "description": "{{ metadata.description }}", + "author": { + "name": "{{ metadata.author.name }}", + "url": "{{ metadata.author.url }}" + }, + "items": [ + {%- for post in collections.posts | reverse %} + {%- set absolutePostUrl = post.url | htmlBaseUrl(metadata.url) %} + { + "id": "{{ absolutePostUrl }}", + "url": "{{ absolutePostUrl }}", + "title": "{{ post.data.title }}", + "content_html": {% if post.templateContent %}{{ post.templateContent | transformWithHtmlBase(absolutePostUrl, post.url) | dump | safe }}{% else %}""{% endif %}, + "date_published": "{{ post.date | dateToRfc3339 }}" + } + {% if not loop.last %},{% endif %} + {%- endfor %} + ] +} diff --git a/fr/404.md b/fr/404.md new file mode 100644 index 0000000..bbedc2e --- /dev/null +++ b/fr/404.md @@ -0,0 +1,17 @@ +--- +layout: layouts/home.njk +permalink: 404.html +eleventyExcludeFromCollections: true +--- +# Content not found. + +Go home. + +{# +Read more: https://www.11ty.dev/docs/quicktips/not-found/ + +This will work for both GitHub pages and Netlify: + +* https://help.github.com/articles/creating-a-custom-404-page-for-your-github-pages-site/ +* https://www.netlify.com/docs/redirects/#custom-404 +#} diff --git a/fr/about/index.md b/fr/about/index.md new file mode 100644 index 0000000..a48155e --- /dev/null +++ b/fr/about/index.md @@ -0,0 +1,11 @@ +--- +layout: layouts/base.njk +title: À propos +templateClass: tmpl-post +eleventyNavigation: + key: nav.about + order: 3 +--- +# {{ title }} + +Visitez notre site [IT's on us](https://www.itsonus.fr). diff --git a/fr/blog.njk b/fr/blog.njk new file mode 100644 index 0000000..c44c7ef --- /dev/null +++ b/fr/blog.njk @@ -0,0 +1,10 @@ +--- +layout: layouts/home.njk +eleventyNavigation: + key: nav.archive + order: 2 +--- +

Archive

+ +{% set postslist = collections.posts %} +{% include "postslist.njk" %} diff --git a/fr/blog/blog.json b/fr/blog/blog.json new file mode 100644 index 0000000..17f25d5 --- /dev/null +++ b/fr/blog/blog.json @@ -0,0 +1,5 @@ +{ + "tags": [ + "posts" + ] +} diff --git a/fr/blog/fourthpost.md b/fr/blog/fourthpost.md new file mode 100644 index 0000000..d1db37a --- /dev/null +++ b/fr/blog/fourthpost.md @@ -0,0 +1,15 @@ +--- +title: This is my fourth post +description: This is a post on My Blog about touchpoints and circling wagons. +date: 2018-09-30 +tags: second tag +layout: layouts/post.njk +--- +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. + +## 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/fr/blog/new_post.md b/fr/blog/new_post.md new file mode 100644 index 0000000..5556bc6 --- /dev/null +++ b/fr/blog/new_post.md @@ -0,0 +1,42 @@ +--- +title: Tout premier post +description: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. +date: 2022-10-14 +tags: + - demo + - easy +layout: layouts/post.njk +--- + +## Introduction + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Semper quis lectus nulla at volutpat. Est pellentesque elit ullamcorper dignissim cras tincidunt lobortis feugiat. Duis tristique sollicitudin nibh sit amet commodo nulla facilisi. Enim diam vulputate ut pharetra sit amet. Placerat orci nulla pellentesque dignissim. Gravida rutrum quisque non tellus. Condimentum mattis pellentesque id nibh tortor id aliquet lectus proin. Diam sollicitudin tempor id eu nisl nunc mi ipsum faucibus. Tempor id eu nisl nunc mi. Cras pulvinar mattis nunc sed blandit libero volutpat sed cras. Eget magna fermentum iaculis eu non diam phasellus. Est lorem ipsum dolor sit amet consectetur adipiscing. Orci porta non pulvinar neque laoreet suspendisse interdum consectetur. Velit scelerisque in dictum non consectetur a. Lectus sit amet est placerat. Viverra aliquet eget sit amet tellus cras adipiscing enim eu. Ut tristique et egestas quis ipsum suspendisse ultrices. Bibendum est ultricies integer quis auctor elit. Aliquam sem et tortor consequat id porta nibh. + +Sollicitudin nibh sit amet commodo nulla facilisi nullam vehicula ipsum. Habitant morbi tristique senectus et netus. Id venenatis a condimentum vitae sapien pellentesque habitant morbi tristique. Orci porta non pulvinar neque laoreet suspendisse interdum. Cursus risus at ultrices mi tempus. Hendrerit gravida rutrum quisque non tellus orci ac auctor. Nibh tellus molestie nunc non blandit massa. Amet mattis vulputate enim nulla. Gravida cum sociis natoque penatibus. At tellus at urna condimentum. Commodo sed egestas egestas fringilla. Turpis in eu mi bibendum neque egestas congue. At erat pellentesque adipiscing commodo elit at imperdiet dui accumsan. Aliquam malesuada bibendum arcu vitae elementum curabitur. + +Massa eget egestas purus viverra. Sit amet commodo nulla facilisi. Risus sed vulputate odio ut enim blandit volutpat. Amet facilisis magna etiam tempor orci eu. Aenean sed adipiscing diam donec adipiscing tristique. Ut ornare lectus sit amet est placerat. Nulla facilisi etiam dignissim diam quis. Volutpat blandit aliquam etiam erat velit. Consectetur adipiscing elit pellentesque habitant morbi tristique senectus et netus. Cursus euismod quis viverra nibh. + +Amet tellus cras adipiscing enim eu turpis egestas pretium aenean. Aliquam sem fringilla ut morbi tincidunt. Tincidunt arcu non sodales neque sodales ut etiam sit. Lacinia quis vel eros donec ac odio tempor orci dapibus. Nunc mattis enim ut tellus. Eu lobortis elementum nibh tellus molestie nunc non. Mollis aliquam ut porttitor leo a diam. Vulputate odio ut enim blandit volutpat maecenas volutpat. Gravida quis blandit turpis cursus in. Posuere lorem ipsum dolor sit amet consectetur adipiscing elit duis. Enim facilisis gravida neque convallis a. Gravida in fermentum et sollicitudin ac orci. Bibendum at varius vel pharetra vel. Pharetra vel turpis nunc eget lorem dolor sed. Mauris pharetra et ultrices neque ornare aenean. + +Risus sed vulputate odio ut enim blandit. Et ultrices neque ornare aenean euismod elementum. Vitae sapien +pellentesque habitant morbi tristique senectus. Pretium vulputate sapien nec sagittis aliquam malesuada. Neque +volutpat ac tincidunt vitae semper quis lectus nulla. Consequat mauris nunc congue nisi vitae suscipit tellus +mauris. Tincidunt augue interdum velit euismod in pellentesque. Malesuada fames ac turpis egestas integer eget +aliquet. Hendrerit dolor magna eget est lorem ipsum dolor. Porttitor lacus luctus accumsan tortor posuere ac ut. +Gravida neque convallis a cras semper auctor neque vitae. Auctor urna nunc id cursus metus aliquam eleifend mi. Ut +etiam sit amet nisl purus in. Nascetur ridiculus mus mauris vitae ultricies leo integer malesuada. Lacus sed +turpis tincidunt id. At volutpat diam ut venenatis tellus. Tellus orci ac auctor augue mauris. + +## Exemple de code + +```diff-js + // this is a command + function myCommand() { ++ let counter = 0; +- let counter = 1; + counter++; + } + + // Test with a line break above this line. + console.log('Test'); +``` diff --git a/fr/blog/nouveau_post.md b/fr/blog/nouveau_post.md new file mode 100644 index 0000000..0837bbc --- /dev/null +++ b/fr/blog/nouveau_post.md @@ -0,0 +1,27 @@ +--- +title: This is my first post +description: This is a post on My Blog about agile frameworks. +date: 2022-10-14 +tags: + - écoconception +layout: layouts/post.njk +--- +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. + +## 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-js + // this is a command + function myCommand() { ++ let counter = 0; +- let counter = 1; + counter++; + } + + // Test with a line break above this line. + console.log('Test'); +``` diff --git a/fr/blog/nouveau_post2.md b/fr/blog/nouveau_post2.md new file mode 100644 index 0000000..419769c --- /dev/null +++ b/fr/blog/nouveau_post2.md @@ -0,0 +1,27 @@ +--- +title: Nouveau post 2 +description: This is a post on My Blog about agile frameworks. +date: 2022-10-14 +tags: + - écoconception +layout: layouts/post.njk +--- +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. + +## 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-js + // this is a command + function myCommand() { ++ let counter = 0; +- let counter = 1; + counter++; + } + + // Test with a line break above this line. + console.log('Test'); +``` diff --git a/fr/blog/secondpost.md b/fr/blog/secondpost.md new file mode 100644 index 0000000..bb31a09 --- /dev/null +++ b/fr/blog/secondpost.md @@ -0,0 +1,18 @@ +--- +title: This is my second post with a much longer title +description: This is a post on My Blog about leveraging agile frameworks. +date: 2018-07-04 +tags: + - intretien +layout: layouts/post.njk +--- +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. + +## Section Header + +First post +Third post + +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. + +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/fr/blog/thirdpost.md b/fr/blog/thirdpost.md new file mode 100644 index 0000000..199ad47 --- /dev/null +++ b/fr/blog/thirdpost.md @@ -0,0 +1,27 @@ +--- +title: This is my third post +description: This is a post on My Blog about win-win survival strategies. +date: 2018-08-24 +tags: + - second tag + - posts with two tags +layout: layouts/post.njk +--- +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. + +```js +// this is a command +function myCommand() { + let counter = 0; + counter++; +} + +// Test with a line break above this line. +console.log('Test'); +``` + +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. + +## 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/fr/fr.11tydata.js b/fr/fr.11tydata.js new file mode 100644 index 0000000..af14c94 --- /dev/null +++ b/fr/fr.11tydata.js @@ -0,0 +1,11 @@ +module.exports = { + lang: "fr", + permalink: function(data) { + // Change (Francais) /fr/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/fr/index.njk b/fr/index.njk new file mode 100644 index 0000000..c3e63e5 --- /dev/null +++ b/fr/index.njk @@ -0,0 +1,22 @@ +--- +layout: layouts/home.njk +eleventyNavigation: + key: i18n.nav.home + order: 1 +--- +{% set maxPosts = collections.posts.length | min(5) %} +

{% if maxPosts == 1 %}Article{% else %}Derniers articles{% endif %}

+ +{% set postslist = collections.posts | head(-5) %} +{% set postslistCounter = collections.posts | length %} +{% include "postslist.njk" %} + +

Consulter plus d'articles dans les archives.

+ +{# List all of the pages in the project + +#} diff --git a/fr/tags-list.njk b/fr/tags-list.njk new file mode 100644 index 0000000..5893fea --- /dev/null +++ b/fr/tags-list.njk @@ -0,0 +1,12 @@ +--- +permalink: /tags/ +layout: layouts/home.njk +--- +

Tags

+ + diff --git a/fr/tags.njk b/fr/tags.njk new file mode 100644 index 0000000..551156c --- /dev/null +++ b/fr/tags.njk @@ -0,0 +1,22 @@ +--- +pagination: + data: collections + size: 1 + alias: tag + filter: + - all + - post + - posts + - tagList + addAllPagesToCollections: true +layout: layouts/home.njk +eleventyComputed: + title: Tags “{{ tag }}” +permalink: /tags/{{ tag | slugify }}/ +--- +

#{{ tag }}

+ +{% set postslist = collections[ tag ] %} +{% include "postslist.njk" %} + +

Voir l'ensemble des tags.

diff --git a/i18n.js b/i18n.js new file mode 100644 index 0000000..bb68f1a --- /dev/null +++ b/i18n.js @@ -0,0 +1,12 @@ +module.exports = { + fr: { + also: "Cette page est aussi disponible en :", + previous: "Précédent ", + next: "Suivant ", + nav: { + home: "Accueil", + archive: "Archive", + about: "À propos", + } + } +}; diff --git a/package.json b/package.json new file mode 100644 index 0000000..3e54dc4 --- /dev/null +++ b/package.json @@ -0,0 +1,24 @@ +{ + "name": "itsonus-blog", + "version": "1.0.0", + "description": "Blog IT's on us", + "scripts": { + "build": "npx @11ty/eleventy", + "build-ghpages": "npx @11ty/eleventy --pathprefix=/itsonus-blog/", + "bench": "DEBUG=Eleventy:Benchmark* npx @11ty/eleventy", + "watch": "npx @11ty/eleventy --watch", + "serve": "npx @11ty/eleventy --serve", + "start": "npx @11ty/eleventy --serve --quiet", + "start-ghpages": "npx @11ty/eleventy --serve --quiet --pathprefix=/itsonus-blog/", + "debug": "DEBUG=Eleventy* npx @11ty/eleventy" + }, + "dependencies": { + "@11ty/eleventy": "^2.0.0-canary.15", + "@11ty/eleventy-navigation": "^0.3.5", + "@11ty/eleventy-plugin-rss": "^1.2.0", + "@11ty/eleventy-plugin-syntaxhighlight": "^4.1.0", + "luxon": "^3.0.1", + "markdown-it-anchor": "^8.6.4", + "rosetta": "^1.1.0" + } +} diff --git a/public/css/index.css b/public/css/index.css new file mode 100644 index 0000000..b3ca995 --- /dev/null +++ b/public/css/index.css @@ -0,0 +1,249 @@ +/* Defaults */ +:root { + --font-family: Century Gothic,Avant Garde,Avenir,TeXGyreAdventorRegular,Verdana,sans-serif; + --font-family-monospace: Consolas, Menlo, Monaco, Andale Mono WT, Andale Mono, Lucida Console, Lucida Sans Typewriter, DejaVu Sans Mono, Bitstream Vera Sans Mono, Liberation Mono, Nimbus Mono L, Courier New, Courier, monospace; +} + +/* Theme colors */ +:root { + --color-gray-20: #e0e0e0; + --color-gray-50: #C0C0C0; + --color-gray-90: #333; + + --background-color: #fff; + + --text-color: rgba(0,0,10,.8); + --text-color-secondary: #004953; + --text-color-tertiary: #57c183; + --text-color-link: #004953; + --text-color-link-active: #004953; +} + +/*@media (prefers-color-scheme: dark) {*/ +/* :root {*/ +/* --color-gray-20: #e0e0e0;*/ +/* --color-gray-50: #C0C0C0;*/ +/* --color-gray-90: #dad8d8;*/ + +/* !* --text-color is assigned to --color-gray-_ above *!*/ +/* --text-color-link: #1493fb;*/ +/* --text-color-link-active: #6969f7;*/ +/* --text-color-link-visited: #a6a6f8;*/ + +/* --background-color: #15202b;*/ +/* }*/ +/*}*/ + + +/* Global stylesheet */ +* { + box-sizing: border-box; +} + +html, +body { + padding: 0; + margin: 0; + font-family: var(--font-family); + color: var(--text-color); + background-color: var(--background-color); +} +html { + overflow-y: scroll; +} +main { + max-width: 40em; + margin: 0 auto; +} + +h1 { + color: var(--text-color-secondary); + font-style: normal; + font-size: 3em; + font-weight: 700; +} + +h2 { + color: var(--text-color-secondary); + font-size: 1.7em; + font-style: normal; + font-weight: 700; + letter-spacing: .02em; + line-height: 1.7em; + margin-top: 0; +} + +p:last-child { + margin-bottom: 0; +} +p { + line-height: 1.5; + margin: 1.5em 0; +} + +li { + line-height: 1.5; +} + +a { + color: var(--text-color-link); +} +a:hover { + color: var(--text-color-link-active); +} + +main { + padding: 8rem 1rem 1rem; +} +main :first-child { + margin-top: 0; +} + +table { + margin: 1em 0; +} +table td, +table th { + padding-right: 1em; +} + +pre, +code { + font-family: var(--font-family-monospace); +} +pre, +pre[class*="language-"] { + margin: .5em 0; + line-height: 1.375; /* 22px /16 */ + -moz-tab-size: 2; + -o-tab-size: 2; + tab-size: 2; + -webkit-hyphens: none; + -ms-hyphens: none; + hyphens: none; + direction: ltr; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; +} +code { + word-break: break-all; +} + +/* Header */ +.main-header { + background: #fff; + box-shadow: 0 2px 8px rgba(0,0,0,.25); + position: fixed; + width: 100%; + z-index: 1000; + height: 60px; +} +.main-header div { + align-items: center; + display: flex; + margin: auto; + max-width: 1400px; + height: 60px; +} +.main-header-logo { + margin: 0 23px; + text-decoration: none; +} + +.main-menu { + display: flex; + flex-grow: 1; +} + +.nav { + display: flex; + flex-grow: 1; + align-items: baseline; + justify-content: space-around; + list-style: none; + margin: 0; + padding: 0; +} +/* Nav */ +.nav-item { + display: inline-block; + font-weight: 900; + letter-spacing: .02em; + margin: 0; + padding: 0; +} +.nav-item a[href]:not(:hover) { + text-decoration: none; +} +.nav-item-active { + text-decoration: underline; +} + +/*!* Posts list *!*/ +/*.postlist {*/ +/* list-style: none;*/ +/* padding: 0;*/ +/* padding-left: 1.5rem;*/ +/*}*/ +.postlist-item { + margin-bottom: 5rem; +} +.postlist-header h2 { + margin-bottom: 0; +} +.postlist-link { + flex-basis: calc(100% - 1.5rem); + padding-right: .5em; + text-decoration: none; +} +.postlist-footer { + text-align: right; +} + +/* Tags */ +.post-tag { + display: inline-flex; + align-items: center; + justify-content: center; + color: var(--text-color); + background: var(--text-color-tertiary); + padding: 4px; + font-size: 0.8125em; /* 13px /16 */ + /*font-weight: 600;*/ + border-radius: 5px; + text-decoration: none; +} + +/* Tags list */ +.post-metadata { + display: flex; + gap: .5em; + list-style: none; + padding: 0; + margin: 0; +} +.post-metadata time { + margin-right: 1em; + font-size: 0.8125em; /* 13px /16 */ + color: rgba(0,0,10,.55); +} +.post-metadata li:first-child { + flex-grow: 1; +} + + /* Direct Links / Markdown Headers */ +.direct-link { + font-family: sans-serif; + text-decoration: none; + font-style: normal; + margin-left: .1em; +} +a[href].direct-link { + color: transparent; +} +a[href].direct-link:focus, +:hover > a[href].direct-link { + color: #aaa; +} diff --git a/public/css/prism-diff.css b/public/css/prism-diff.css new file mode 100644 index 0000000..9f7e676 --- /dev/null +++ b/public/css/prism-diff.css @@ -0,0 +1,45 @@ +/* + * New diff- syntax + */ + +pre[class*="language-diff-"] { + --eleventy-code-padding: 1.25em; + padding-left: var(--eleventy-code-padding); + padding-right: var(--eleventy-code-padding); +} +.token.deleted { + background-color: hsl(0, 51%, 37%); + color: inherit; +} +.token.inserted { + background-color: hsl(126, 31%, 39%); + color: inherit; +} + +/* Make the + and - characters unselectable for copy/paste */ +.token.prefix.unchanged, +.token.prefix.inserted, +.token.prefix.deleted { + -webkit-user-select: none; + user-select: none; + display: inline-flex; + align-items: center; + justify-content: center; + padding-top: 2px; + padding-bottom: 2px; +} +.token.prefix.inserted, +.token.prefix.deleted { + width: var(--eleventy-code-padding); + background-color: rgba(0,0,0,.2); +} + +/* Optional: full-width background color */ +.token.inserted:not(.prefix), +.token.deleted:not(.prefix) { + display: block; + margin-left: calc(-1 * var(--eleventy-code-padding)); + margin-right: calc(-1 * var(--eleventy-code-padding)); + text-decoration: none; /* override del, ins, mark defaults */ + color: inherit; /* override del, ins, mark defaults */ +} diff --git a/public/img/.gitkeep b/public/img/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/public/img/favicon.svg b/public/img/favicon.svg new file mode 100644 index 0000000..27f0221 --- /dev/null +++ b/public/img/favicon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/img/logo.svg b/public/img/logo.svg new file mode 100644 index 0000000..419f66f --- /dev/null +++ b/public/img/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sitemap/sitemap.xml.njk b/sitemap/sitemap.xml.njk new file mode 100644 index 0000000..a0f7488 --- /dev/null +++ b/sitemap/sitemap.xml.njk @@ -0,0 +1,21 @@ +--- +permalink: /sitemap.xml +eleventyExcludeFromCollections: true +--- + + +{%- for page in collections.all %} + {% set absoluteUrl %}{{ page.url | htmlBaseUrl(metadata.url) }}{% endset %} + + {{ absoluteUrl }} + {{ page.date | htmlDateString }} + {%- set alternateUrls = page.url | locale_links %} + {%- if alternateUrls.length %} + + {%- for link in alternateUrls %} + + {%- endfor %} + {%- endif %} + +{%- endfor %} +