summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsijanec <sijanecantonluka@gmail.com>2020-11-07 23:43:49 +0100
committersijanec <sijanecantonluka@gmail.com>2020-11-07 23:43:49 +0100
commited8911963ad821f4afecc52c8501e2d8f7bf10c1 (patch)
tree7241207ffd45b2796478b05656e6a71458aa0293
parentdodal tekst ko je stran urejena (diff)
downloadsijanec.eu-ed8911963ad821f4afecc52c8501e2d8f7bf10c1.tar
sijanec.eu-ed8911963ad821f4afecc52c8501e2d8f7bf10c1.tar.gz
sijanec.eu-ed8911963ad821f4afecc52c8501e2d8f7bf10c1.tar.bz2
sijanec.eu-ed8911963ad821f4afecc52c8501e2d8f7bf10c1.tar.lz
sijanec.eu-ed8911963ad821f4afecc52c8501e2d8f7bf10c1.tar.xz
sijanec.eu-ed8911963ad821f4afecc52c8501e2d8f7bf10c1.tar.zst
sijanec.eu-ed8911963ad821f4afecc52c8501e2d8f7bf10c1.zip
-rw-r--r--_config.yml2
-rw-r--r--_includes/datumincas.html21
-rw-r--r--_includes/dayofweek.html21
-rw-r--r--_layouts/post.html12
-rw-r--r--test.html24
5 files changed, 75 insertions, 5 deletions
diff --git a/_config.yml b/_config.yml
index fdd578c..232f0b9 100644
--- a/_config.yml
+++ b/_config.yml
@@ -1,7 +1,7 @@
name: Anton Luka Šijanec
long_date_format: "%A, %d. %B %Y %H:%M:%S"
short_date_format: "%d. %m. %Y"
-short_datetime_format: "%d. %m. %Y %H:%M:%S"
+short_datetime_format: "%d. %m. %Y ob %H:%M:%S"
baseurl: ""
timezone: Europe/Ljubljana
tagline: Osebno spletišče Antona Luke Šijanca
diff --git a/_includes/datumincas.html b/_includes/datumincas.html
new file mode 100644
index 0000000..d14b26e
--- /dev/null
+++ b/_includes/datumincas.html
@@ -0,0 +1,21 @@
+{% comment %}
+ argv: datestring,notimebool,nomestnikbool
+ return: ponedeljek, 23. (novembra|november) 2020[, ob 23:59:59]
+{% endcomment %}
+{% if argv[2] %}
+ {% assign datumincas_months = "januar,februar,marec,april,maj,junij,julij,avgust,september,oktober,november,december" | split: "," %}
+ {% assign datumincas_days = "ponedeljek,torek,sreda,četrtek,petek,sobota,nedelja" | split: "," %}
+{% else %}
+ {% assign datumincas_months = "januarja,februarja,marca,aprila,maja,junija,julija,avgusta,septembra,oktobra,novembra,decembra" | split: "," %}
+ {% assign datumincas_days = "ponedeljek,torek,sredo,četrtek,petek,soboto,nedeljo" | split: "," %}
+{% endif %}
+{% assign datumincas_datetimearr = argv[0] | split: " " %}
+{% assign datumincas_arr = datumincas_datetimearr[0] | split: "-" %}
+{% assign datumincas_arr = datumincas_arr | push: datumincas_datetimearr[1] %}
+{% include dayofweek.html %}
+{% assign return = return | minus: 1%}
+{% assign datumincas_mesec = datumincas_arr[1] | minus: 1 %}
+{% assign return = datumincas_days[return] | append: ", " | append: datumincas_arr[2] | append: ". " | append: datumincas_months[datumincas_mesec] | append: " " | append: datumincas_arr[0] %}
+{% unless argv[1] %}
+ {% assign return = return | append: ", ob " | append: datumincas_arr[3] %}
+{% endunless %}
diff --git a/_includes/dayofweek.html b/_includes/dayofweek.html
new file mode 100644
index 0000000..41dd2e4
--- /dev/null
+++ b/_includes/dayofweek.html
@@ -0,0 +1,21 @@
+{% comment %}
+ argv: datestring
+ return: day in week (1: monday)
+{% endcomment %}
+{% assign dayinweek_datearr = argv[0] | split: " " %}
+{% assign dayinweek_datearr = dayinweek_datearr | split: "-" %}
+{% assign dayinweek_magic = "032503514624" | split: "" %}
+{% assign dayinweek_mesec = dayinweek_datearr[1] | plus: 0 %}
+{% assign dayinweek_day = dayinweek_datearr[2] | plus: 0 %}
+{% assign dayinweek_magicselector = dayinweek_mesec | minus: 1 %}
+{% if dayinweek_mesec < 3 %}
+ {% assign dayofweek_leto = argv[0] | minus: 1 %}
+{% else %}
+ {% assign dayofweek_leto = argv[0] | plus: 0 %}
+{% endif %}
+{% assign return = dayofweek_leto | divided_by: 4 | plus: dayofweek_leto | plus: dayinweek_day | plus: dayinweek_magic[dayinweek_magicselector] %}
+{% assign dayofweek_leto_div = dayofweek_leto | divided_by: 100 %}
+{% assign return = return | minus: dayofweek_leto_div %}
+{% assign dayofweek_leto_div = dayofweek_leto | divided_by: 400 %}
+{% assign return = return | plus: dayofweek_leto_div %}
+{% assign return = return | modulo: 7 %}
diff --git a/_layouts/post.html b/_layouts/post.html
index 9e03ee6..8bb4651 100644
--- a/_layouts/post.html
+++ b/_layouts/post.html
@@ -5,7 +5,9 @@ layout: default
{{ page.title }}
</h1>
<p>
- {{ page.date | date: site.short_date_format }}
+ {% assign argv = page.date | append: ",true,true" | split: "," %}
+ {% include datumincas.html %}
+ {{ return }}
{% assign author = site.authors | where: 'short_name', page.author | first %}
{% assign anon = site.authors | where: 'short_name', "anonymous" | first %}
-
@@ -36,8 +38,10 @@ layout: default
{{ content }}
{% if page.lastmodified %}
- <div class="dimmedtext textright">
- Objava je bila nazadnje urejena
- {{ page.lastmodified | date: short_date_format}}.
+ <div class="dimmedtext {% comment %} textright {% endcomment %}">
+ Objava je bila nazadnje urejena v
+ {% assign argv = page.lastmodified | split: ","%}
+ {% include datumincas.html %}
+ {{ return }}.
</div>
{% endif %}
diff --git a/test.html b/test.html
new file mode 100644
index 0000000..26d796c
--- /dev/null
+++ b/test.html
@@ -0,0 +1,24 @@
+---
+---
+{% assign argv = "2020-11-01 23:59:59" | split: ","%}
+{% include datumincas.html %} {{return}} <br>
+{% assign argv = "2020-11-02 23:59:59" | split: ","%}
+{% include datumincas.html %} {{return}} <br>
+{% assign argv = "2020-11-03 23:59:59" | split: ","%}
+{% include datumincas.html %} {{return}} <br>
+{% assign argv = "2020-11-04 23:59:59" | split: ","%}
+{% include datumincas.html %} {{return}} <br>
+{% assign argv = "2020-11-05 23:59:59" | split: ","%}
+{% include datumincas.html %} {{return}} <br>
+{% assign argv = "2020-11-06 23:59:59" | split: ","%}
+{% include datumincas.html %} {{return}} <br>
+{% assign argv = "2020-11-07 23:59:59" | split: ","%}
+{% include datumincas.html %} {{return}} <br>
+{% assign argv = "2020-11-08 23:59:59" | split: ","%}
+{% include datumincas.html %} {{return}} <br>
+{% assign argv = "2020-11-09 23:59:59" | split: ","%}
+{% include datumincas.html %} {{return}} <br>
+{% assign argv = "2020-11-10 23:59:59" | split: ","%}
+{% include datumincas.html %} {{return}} <br>
+{% assign argv = "2020-11-11 23:59:59" | split: ","%}
+{% include datumincas.html %} {{return}} <br>