From a7816c160e06b2ee7684dcb66e1480cfcde0e90a Mon Sep 17 00:00:00 2001 From: Yehonal Date: Mon, 17 Dec 2018 20:40:19 +0100 Subject: Improved blog feature and other minor fixes --- 404.md | 2 +- _config.yml.dist | 9 ++++ _includes/git-wiki/components/lists/post-list.html | 6 ++- _layouts/git-wiki-blog.html | 57 ++++++++++++++++++++++ _layouts/git-wiki-post.html | 15 ++++++ _sass/git-wiki-style.scss | 7 +-- blog/index.html | 4 ++ 7 files changed, 94 insertions(+), 6 deletions(-) create mode 100644 _layouts/git-wiki-blog.html create mode 100644 _layouts/git-wiki-post.html create mode 100644 blog/index.html diff --git a/404.md b/404.md index dd6b4c7..a9eb79f 100644 --- a/404.md +++ b/404.md @@ -1,6 +1,6 @@ --- permalink: /404.html -layout: "null" +layout: null --- diff --git a/_config.yml.dist b/_config.yml.dist index bbea686..bd8b83e 100644 --- a/_config.yml.dist +++ b/_config.yml.dist @@ -12,6 +12,9 @@ blog_feature: true show_wiki_posts: true # (integer) Maximum number of wiki posts to shown in sidebar show_wiki_posts_limit: 10 +# from jekyll (read jekyll doc) +paginate: 5 +paginate_path: "/blog/page:num" # (boolean) Enable/disable download buttons in sidebar show_downloads: true # (string) Specify branch rendered by gitpages allowing wiki tool buttons to work @@ -60,6 +63,12 @@ defaults: type: "pages" values: layout: "git-wiki-default" + - + scope: + path: "" + type: "posts" + values: + layout: "git-wiki-post" sass: style: compressed plugins: diff --git a/_includes/git-wiki/components/lists/post-list.html b/_includes/git-wiki/components/lists/post-list.html index 5e39359..be1aa35 100644 --- a/_includes/git-wiki/components/lists/post-list.html +++ b/_includes/git-wiki/components/lists/post-list.html @@ -2,12 +2,12 @@ {% include {{ site.inc_before_post_list }} %} {% endif %} -Posts {% if (site.show_wiki_post_limit >= 1 %} (Latest {{site.show_wiki_post_limit }} updated) {% endif %}: +Posts {% if (site.show_wiki_posts_limit >= 1 %} (Latest {{site.show_wiki_posts_limit }} updated) {% endif %}: +Read all + {% if site.inc_after_post_list %} {% include {{ site.inc_after_post_list }} %} {% endif %} \ No newline at end of file diff --git a/_layouts/git-wiki-blog.html b/_layouts/git-wiki-blog.html new file mode 100644 index 0000000..1241770 --- /dev/null +++ b/_layouts/git-wiki-blog.html @@ -0,0 +1,57 @@ +--- +title: Blog +layout: git-wiki-default +--- + + + +{% for post in paginator.posts %} +

{{ post.id }}

+

+ {{ post.date | date: "%-d %B %Y"}} +

+
+ {{ post.excerpt }} + + ...Read all +
+{% endfor %} + + + \ No newline at end of file diff --git a/_layouts/git-wiki-post.html b/_layouts/git-wiki-post.html new file mode 100644 index 0000000..3184199 --- /dev/null +++ b/_layouts/git-wiki-post.html @@ -0,0 +1,15 @@ +--- +layout: git-wiki-default +--- + +{{ page.date | date: "%-d %B %Y" }} +{% if page.author or site.author %} +

by {{ page.author | default: site.author }}

+{% endif %} + +{{content}} + + +{% if page.tags.size > 0 %} + tags: {{ page.tags | join: " - " }} +{% endif %} \ No newline at end of file diff --git a/_sass/git-wiki-style.scss b/_sass/git-wiki-style.scss index c40fd08..e3fb194 100644 --- a/_sass/git-wiki-style.scss +++ b/_sass/git-wiki-style.scss @@ -107,11 +107,12 @@ img { header { width: 272px; float: left; - position: fixed; + /*position: fixed;*/ -webkit-font-smoothing: subpixel-antialiased; - overflow-y: auto; - overflow-x: auto; + /*overflow-y: auto; + overflow-x: auto;*/ max-height: 100%; + margin-bottom: 30px; } header .downloads { diff --git a/blog/index.html b/blog/index.html new file mode 100644 index 0000000..f806d66 --- /dev/null +++ b/blog/index.html @@ -0,0 +1,4 @@ +--- +layout: git-wiki-blog +--- + -- cgit