Skip to content

Commit

Permalink
Port "readable" theme from Coleslaw.
Browse files Browse the repository at this point in the history
  • Loading branch information
svetlyak40wt committed Apr 30, 2024
1 parent 3a0eff9 commit 78c109c
Show file tree
Hide file tree
Showing 16 changed files with 213 additions and 10 deletions.
15 changes: 9 additions & 6 deletions example/.staticlrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
;;; -*- mode : lisp -*-
(in-package staticl-user)
(in-package #:staticl-user)

(asdf:load-system "staticl/format/spinneret")

Expand All @@ -17,12 +17,15 @@
:page-title-fn (lambda (num)
(fmt "Страница ~A" num)))
(rss :target-path #P"ru/blog/rss.xml")
(atom :target-path #P"ru/blog/atom.xml"))
(atom :target-path #P"ru/blog/atom.xml")
(tags-index :target-path "ru/tags/"))
(filter (:path "ru/" :invert t)
(prev-next-links)
(paginated-index :target-path #P"blog/")
(rss :target-path #P"blog/rss.xml")
(atom :target-path #P"blog/atom.xml"))
(sitemap)
;; (rsync "my-site")
))
(atom :target-path #P"blog/atom.xml")
(tags-index :target-path "tags/"))
(sitemap))
:theme "readable"
;; :theme "hyde"
)
2 changes: 2 additions & 0 deletions example/blog/second.post
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ format: md

Сегодня расскажу ещё про один мой проект, который так и не превратился в продукт. Правда в отличие от 12forks.com, этот проект жив до сих пор. Проект связан с GitHub и полезен тем, кто развивает фреймворк или библиотеку, предназначенную для разных платформ, языков программирования или операционных систем.

<!--more-->

На GitHub есть возможность запускать тесты вашей библиотеки в так называемой "матрице". То есть тесты запускаются для различных комбинаций одного или нескольких параметров. В качестве параметров часто выступают разные OS и версии языка программирования. В зависимости от языка, сюда можно добавить и разные реализации, например Python библиотеку можно тестировать и под CPython и под PyPi, а уж сколько доступно реализаций Common Lisp, я вообще молчу!

У меня много Opensource библиотек для Common Lisp и многие из них для меня системо-образующие - хотелось бы чтобы они работали для как можно большего числа реализаций CL и под разными операционными системами. Однако как показать, для каких комбинаций OS и реализации языка тесты успешно проходят? Нормального способа я не нашёл, и поэтому решил сделать свой "велосипед". Так получился GitHub Actions.
Expand Down
2 changes: 1 addition & 1 deletion qlfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
("ultralisp" .
(:class qlot/source/dist:source-dist
:initargs (:distribution "https://dist.ultralisp.org/" :%version :latest)
:version "20240428124000"))
:version "20240430080501"))
("slynk" .
(:class qlot/source/github:source-github
:initargs (:repos "svetlyak40wt/sly" :ref nil :branch "patches" :tag nil)
Expand Down
4 changes: 2 additions & 2 deletions themes/hyde/base.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="//fonts.googleapis.com/css?family=Vollkorn:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css" />
<link href="//fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet" type="text/css" />
<link href= "{$site.domain}/css/style.css" rel="stylesheet" type="text/css" />
<link rel="alternate" href="{$site.domain}/rss.xml" type="application/rss+xml" />
<link href= "/css/style.css" rel="stylesheet" type="text/css" />
<link rel="alternate" href="/rss.xml" type="application/rss+xml" />
{if $injections.head}
{foreach $injection in $injections.head}
{$injection |noAutoescape}
Expand Down
2 changes: 1 addition & 1 deletion themes/hyde/index.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
{if $months}
<div id="monthsoup">
<p>View content from
{foreach $month in $months}
{foreach $month in $content.months}
<a href="{$month.url}">{$month.name}</a>{nil}
{if not isLast($month)},{sp}{/if}
{/foreach}
Expand Down
72 changes: 72 additions & 0 deletions themes/readable/base.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{namespace coleslaw.theme.readable}

{template base}
<!DOCTYPE html>{\n}
<html lang="{$site.lang}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={$site.charset}">
<title>{$site.title}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="/css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="/css/custom.css" rel="stylesheet" media="screen">
<link rel="alternate" href="/rss.xml" type="application/rss+xml" />
{if $injections.head}
{foreach $injection in $injections.head}
{$injection |noAutoescape}
{/foreach}
{/if}
</head>
<body>
<div class="container-fluid">
<div class="row-fluid">
<div class="offset2 span8">
<div class="row-fluid">
<div class="navbar navbar-inverse">
<div class="navbar-inner">
<a class="brand" href="/">{$site.title}</a>
<ul class="nav">
{foreach $link in $site.navigation.items}
<li>
<a href="{$link.url}">{$link.title}</a>
</li>
{/foreach}
</ul>
</div>
</div>
</div>

<div class="row-fluid">
{$raw |noAutoescape}
</div>

{if $injections.body}
{foreach $injection in $injections.body}
<div class="row-fluid">
{$injection |noAutoescape}
</div>
{/foreach}
{/if}

<div class="row-fluid">
<hr>
<p class="fineprint">Unless otherwise credited all material
{if $site.license}
{$site.license}
{else}
<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_US">
<img alt="Creative Commons License" style="border-width:0" src="/img/cc-by-sa.png" />
</a>
{/if}
by {$site.author}
<a id="staticl-logo" href="https://github.com/40ants/staticl">
<img src="/img/logo_small.jpg" alt="Coleslaw logo" /></p>
</a>
</div>
</div>
</div>
</div>

<script src="/js/bootstrap.min.js"></script>
</body>
</html>
{/template}
9 changes: 9 additions & 0 deletions themes/readable/css/bootstrap.min.css

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions themes/readable/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#coleslaw-logo { float: right; }
hr {
border: 0;
height: 1px;
background-image: -webkit-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,0.75), rgba(0,0,0,0));
background-image: -moz-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,0.75), rgba(0,0,0,0));
background-image: -ms-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,0.75), rgba(0,0,0,0));
background-image: -o-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,0.75), rgba(0,0,0,0));
}
pre { overflow: auto; }
p.date-posted { font-style: italic; }
p.fineprint { font-size: smaller; }

/* Stolen from lisppaste for the colorize output of 3bmd */
.paste { background-color: #F4F4F4; color: black; }
.paste:hover { background-color: #F4F4F4; color: black; }
.symbol { color : #770055; background-color : transparent; border: 0px; margin: 0px;}
.special { color : #FF5000; background-color : inherit; }
.keyword { color : #770000; background-color : inherit; }
.comment { color : #007777; background-color : inherit; }
.string { color : #777777; background-color : inherit; }
.atom { color : #314F4F; background-color : inherit; }
.macro { color : #FF5000; background-color : inherit; }
.variable { color : #36648B; background-color : inherit; }
.function { color : #8B4789; background-color : inherit; }
.attribute { color : #FF5000; background-color : inherit; }
.character { color : #0055AA; background-color : inherit; }
.syntaxerror { color : #FF0000; background-color : inherit; }
.diff-deleted { color : #5F2121; background-color : inherit; }
.diff-added { color : #215F21; background-color : inherit; }
span.paren1 { background-color : inherit; -webkit-transition: background-color 0.2s linear; }
span.paren1:hover { color : inherit; background-color : #BAFFFF; }
span.paren2 { background-color : inherit; -webkit-transition: background-color 0.2s linear; }
span.paren2:hover { color : inherit; background-color : #FFCACA; }
span.paren3 { background-color : inherit; -webkit-transition: background-color 0.2s linear; }
span.paren3:hover { color : inherit; background-color : #FFFFBA; }
span.paren4 { background-color : inherit; -webkit-transition: background-color 0.2s linear; }
span.paren4:hover { color : inherit; background-color : #CACAFF; }
span.paren5 { background-color : inherit; -webkit-transition: background-color 0.2s linear; }
span.paren5:hover { color : inherit; background-color : #CAFFCA; }
span.paren6 { background-color : inherit; -webkit-transition: background-color 0.2s linear; }
span.paren6:hover { color : inherit; background-color : #FFBAFF; }
Binary file added themes/readable/img/cc-by-sa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/readable/img/glyphicons-halflings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/readable/img/logo_small.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions themes/readable/index.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{namespace coleslaw.theme.readable}

{template index}
<h1 class="page-header">{$content.title}</h1>
{foreach $obj in $content.items}
<div class="row-fluid">
<h1><a href="{$obj.url}">{$obj.title}</a></h1>
<p class="date-posted">posted on {$obj.created_at | date}</p>
{$obj.excerpt |noAutoescape}

{if $obj.has_more}<p><a href="{$obj.url}">Read more...</a></p>{/if}
</div>
{/foreach}
<div id="relative-nav">
<ul class="pager">
{if $content.prev} <li class="previous"><a href="{$content.prev.url}">Previous</a></li> {/if}
{if $content.next} <li class="next"><a href="{$content.next.url}">Next</a></li> {/if}
</ul>
</div>
{if $content.tags}
<div class="row-fluid">
<p>This blog covers
{foreach $tag in $content.tags}
<a href="{$tag.url}">{$tag.name}</a>{nil}
{if not isLast($tag)},{sp}{/if}
{/foreach}
</p>
</div>
{/if}
{if $months}
<div class="row-fluid">
<p>View content from
{foreach $month in $content.months}
<a href="{$month.url}">{$month.name}</a>{nil}
{if not isLast($month)},{sp}{/if}
{/foreach}
</p>
</div>
{/if}
{/template}
6 changes: 6 additions & 0 deletions themes/readable/js/bootstrap.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions themes/readable/post.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{namespace coleslaw.theme.readable}

{template post}
<div class="row-fluid">{\n}
<h1 class="page-header">{$content.title}</h1>{\n}
<p>
{if $content.tags}
Tagged as {foreach $tag in $content.tags}
{if $tag.url}<a href="{$tag.url}">{$tag.name}</a>{else}<b>{$tag.name}</b>{/if}{nil}
{if not isLast($tag)},{sp}{/if}
{/foreach}
{/if}
</p>
<p class="date-posted">
{if $content.date}
Written on {$content.date}
{/if}
</p>

{$content.html |noAutoescape}

<ul class="pager">
{if $content.prev}<li class="previous"><a href="{$content.prev.url}">&larr; Previous</a></li>{/if}{\n}
{if $content.next}<li class="next"><a href="{$content.next.url}">Next &rarr;</a></li>{/if}{\n}
</ul>
</div>{\n}
{/template}
2 changes: 2 additions & 0 deletions themes/readable/theme.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(:class "closure-template"
:namespace "coleslaw.theme.readable")

0 comments on commit 78c109c

Please sign in to comment.