Issue #3 List of pages (long and short)

This commit is contained in:
Alexis Hassler 2019-05-16 18:46:58 +02:00
parent 6689a5faa5
commit a9c6585252
9 changed files with 54 additions and 3 deletions

View File

@ -23,5 +23,9 @@ global_pages:
text: All the pages text: All the pages
- url: /Special:RecentChanges - url: /Special:RecentChanges
text: Recent changes text: Recent changes
- url: /Special:LongPages
text: Long pages
- url: /Special:ShortPages
text: Short pages
- url: /Special:ListUsers - url: /Special:ListUsers
text: All the users text: All the users

View File

@ -23,5 +23,9 @@ global_pages:
text: Tous les pages text: Tous les pages
- url: /Special:RecentChanges - url: /Special:RecentChanges
text: Modifications récentes text: Modifications récentes
- url: /Special:LongPages
text: Pages longues
- url: /Special:ShortPages
text: Pages courtes
- url: /Special:ListUsers - url: /Special:ListUsers
text: Tous les utilisateurs text: Tous les utilisateurs

View File

@ -7,7 +7,7 @@ menu: ['global']
<ul class="columns"> <ul class="columns">
{%- for page in wiki_pages -%} {%- for page in wiki_pages -%}
<li> <li>
<a href="/{{ page.slug }}.html">{{ page.title }}</a> <a href="{{ page.url }}.html">{{ page.title }}</a>&nbsp; [{{ page.bytes }} bytes]
{%- if page.author -%}&nbsp;(by <a href="/{{ site.data.i18n[site.lang].prefix.user }}{{ page.author }}.html">{{ page.author }}</a>) {%- endif -%} {%- if page.author -%}&nbsp;(by <a href="/{{ site.data.i18n[site.lang].prefix.user }}{{ page.author }}.html">{{ page.author }}</a>) {%- endif -%}
</li> </li>
{%- endfor -%} {%- endfor -%}

View File

@ -0,0 +1,14 @@
---
layout: default
title: Long pages
menu: ['global']
---
{%- include /functions/wiki-pages.html -%}
{%- assign long_pages = wiki_pages | sort: 'bytes' | reverse -%}
<ol>
{%- for page in long_pages limit:50 -%}
<li>
<a href="{{ page.url }}.html">{{ page.title }}</a>&nbsp; [{{ page.bytes }} bytes]
</li>
{%- endfor -%}
</ol>

View File

@ -8,7 +8,7 @@ menu: ['global']
<ul> <ul>
{%- for page in recent_changes limit:20 -%} {%- for page in recent_changes limit:20 -%}
<li> <li>
<a href="/{{ page.slug }}.html">{{ page.title }}</a> <a href="{{ page.url }}.html">{{ page.title }}</a>
&nbsp;- {{ page.modified }} &nbsp;- {{ page.modified }}
</li> </li>
{%- endfor -%} {%- endfor -%}

View File

@ -0,0 +1,14 @@
---
layout: default
title: Short pages
menu: ['global']
---
{%- include /functions/wiki-pages.html -%}
{%- assign long_pages = wiki_pages | sort: 'bytes' -%}
<ol>
{%- for page in long_pages limit:50 -%}
<li>
<a href="{{ page.url }}.html">{{ page.title }}</a>&nbsp; [{{ page.bytes }} bytes]
</li>
{%- endfor -%}
</ol>

View File

@ -0,0 +1,13 @@
Jekyll::Hooks.register :documents, :pre_render do |post|
end
Jekyll::Hooks.register :documents, :post_render do |doc|
# Jekyll.logger.info "Generating:", "Firing :pages, :post_render for : #{post.content}"
if doc.content then
doc.data['size']=doc.content.size
doc.data['bytes']=doc.content.bytesize
else
doc.data['size']=0
doc.data['bytes']=0
end
end

View File

@ -6,7 +6,9 @@ body {
#main { #main {
background: #ffffff; background: #ffffff;
border-left: #acabab solid 2px;
padding: 1em; padding: 1em;
z-index: 0;
} }
#menu { #menu {

View File

@ -5,7 +5,7 @@ tags: Example
toc: false toc: false
author: Alexis author: Alexis
created: 2009-01-01 created: 2009-01-01
modified: 2009-01-01 modified: 2009-01-02
revisions: revisions:
- author: Alexis - author: Alexis
date: 2009-01-01 date: 2009-01-01