From a041f469ff41f53601c97454b41cfc4ef3f3ed45 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sun, 28 Apr 2024 15:04:22 +0200 Subject: cleanup + begin fix search page --- Gemfile | 1 + _config.yml | 5 ++++- _includes/title.html | 4 ++++ _layouts/default.html | 27 +++++++++++++++++++++++++++ _layouts/index.html | 48 ------------------------------------------------ _layouts/post.html | 27 --------------------------- _sass/layout.css | 1 + _sass/search.css | 8 +++----- atom.xml | 12 ++++++------ index.md | 30 +++++++++++++++++++++++++++++- search.html | 16 ++++++++++++++++ 11 files changed, 91 insertions(+), 88 deletions(-) create mode 100644 _layouts/default.html delete mode 100644 _layouts/index.html delete mode 100644 _layouts/post.html create mode 100644 search.html diff --git a/Gemfile b/Gemfile index 2f7ad5d..f615e70 100644 --- a/Gemfile +++ b/Gemfile @@ -4,4 +4,5 @@ source 'https://rubygems.org' gem 'jekyll', '~> 4.3' gem 'json', '~> 2.7' gem 'nokogiri', '~> 1.16' +gem 'jekyll-liquify', '~> 0.0.3' diff --git a/_config.yml b/_config.yml index d14546c..62b2631 100644 --- a/_config.yml +++ b/_config.yml @@ -9,9 +9,12 @@ defaults: - scope: type: posts values: - layout: post + layout: default lang: en + toc: true markdown: kramdown sass: style: compressed sourcemap: development +gems: + - jekyll-liquify diff --git a/_includes/title.html b/_includes/title.html index 40efd39..08643ad 100644 --- a/_includes/title.html +++ b/_includes/title.html @@ -1 +1,5 @@ +{% if page.id == "index" %} +{{ site.title }} +{% else %} {{ page.title }} - {{ site.title }} +{% endif %} diff --git a/_layouts/default.html b/_layouts/default.html new file mode 100644 index 0000000..a923692 --- /dev/null +++ b/_layouts/default.html @@ -0,0 +1,27 @@ + + + + {% include head.html %} + {% include title.html %} + {% include opengraph.html %} + + +
+
+

{{ page.title }}

+ {% if page.subtitle %}

{{ page.subtitle }}

{% endif %} + {% if page.tags %}{% include tags.html tags=page.tags %}{% endif %} +
+ + +
+ {{ content }} +
+
+ + diff --git a/_layouts/index.html b/_layouts/index.html deleted file mode 100644 index 9f0f6d0..0000000 --- a/_layouts/index.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - {% include head.html %} - {{ site.title }} - {% include opengraph.html %} - - -
-
-

{{ page.title }}

- {% if page.subtitle %}

{{ page.subtitle }}

{% endif %} - {% if page.tags %}{% include tags.html tags=page.tags %}{% endif %} -
- - -
- {{ content }} - {% if site.rss != nil %} -

An rss/atom feed of this blog is also available:

-
{{ site.rss.url }}
- {% endif %} -
-

Recent posts

-
- {% for post in site.posts limit:4 %} -
- - post cover -

{{ post.title }}

- {{ post.subtitle }} -
- {% include tags.html tags=post.tags %} -
- {% endfor %} -
-
- Go to all posts -
-
-
- - diff --git a/_layouts/post.html b/_layouts/post.html deleted file mode 100644 index 4597623..0000000 --- a/_layouts/post.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - {% include head.html %} - {% include title.html %} - {% include opengraph.html %} - - -
-
-

{{ page.title }}

- {% if page.subtitle %}

{{ page.subtitle }}

{% endif %} - {% if page.tags %}{% include tags.html tags=page.tags %}{% endif %} -
- - -
- {{ content }} -
-
- - diff --git a/_sass/layout.css b/_sass/layout.css index 706f5c9..b92ef79 100644 --- a/_sass/layout.css +++ b/_sass/layout.css @@ -16,6 +16,7 @@ display: grid; grid-auto-rows: auto; + grid-auto-columns: auto 1fr; gap: var(--page-margins) calc((1 - var(--collapse-horizontal-gap)) * var(--page-margins)); } diff --git a/_sass/search.css b/_sass/search.css index e424b6b..d46c80f 100644 --- a/_sass/search.css +++ b/_sass/search.css @@ -3,6 +3,8 @@ border-radius: 8px; padding: 12px; margin-bottom: 24px; + + display: flex; } .searchBar .input { @@ -12,10 +14,7 @@ color: var(--bg); margin-left: 12px; - width: calc(100% - 48px - 12px); - padding: 14px 0; - - vertical-align: top; + flex-grow: 1; } .searchBar .input::placeholder { @@ -27,7 +26,6 @@ .searchBar .button { margin: 0; - display: inline-block !important; line-height: 0; min-width: unset; background-color: var(--bg); diff --git a/atom.xml b/atom.xml index 5d51abd..6b997e8 100644 --- a/atom.xml +++ b/atom.xml @@ -1,15 +1,15 @@ --- --- -{% for post in site.pages %} - {% if post.layout == "index" %} - {% assign index_post = post %} + +{% for page in site.pages %} + {% if page.id == "index" %} + {% assign index_post = page %} {% endif %} {% endfor %} - - {{ index_post.title }} - {{ index_post.content | markdownify | xml_escape }} + {{ site.title }} + {{ index_post.title }} en-us {{ site.rss.url }} diff --git a/index.md b/index.md index f6a70e5..6f32f84 100644 --- a/index.md +++ b/index.md @@ -1,6 +1,8 @@ --- title: Loek's excruciatingly interesting blog -layout: index +layout: default +id: index +toc: false --- Welcome to my blog page! This is where I post updates on things that I do such @@ -15,3 +17,29 @@ The page you're looking at right now is also open-source! The code for this page can be found on [GitHub](https://github.com/lonkaars/blog), and should also be available on [my private git server](https://git.pipeframe.xyz). +{% if site.rss != nil %} +An rss/atom feed of this blog is also available: +``` +{{ site.rss.url }} +``` +{% endif %} + +--- + +## Recent posts + +
+{% for post in site.posts limit:4 %} +
+ + post cover +

{{ post.title }}

+ {{ post.subtitle }} +
+ {% include tags.html tags=post.tags %} +
+{% endfor %} +
+ +[Go to all posts](/search){:.button} + diff --git a/search.html b/search.html new file mode 100644 index 0000000..9001636 --- /dev/null +++ b/search.html @@ -0,0 +1,16 @@ +--- +title: Search for posts +layout: default +id: search +toc: false +--- + + + +
+ -- cgit v1.2.3