diff --git a/config.toml b/config.toml index dc5fefc..23b968b 100644 --- a/config.toml +++ b/config.toml @@ -15,7 +15,10 @@ taxonomies = [ [extra] nav = [ {title = "Index", path = "/"}, - {title = "About", path = "/about/"} + {title = "About", path = "/about/"}, + {title = "All posts", path = "/posts/"}, + {title = "Machines", path = "/machines/"} ] categories_title = "Categories" tags_title = "Tags" +latest_posts_count = 4 diff --git a/content/_index.md b/content/_index.md index 96d1f14..ac36e06 100644 --- a/content/_index.md +++ b/content/_index.md @@ -1,5 +1,2 @@ +++ -sort_by = "date" -paginate_by = 4 +++ - diff --git a/content/about.md b/content/about.md new file mode 100644 index 0000000..57f88e0 --- /dev/null +++ b/content/about.md @@ -0,0 +1,4 @@ ++++ +title = "About" ++++ + diff --git a/content/about/_index.md b/content/about/_index.md deleted file mode 100644 index e6ee84b..0000000 --- a/content/about/_index.md +++ /dev/null @@ -1,5 +0,0 @@ -+++ -title = "About" -template = "section.html" -+++ - diff --git a/content/machines/_index.md b/content/machines/_index.md new file mode 100644 index 0000000..b3f542f --- /dev/null +++ b/content/machines/_index.md @@ -0,0 +1,3 @@ ++++ ++++ + diff --git a/content/posts/_index.md b/content/posts/_index.md new file mode 100644 index 0000000..7386385 --- /dev/null +++ b/content/posts/_index.md @@ -0,0 +1,5 @@ ++++ +orger_by = "date" +paginate_by = 5 ++++ + diff --git a/templates/index.html b/templates/index.html index 3f5a0b6..1b0e1c8 100644 --- a/templates/index.html +++ b/templates/index.html @@ -25,10 +25,7 @@
{% block content %} - {% for page in paginator.pages %} - {{ macros::list_article(page=page) }} - {% endfor %} - {{ macros::pagination(paginator=paginator) }} + {{ macros::posts_latest(section="posts", count=config.extra.latest_posts_count) }} {% endblock content %}
diff --git a/templates/macros.html b/templates/macros.html index ee45ef9..0489659 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -1,3 +1,13 @@ +{% macro posts_latest(section, count) %} + {% set section = get_section(path=section~"/_index.md") %} + {% for page in section.pages %} + {% if loop.index > count %} + {% break %} + {% endif %} + {{ macros::list_article(page=page) }} + {% endfor %} +{% endmacro posts_latest %} + {% macro list_taxonomy(title, kind) %} {{ title }}