fix blog index and links

This commit is contained in:
Torsten Ruger 2018-04-10 22:48:23 +03:00
parent d233cb0dca
commit c143b5bbd0
5 changed files with 21 additions and 18 deletions

View File

@ -1,2 +1,9 @@
module ApplicationHelper
def post_link(index)
post = Post.posts.values[index]
return "" unless post
link = post.date.to_s + " "
link += link_to( post.title , blog_post_url(post.slug))
link.html_safe
end
end

View File

@ -1,9 +1,9 @@
.blog.blog_index
- @pages.each do |slug , page|
- @posts.each do |slug , post|
.row
.col-md-2
.col-md-8
%h2= link_to page.title , blog_page_url(page.slug)
= render( page.template_name )[0 ... 350].html_safe
%span.whole= link_to ". . . .Read whole post" , blog_page_url(page.slug)
%h2= link_to post.title , blog_post_url(post.slug)
= render( "posts/#{post.template_name}" )[0 ... 350].html_safe
%span.whole= link_to ". . . .Read whole post" , blog_post_url(post.slug)
.col-md-2

View File

@ -77,13 +77,8 @@
%a{:href => "https://groups.google.com/forum/#!forum/ruby-x"} mail
%h2.center News
%p
Last but not least, i try to get recent developments down on paper when they are still fresh.
%p
{{ site.posts[0].date | date: "%d.%m.%y" }}:
%a{:href => "{{ site.posts[0].url }}"} {{ site.posts[0].title }}
%p
{{ site.posts[1].date | date: "%d.%m.%y" }}:
%a{:href => "{{ site.posts[1].url }}"} {{ site.posts[1].title }}
%p
{{ site.posts[2].date | date: "%d.%m.%y" }}:
%a{:href => "{{ site.posts[2].url }}"} {{ site.posts[2].title }}
Last but not least, i try to get recent developments down on paper when they are
still fresh.
%p=post_link(0)
%p=post_link(1)
%p=post_link(2)

View File

@ -7,10 +7,11 @@
The
%a{:href => "/rubyx/layers.html"} architecture
document outlines this in more detail, but in short:
\- types are immutable
\- every object has a type (which may change)
\- a type implements the interface of a class at a given time
\- a type is defined by a list of attribute names
%ul
%li types are immutable
%li every object has a type (which may change)
%li a type implements the interface of a class at a given time
%li a type is defined by a list of attribute names
%p
%img{:alt => "Types diagram", :src => "/assets/types.jpg"}/
%h3#how-classes-work How classes work