commit c1af1ac8b5791880362658aff04dd0da5778fee0 Author: Gwenhael Le Moine Date: Sat Mar 9 11:39:49 2024 +0100 jorge init Signed-off-by: Gwenhael Le Moine diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..228c813 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +target +.DS_Store + diff --git a/README.md b/README.md new file mode 100644 index 0000000..8aa9b4a --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ + +# Mèo Lười + +A jorge blog by Mèo Lười. diff --git a/config.yml b/config.yml new file mode 100644 index 0000000..a164df0 --- /dev/null +++ b/config.yml @@ -0,0 +1,3 @@ +name: "Mèo Lười" +author: "Mèo Lười" +url: "https://luoi.eu" diff --git a/includes/nav.html b/includes/nav.html new file mode 100644 index 0000000..9c8c6a4 --- /dev/null +++ b/includes/nav.html @@ -0,0 +1,11 @@ + diff --git a/includes/post_preview.html b/includes/post_preview.html new file mode 100644 index 0000000..f2d7cf5 --- /dev/null +++ b/includes/post_preview.html @@ -0,0 +1,14 @@ +
+ {{ post.date | date: "%Y-%m-%d" }} +
+ {{ post.title }} + + {% if post.favorite %} {% endif %} + + {% for tag in post.tags %} + #{{tag}} + {% endfor %} + + +
+
diff --git a/layouts/base.html b/layouts/base.html new file mode 100644 index 0000000..68735d9 --- /dev/null +++ b/layouts/base.html @@ -0,0 +1,53 @@ +--- +--- + + + + + + {% if page.title %} + {{page.head_title|default: page.title }} | {{ site.config.name }} + {% else %} + {{ site.config.name }} + {% endif %} + + + + + + + + {% if page.title %} + + + {% endif %} + + {% if page.excerpt or site.config.description %} + + + + {% endif %} + + {% if page.layout == "post" %} + + + + + {% else %} + + + + {% endif %} + + {% if page.image != "" %} + + + {% endif %} + + + +
+ {{ content }} +
+ + diff --git a/layouts/default.html b/layouts/default.html new file mode 100644 index 0000000..9c7aa2a --- /dev/null +++ b/layouts/default.html @@ -0,0 +1,11 @@ +--- +layout: base +--- +{% include nav.html %} + +
+ {% if page.title %}

{{page.title}}

{% endif %} + {{ content }} +
+
+ diff --git a/layouts/post.html b/layouts/post.html new file mode 100644 index 0000000..cf8cbdb --- /dev/null +++ b/layouts/post.html @@ -0,0 +1,29 @@ +--- +layout: base +--- +{% include nav.html %} + +
+
+

{{ page.title }}

+ {% if page.subtitle %}

{{ page.subtitle }}

{% endif %} + {% if page.cover-img %} + + {% endif %} +
+ {{ content }} +
+ +
+
+ + diff --git a/src/assets/css/main.css b/src/assets/css/main.css new file mode 100644 index 0000000..3120d80 --- /dev/null +++ b/src/assets/css/main.css @@ -0,0 +1,291 @@ +html { + color-scheme: light dark; + overflow-y: scroll; +} + +body { + max-width: 45em; + margin: 0 auto; + padding: 0 1rem; + width: auto; + font-family: Tahoma, Verdana, Arial, sans-serif; + line-height: 1.5; + + height: 100vh; + display: flex; + flex-direction: column; +} + +.content { + /* https://stackoverflow.com/a/38347131/993769 */ + text-size-adjust: none; + -ms-text-size-adjust: none; + -moz-text-size-adjust: none; + -webkit-text-size-adjust: none; +} + +.footer { + padding: 2rem 0 1rem; + margin-top: auto; +} + +@media screen and (max-width: 480px) { + .hidden-mobile { + display: none + } +} + +nav { + margin: 1rem 0; + line-height: 1.8; + border-bottom: 1px solid; + display: flex; +} +.nav-right { + margin-left: auto; +} +nav a:not(:last-child) { + margin-right: 1rem +} +nav a:hover { + text-decoration: none; +} + +li { + line-height: 1.6; +} + +li:not(:last-child) { + padding-bottom: .75rem; +} + +a, a:visited { + color: LinkText; + text-decoration: none; +} +a:hover { + text-decoration: underline +} + +a.title { + color: black; + padding-right: .25rem; +} +@media (prefers-color-scheme: dark) { + a.title { + color: white; + } +} + +.footer, .footer a, .date, .tags, .tags a { + color: silver; +} +.date { + padding-right: .5rem; + white-space: nowrap; +} +.tags { + display: inline-block; +} + +article.post { + display: flex; + padding-bottom: .5rem; +} + +.center-block { + text-align: center; +} + +hr { + border: 0; + border-top:1px solid lightgray; +} + +/* tweaks for post content style */ +.layout-post img { + max-width: 75%; + max-height: 400px; +} + +img.cover-img { + width: 100%; + max-width: 100%; + max-height: 200px; + object-fit: cover; + margin-bottom: -2rem; +} + +.layout-post { + hyphens: auto; + text-align: justify; + font-size: 1.1rem; + line-height: 1.6; + + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased !important; + -moz-font-smoothing: antialiased !important; + text-rendering: optimizelegibility !important; + letter-spacing: .03em; +} + +.layout-post .title { + hyphens:none; +} + +.layout-post header { + margin: 3rem 0 5rem; + text-align: left; +} + +.layout-post header.with-cover { + margin-top: -0.5rem; +} + +pre { + font-size: 1rem; + overflow-x: auto; + line-height: 1.5; + padding: 1rem; + -ms-overflow-style: none; /* IE and Edge */ + scrollbar-width: none; /* Firefox */ +} + +/* Hide scrollbar for Chrome, Safari and Opera */ +.src pre::-webkit-scrollbar { + display: none; +} + +/* There are several code rendering scenarios that need to be handled reasonably: +- light vs dark preferred color scheme +- pre code blocks vs inline code spans +- language set vs no language set +- markdown vs org rendering + +Need to decide between: +- fixing the color scheme of the page + using one of chroma's themes +- supporting both light/dark and disabling syntax highlighting altogether +- supporting light/dark, picking a theme and patching it to render decently + with both preferences (as done below, assuming chroma's github theme) +*/ +.layout-post :not(pre) > code { + padding: .2em .4em; + background-color: whitesmoke!important; + color: black; + font-size: 1rem; +} + +@media (prefers-color-scheme: dark) { + .layout-post :not(pre) > code { + background-color: rgba(110, 118, 129, 0.4)!important; + color: white; + } +} + +.layout-post pre, .layout-post code { + border-radius: 6px; + background-color: whitesmoke!important; + font-size: 0.9rem; + hyphens: none; + color: black; +} + +blockquote { + border-left: 2px solid whitesmoke; + padding-left: 1rem; +} + +.layout-post p.verse { + text-align: right; +} + +.layout-post p { + line-height: 1.8; + margin-bottom: 1.5rem; +} + +.layout-post p + h2 { + padding-top: 1.5rem; +} + +.layout-post .center-block { + margin: 2rem 0; +} + +/* override in mobile devices for more compact text */ +@media screen and (max-width: 768px) { + .layout-post { + line-height: 1.2; + letter-spacing: unset; + hyphens: none; + text-align: left; + } + + .layout-post p { + margin: 1rem 0; + line-height: 1.7; + } + + .layout-post p + p { + text-indent: 0; + } + + .layout-post img { + max-width: 100%; + } +} + +table { + width: 100%; + border-collapse: collapse; + font-size: 1.05rem; +} + +table tr { + border-bottom: 1px solid #ddd; +} + +@media screen and (max-width: 480px) { + td { display: inline-block } +} + +td, th { + padding: .5rem; +} + + +hr.footnotes-separatator { + display:none; +} + +/* makes footnote number and text display in the same line */ +.footnote-definition { + display: block; + vertical-align: top; + margin-bottom: .4rem; +} +.footnote-body, .footnote-body p { + display: inline; +} + +/* These control the expand/collapse behavior of the tags page */ +details summary { + list-style: none; + cursor: pointer; +} + +details summary h3::after { + content: "[+]"; + font-size: small; + font-weight: normal; + font-family: monospace; + vertical-align: middle; +} + +details[open] summary h3::after { + content: "[-]" +} + +details > summary::-webkit-details-marker { + display: none; +} diff --git a/src/blog/goodbye-markdown.md b/src/blog/goodbye-markdown.md new file mode 100644 index 0000000..6c83b06 --- /dev/null +++ b/src/blog/goodbye-markdown.md @@ -0,0 +1,25 @@ +--- +title: Goodbye Markdown... +tags: [blog] +date: 2024-02-16 +layout: post +--- + +## For the record + +For the record, even though it has *org* in the name, jorge can also render markdown, +thanks to [goldmark](https://github.com/yuin/goldmark/). + +Let's look at some code: + +``` python +import os + +def hello(): + print("Hello World!") + os.exit(0) + +hello() +``` + +[Next time](./hello-org), I'll talk about org-mode posts. diff --git a/src/blog/hello-org.org b/src/blog/hello-org.org new file mode 100644 index 0000000..73420e2 --- /dev/null +++ b/src/blog/hello-org.org @@ -0,0 +1,34 @@ +--- +title: Hello Org! +subtitle: Writing posts with org-mode syntax +tags: [blog, emacs] +date: 2024-02-17 +layout: post +--- +#+OPTIONS: toc:nil num:nil + +** Indeed + +This post was originally written with org-mode syntax, instead of [[file:goodbye-markdown][markdown]]. + +As you can see, /italics/ and *bold* render as expected, and you can even use footnotes[fn:1]. + +All of this is powered by [[https://github.com/niklasfasching/go-org][go-org]], btw[fn:2]. + +Let's look at some code: + +#+begin_src python +import os + +def hello(): + print("Hello World!") + os.exit(0) + +hello() +#+end_src + +** Notes + +[fn:1] See? + +[fn:2] And another one footnote, to stay on the safe side. diff --git a/src/blog/index.html b/src/blog/index.html new file mode 100644 index 0000000..e54dce3 --- /dev/null +++ b/src/blog/index.html @@ -0,0 +1,15 @@ +--- +layout: default +submenu: [["/feed", "/feed.xml"], ["/tags", "/blog/tags"]] +title: Blog +--- + +{% assign posts_by_year = site.posts | group_by_exp:"post", "post.date | date: '%Y'" %} +{% for year in posts_by_year %} + {% unless forloop.first%} +
+ {% endunless %} + {% for post in year.items %} + {% include post_preview.html %} + {% endfor %} +{% endfor %} diff --git a/src/blog/tags.html b/src/blog/tags.html new file mode 100644 index 0000000..c967018 --- /dev/null +++ b/src/blog/tags.html @@ -0,0 +1,16 @@ +--- +layout: default +title: Tags +--- + +{% for tag in site.tags %} +
+ +

#{{tag[0]}}

+
+ + {% for post in tag[1] %} + {% include post_preview.html %} + {% endfor %} +
+{% endfor %} diff --git a/src/feed.xml b/src/feed.xml new file mode 100644 index 0000000..d61631d --- /dev/null +++ b/src/feed.xml @@ -0,0 +1,35 @@ +--- +--- + + + jorge + + + {{ "now" | date: "%Y-%m-%d %H:%M" }} + {{ page.url | absolute_url}} + {{ site.config.name }} + + {{ site.config.author }} + + {% for post in site.posts limit:10 %} + + {% assign post_title = post.title | strip_html | normalize_whitespace | xml_escape %} + {{ post.title }} + + {{ post.date | date: "%Y-%m-%d %H:%M" }} + {{ post.date | date: "%Y-%m-%d %H:%M" }} + {{ post.url | absolute_url }} + + {{ post.author | default:site.config.author }} + + {% for tag in post.tags %} + + {% endfor %} + + {% if post.image %} + + + {% endif %} + + {% endfor %} + diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..76394f1 --- /dev/null +++ b/src/index.html @@ -0,0 +1,21 @@ +--- +layout: default +--- +

About

+

Welcome to {{ site.config.name }} by {{ site.config.author }}.

+
+ +

Latest posts

+ +{% for post in site.posts limit:3 %} +{% include post_preview.html %} +{% endfor %} + +

See the full blog archive or subscribe to the feed.

+
+ +

Contact

+