Skip to content

Commit

Permalink
Settings 11yt (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcelestino authored Nov 5, 2024
1 parent b88a213 commit 7ece66e
Show file tree
Hide file tree
Showing 27 changed files with 54 additions and 42 deletions.
31 changes: 0 additions & 31 deletions .eleventy.js

This file was deleted.

Empty file removed .nojekyll
Empty file.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# My notes
# Bloco de Notas

Eleventy and GitHub Pages to write notes

## Configure a publishing source

Under Settings for GitHub Pages, use the `publish_branch` named in `.github/workflows/build.yml` as the publishing source.
Soon...
28 changes: 28 additions & 0 deletions eleventy.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const syntaxHighlight = require('@11ty/eleventy-plugin-syntaxhighlight');

module.exports = (config) => {
config.addPassthroughCopy('src/assets/images/**/*');
config.addPassthroughCopy({ 'src/posts/images/**/*': 'assets/images/' });

config.addPassthroughCopy('src/assets/css/**/*');

config.addLayoutAlias('default', 'default.html');
config.addLayoutAlias('post', 'post.html');

config.addCollection('posts', require('./lib/collections/posts'));

config.addFilter('readableDate', require('./lib/filters/readableDate'));

config.addPlugin(syntaxHighlight);

return {
dir: {
input: 'src',
output: './_site',
layouts: '_layouts',
},
templateFormats: ['md', 'njk', 'html'],
dataTemplateEngine: 'njk',
// markdownTemplateEngine: 'njk',
};
};
3 changes: 3 additions & 0 deletions lib/collections/posts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = (coll) => {
return coll.getFilteredByGlob('src/posts/**/*.md').reverse();
};
12 changes: 12 additions & 0 deletions lib/filters/readableDate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = (date) => {
const formatedDate = new Date(date);
formatedDate.setMinutes(
formatedDate.getMinutes() + formatedDate.getTimezoneOffset()
);

return formatedDate.toLocaleString('pt-BR', {
day: 'numeric',
month: 'long',
year: 'numeric',
});
};
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
"type": "git",
"url": "git+https://github.com/tcelestino/bloco-de-notas.git"
},
"bugs": {
"url": "https://github.com/tcelestino/bloco-de-notas/issues"
},
"homepage": "https://github.com/tcelestino/bloco-de-notas#readme",
"author": "tcelestino",
"license": "ISC",
"license": "MIT",
"devDependencies": {
"@11ty/eleventy": "3.0.0",
"@11ty/eleventy-plugin-syntaxhighlight": "5.0.0"
Expand Down
2 changes: 1 addition & 1 deletion 404.html → src/404.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
layout: default
eleventyExcludeFromCollections: true
title: Not Found
permalink: 404.html
layout: default
---

<h1>🤷🏻‍♀️</h1>
Expand Down
4 changes: 2 additions & 2 deletions _layouts/default.html → src/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="{{ '/assets/main.css' | url }}" />
<link rel="stylesheet" href="{{ '/assets/css/main.css' | url }}" />
<title>Bloco de Notas por Tiago Celestino</title>
</head>

Expand All @@ -17,7 +17,7 @@ <h1 class="top__title"><a href="{{ '/' | url }}">Blocos de Notas</a></h1>
</header>

<main class="page-content">
<div class="wrapper">{{ content }}</div>
<div class="wrapper">{{ content | raw }}</div>
</main>

<footer class="site-footer">
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion index.html → src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div>
<div class="top__descr">Anotações para mim mesmo, mas se tiver interesse em ler, fique a vontade.</div>
<ol reversed class="post-list">
{%- for post in collections.post -%}
{%- for post in collections.posts -%}
<li>
<span class="post-meta">{{ post.date | readableDate }}</span>
<h2>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 7ece66e

Please sign in to comment.