Browse Source

+ add Statocles-specific files

master
Alex 'AdUser' Z 9 years ago
commit
ca58413bda
  1. 80
      site.yml
  2. 33
      theme/blog/index.atom.ep
  3. 44
      theme/blog/index.html.ep
  4. 34
      theme/blog/index.rss.ep
  5. 20
      theme/blog/post.html.ep
  6. BIN
      theme/img/favicon.ico
  7. BIN
      theme/img/favicon.png
  8. BIN
      theme/img/headbg.jpg
  9. BIN
      theme/img/images.png
  10. BIN
      theme/img/logo.png
  11. BIN
      theme/img/pcreate.png
  12. BIN
      theme/img/pdownload.png
  13. BIN
      theme/img/rss.png
  14. BIN
      theme/img/tag.png
  15. BIN
      theme/img/time.png
  16. BIN
      theme/img/upload.png
  17. BIN
      theme/img/user.png
  18. 43
      theme/site/layout.html.ep
  19. 4
      theme/site/robots.txt.ep
  20. 11
      theme/site/sitemap.xml.ep

80
site.yml

@ -0,0 +1,80 @@
---
# apps section
articles_app:
args:
store: articles
url_root: /articles
class: Statocles::App::Blog
events_app:
args:
store: events
url_root: /events
class: Statocles::App::Basic
pages_app:
args:
store: pages
url_root: /pages
class: Statocles::App::Basic
projects_app:
args:
store: projects
url_root: /projects
class: Statocles::App::Basic
topdir_app:
args:
store: topdir
url_root: /
class: Statocles::App::Basic
# deploy section
deploy:
args:
path: html
class: Statocles::Deploy::File
# site section
site:
args:
apps:
articles:
$ref: articles_app
events:
$ref: events_app
pages:
$ref: pages_app
projects:
$ref: projects_app
topdir:
$ref: topdir_app
base_url: https://linuxdv.org
deploy:
$ref: deploy
nav:
main:
- href: /
title: Главная
- href: /articles/
title: Статьи
- href: /events/
title: События
- href: /projects/
title: Проекты
- href: /pages/services/
title: Сервисы
- href: /pages/links/
title: Ссылки
- href: /forum/
title: Форум
theme:
$ref: theme
title: Linux во Владивостоке
markdown:
$class: Text::MultiMarkdown
class: Statocles::Site
on:
- build:
$class: Statocles::Plugin::LinkCheck
$sub: check_pages
# theme section
theme:
args:
store: theme
class: Statocles::Theme

33
theme/blog/index.atom.ep

@ -0,0 +1,33 @@
<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<id><%= $site->url($self->links('alternate')->href) %></id>
<title><%= $site->title %></title>
<updated><%= Time::Piece->new->strftime('%Y-%m-%dT%H:%M:%SZ') %></updated>
<link rel="self" href="<%= $site->url($self->path) %>"/>
<link rel="alternate" href="<%= $site->url($self->links('alternate')->href) %>"/>
<generator version="<%= $Statocles::VERSION %>">Statocles</generator>
% for my $p (@{ $pages }) {
<entry>
<id><%= $site->url($p->path) %></id>
<title><%= $p->title %></title>
% if ($p->author) {
<author><name><%= $p->author %></name></author>
% }
<link rel="alternate" href="<%= $site->url($p->path) %>" />
<content type="html"><![CDATA[
% my @sections = $p->sections;
<%= $sections[0] %>
<p><a href="<%= $site->url($p->path) %>#section-2">Далее...</a></p>
<p>Теги:
% for my $tag ($p->tags) {
<a href="<%= $tag->href %>"><%= $tag->text %></a>
% }
</p>
]]></content>
<updated><%= $p->date->strftime('%Y-%m-%dT%H:%M:%SZ') %></updated>
% for my $t ($p->tags) {
<category term="<%= $t->text %>" />
% }
</entry>
% }
</feed>

44
theme/blog/index.html.ep

@ -0,0 +1,44 @@
% if (my $tag_text = $self->data->{tag_text}) {
<p><%= $tag_text %></p>
% }
% for my $page (@$pages) {
<div class="article">
<h2><a class="header" href="<%= $app->page_url($page) %>"><%= $page->title %></a></h2>
% my @sections = $page->sections;
<%= $sections[0] %>
% if (@sections > 1) {
<p><a href="<%= $app->page_url($page) %>#section-2">&rarr;&nbsp;Читать дальше...</a></p>
% }
<div class="bottom_bar">
<span class="date"><%= $page->date->strftime('%Y-%m-%d') %></span>
% if ($page->author) {
<span class="user"><%= $page->author %></span>
% }
<span class="tags">
% for my $tag ($page->tags) {
<a href="<%= $tag->href %>" rel="tag"><%= $tag->text %></a>
% }
</span>
</div>
</div>
% }
<div class="pager">
<a class="button next <%= $self->prev ? 'button-primary' : 'disabled' %>"
rel="prev" href="<%= $self->prev // '' %>">&larr; Следующие
</a>
|
<a class="button prev <%= $self->next ? 'button-primary' : 'disabled' %>"
rel="next" href="<%= $self->next // '' %>">Предыдущие &rarr;
</a>
</div>
% if (my @links = $self->links('feed')) {
<div class="feeds">
% for my $link (@links) {
<a href="<%= $link->href %>" rel="alternate" type="<%= $link->type %>"><%= $link->text %></a>
% }
</div>
% }

34
theme/blog/index.rss.ep

@ -0,0 +1,34 @@
%# RSS requires date/time in the 'C' locale as per RFC822. strftime() is one of
%# the few things that actually cares about locale.
% use POSIX qw(locale_h);
% my $current_locale = setlocale(LC_TIME);
% setlocale(LC_TIME, 'C');
<?xml version="1.0"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title><%= $site->title %></title>
<link><%= $site->url($self->links('alternate')->href) %></link>
<atom:link href="<%= $site->url($self->path) %>" rel="self" type="application/rss+xml" />
<description>Записи из <%= $site->title %></description>
<generator>Statocles <%= $Statocles::VERSION %></generator>
% for my $p (@$pages) {
<item>
<title><%= $p->title %></title>
<link><%= $site->url($p->path) %></link>
<guid><%= $site->url($p->path) %></guid>
<description><![CDATA[
% my @sections = $p->sections;
<%= $sections[0] %>
<p><a href="<%= $site->url($p->path) %>#section-2">Далее...</a></p>
<p>Теги:
% for my $tag ($p->tags) {
<a href="<%= $tag->href %>"><%= $tag->text %></a>
% }
</p>
]]></description>
<pubDate><%= $p->date->strftime('%a, %d %b %Y %H:%M:%S ') . sprintf q{%+05d}, $p->date->tzoffset / 36 %></pubDate>
</item>
% }
</channel>
</rss>
% setlocale(LC_TIME, $current_locale);

20
theme/blog/post.html.ep

@ -0,0 +1,20 @@
<div class="article">
% my @sections = $self->sections;
% for my $i ( 0..$#sections ) {
<%= $sections[$i] %>
% }
<div class="bottom_bar">
% if ($self->author) {
<span class="user"><%= $self->author %></span>
% }
% if (my @tags = $self->tags) {
<span class="tags">
% for my $tag (@tags) {
<a href="<%= $tag->href %>"><%= $tag->text %></a>
% }
</span>
% }
</div>
<div id="comments"><!-- loaded with ajax --></div>
</div>

BIN
theme/img/favicon.ico

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
theme/img/favicon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

BIN
theme/img/headbg.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

BIN
theme/img/images.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 661 B

BIN
theme/img/logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
theme/img/pcreate.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 B

BIN
theme/img/pdownload.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 523 B

BIN
theme/img/rss.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 530 B

BIN
theme/img/tag.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 613 B

BIN
theme/img/time.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 793 B

BIN
theme/img/upload.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 516 B

BIN
theme/img/user.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 722 B

43
theme/site/layout.html.ep

@ -0,0 +1,43 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="statocles" />
<link rel="shortcut icon" href="/theme/img/favicon.ico" />
<link rel="stylesheet" href="/theme/css/default.css" type="text/css" />
<title><%= $self->title ? $self->title . ' - ' : '' %><%= $site->title %></title>
% for my $link ($self->links('feed')) {
<link rel="alternate" href="<%= $link->href %>" type="<%= $link->type %>" />
% }
</head>
<body>
<div id="main">
<div id="sidebar">
<a href="/" id="home">
<img src="/theme/img/logo.png" style="border: 0px; margin: 2px 10px;">
</a>
<h5>Навигация:</h5>
<ul id="sidenav" class="ui-block">
% my @nav_links = $site->nav('main');
% for my $nav (@nav_links) {
<li><a href="<%= $nav->href %>"><%= $nav->text %></a></li>
% }
</ul>
</div>
<div id="content" class="ui-block">
% if ($self->title) {
<h1><%= $self->title %></h1>
% }
%= $content
</div>
</div>
<div id="footer" class="ui-block">
</div>
<script type="text/javascript" src="/theme/js/jquery.js"></script>
<script type="text/javascript" src="/theme/js/main.js"></script>
</body>
</html>

4
theme/site/robots.txt.ep

@ -0,0 +1,4 @@
Sitemap: <%= $site->url('sitemap.xml') %>
User-Agent: *
Disallow:

11
theme/site/sitemap.xml.ep

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
% for my $page (@$pages) {
<url>
<loc><%= $site->url($page->path) %></loc>
<changefreq><%= $page->search_change_frequency %></changefreq>
<priority><%= $page->search_priority %></priority>
<lastmod><%= $page->date->strftime('%Y-%m-%d') %></lastmod>
</url>
% }
</urlset>
Loading…
Cancel
Save