diff options
author | uvok cheetah | 2025-06-22 14:28:33 +0200 |
---|---|---|
committer | uvok cheetah | 2025-06-22 14:28:33 +0200 |
commit | c3e34ca596f0032e707d8563c33bbd7f736ed7ca (patch) | |
tree | d1189aac4b9339c106bebc5a0d647459c965a98b | |
parent | baa5612f50704950d483af06bb92c9c8dd8b8ef8 (diff) |
Prepare Gemini postings
-rw-r--r-- | Makefile | 17 | ||||
-rw-r--r-- | _layouts.gemini/default.html | 1 | ||||
-rw-r--r-- | _layouts.gemini/home.html | 16 | ||||
-rw-r--r-- | _layouts.gemini/page.html | 9 | ||||
-rw-r--r-- | _layouts.gemini/post.html | 23 | ||||
-rw-r--r-- | _layouts.gemini/postlist.html | 45 | ||||
-rw-r--r-- | feed.gmi | 23 |
7 files changed, 134 insertions, 0 deletions
@@ -21,3 +21,20 @@ watch: clean ipfs: clean JEKYLL_ENV=ipfs bundle exec jekyll build cd _site && cp all.html index.html && rm google* && sed -i -e 's|="/|="|g' *.html && tar cvf ../ipfs.tar $$(grep -L redirect *.html) assets index.html + +gemini: clean + mv _layouts _layouts.bak + mv _layouts.gemini _layouts + sed -i.bak -e '/import/ d' assets/main.scss + sed -i.bak -e '/seo/ d' _includes/head.html + cp _config.yml _config.yml.bak + awk '/pagination/ {replace=1;} /enabled/ && replace==1 {replace=0; print " enabled: false"; next;} {print;}' _config.yml > x + sed -i -e '/theme/ d' x + mv x _config.yml + JEKYLL_ENV=gemini bundle3.1 exec jekyll build + mv _config.yml.bak _config.yml + mv assets/main.scss.bak assets/main.scss + mv _includes/head.html.bak _includes/head.html + mv _layouts _layouts.gemini + mv _layouts.bak _layouts + rm -rf _site/category diff --git a/_layouts.gemini/default.html b/_layouts.gemini/default.html new file mode 100644 index 0000000..cddd070 --- /dev/null +++ b/_layouts.gemini/default.html @@ -0,0 +1 @@ +{{ content }} diff --git a/_layouts.gemini/home.html b/_layouts.gemini/home.html new file mode 100644 index 0000000..4e877fb --- /dev/null +++ b/_layouts.gemini/home.html @@ -0,0 +1,16 @@ +--- +layout: default +--- + +{{ content }} + + {%- if site.posts.size > 0 -%} + {%- for post in site.posts -%} + {%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%} + <span class="post-meta">{{ post.date | date: date_format }} + {%- if post.lang == 'de' %} (DE){%- endif -%} + <a class="post-link" href="{{ post.url | relative_url }}"> + {{ post.title | escape }} + </a> + {%- endfor -%} + {%- endif -%} diff --git a/_layouts.gemini/page.html b/_layouts.gemini/page.html new file mode 100644 index 0000000..dda953c --- /dev/null +++ b/_layouts.gemini/page.html @@ -0,0 +1,9 @@ +--- +layout: default +--- + <h1 class="post-title">{{ page.title | escape }}</h1> + + <div class="post-content"> + {{ content }} + </div> + diff --git a/_layouts.gemini/post.html b/_layouts.gemini/post.html new file mode 100644 index 0000000..9ce3141 --- /dev/null +++ b/_layouts.gemini/post.html @@ -0,0 +1,23 @@ +--- +layout: default +--- + <h1 class="post-title p-name" itemprop="name headline">{{ page.title | escape }}</h1> + <p class="post-meta"> + <p> + {%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%} + {%- assign date_format = "%A, %e. %B %Y, %k:%M" -%} + Published: {{ page.date | date: date_format }} + + {%- if page.last_modified_at -%} + - + Updated: {{ page.last_modified_at | date: date_format }} + {%- endif -%} + </p> + + {%- if page.author -%} + - <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span class="p-author h-card" itemprop="name">{{ page.author }}</span></span> + {%- endif -%} + </p> + <div class="post-content e-content" itemprop="articleBody"> + {{ content }} + </div> diff --git a/_layouts.gemini/postlist.html b/_layouts.gemini/postlist.html new file mode 100644 index 0000000..2d8368b --- /dev/null +++ b/_layouts.gemini/postlist.html @@ -0,0 +1,45 @@ +--- +layout: default +--- + + {%- if page.title -%} + <h1 class="page-heading">{{ page.title }}</h1> + {%- endif -%} + + {{ content }} + + {%- if site.posts.size > 0 -%} + + {% assign paginator = site %} + + {%- for post in paginator.posts -%} + {%- assign showsep = false -%} + {%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%} + {%- if post.lang == 'de' %} (DE) {%- endif -%} + <div lang="{{ post.lang | default: site.lang | default: "en" }}"> + <h2> + {{ post.title | escape }} + </h2> + <span class="post-meta">Published: {{ post.date | date: date_format }}</span> + + {%- if forloop.first and paginator.page == 1 or paginator == site -%} + {{ post.content }} + {%- assign showsep = true -%} + {%- elsif site.show_excerpts -%} + {{ post.excerpt }} + {%- assign showsep = true -%} + {%- elsif post.description -%} + {{ post.description }} + {%- assign showsep = true -%} + {%- endif -%} + <a class="post-link" href="{{ post.url | relative_url }}">Link to full post</a> + + </div> + {%- if showsep -%} + <hr class="postsep" /> + {%- endif -%} + {%- endfor -%} + + {%- endif -%} + +</div> diff --git a/feed.gmi b/feed.gmi new file mode 100644 index 0000000..1e7f11d --- /dev/null +++ b/feed.gmi @@ -0,0 +1,23 @@ +--- +--- + {% assign title = site.title | default: site.name %} + + {% if title %} +# {{ title | smartify | xml_escape }} + {% endif %} + + {% if site.description %} +## {{ site.description | xml_escape }} + {% endif %} + + {% unless site.show_drafts %} + {% assign posts = site.posts | where_exp: "post", "post.draft != true" %} + {% endunless %} + {% assign posts = posts | sort: "date" | reverse %} + {% assign posts_limit = site.feed.posts_limit | default: 10 %} + {% for post in posts limit: posts_limit %} + {% assign post_title = post.title | smartify | strip_html | normalize_whitespace | xml_escape %} + +=> {{ post.url }} {{ post.date | date: "%Y-%m-%d" }} {{ post_title }} + {% endfor %} + |