Skip to content
Snippets Groups Projects
Verified Commit 1752c672 authored by David Beniamine's avatar David Beniamine
Browse files

initial commit

parents
Branches
Tags
No related merge requests found
404.php 0 → 100644
<?php theme_include('header'); ?>
<section class="content wrap">
<h1>Page non trouv&eacute;e</h1>
<p>Malheureusement la page <code>/<?php echo htmlspecialchars(current_url()); ?></code> est introuvable.
Vous pouvez retourner &agrave; <a href="<?php echo base_url(); ?>">l'accueil</a>, ou tenter une <a href="#search">recherche</a>.</p>
</section>
<?php theme_include('footer'); ?>
Theme name: Tetras-libre
Description: Theme inspire du theme anchor par defaut.
Author name: David Beniamine, d'après le travail de Visual Idiot
<?php theme_include('header'); ?>
<section class="content wrap" id="article-<?php echo article_id(); ?>">
<h1><?php echo article_title(); ?></h1>
<article>
<?php echo article_markdown(); ?>
</article>
<section class="footnote">
<!-- Unfortunately, CSS means everything's got to be inline. -->
<p>Article num&eacute;ro: <?php echo numeral(article_number(article_id()), true); ?> . <?php echo count_words(article_markdown()); ?> mots, <?php if(comments_open()): ?>,
<?php echo total_comments() commentaires pour le moment.<?php endif; ?> <?php echo article_custom_field('attribution'); ?></p>
</section>
</section>
<?php if(comments_open()): ?>
<section class="comments">
<?php if(has_comments()): ?>
<ul class="commentlist">
<?php $i = 0; while(comments()): $i++; ?>
<li class="comment" id="comment-<?php echo comment_id(); ?>">
<div class="wrap">
<h2><?php echo comment_name(); ?></h2>
<time><?php echo relative_time(comment_time()); ?></time>
<div class="content">
<?php echo htmlspecialchars(comment_text()); ?>
</div>
<span class="counter"><?php echo $i; ?></span>
</div>
</li>
<?php endwhile; ?>
</ul>
<?php endif; ?>
<form id="comment" class="commentform wrap" method="post" action="<?php echo comment_form_url(); ?>#comment">
<?php echo comment_form_notifications(); ?>
<p class="name">
<label for="name">Nom :</label>
<?php echo comment_form_input_name('placeholder="Nom"'); ?>
</p>
<p class="email">
<label for="email">Addresse email :</label>
<?php echo comment_form_input_email('placeholder="Addresse email (non publi&eacute;e)"'); ?>
</p>
<p class="textarea">
<label for="text">Commentaire :</label>
<?php echo comment_form_input_text('placeholder="Commentaire"'); ?>
</p>
<p class="submit">
<?php echo comment_form_button(); ?>
</p>
</form>
</section>
<?php endif; ?>
<?php theme_include('footer'); ?>
/**
* Anchor, default reset
*/
* {
margin: 0;
padding: 0;
-webkit-font-smoothing: antialiased;
/* Don't count padding and borders towards widths */
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
/**
* Typographic reset
*/
body {
/* Use a serif font for nice readability, but not Times */
font: 17px/26px Skolar, Tisa, "Chaparral Pro", Merriweather, Georgia, serif;
}
h1, h2, h3, h4, h5, #logo, #top, .slidey b, .slidey label, .counter, input, textarea, button, .pagination {
font-family: "Helvetica Neue", sans-serif;
font-weight: 300;
}
pre, code, .mono {
font: 12px/19px "Anonymous Pro", Consolas, monospace;
padding: 0 2px;
}
p {
padding-bottom: 15px;
}
pre {
padding: 15px 20px;
margin-bottom: 20px;
border-radius: 5px;
white-space: pre-wrap;
}
img {
max-width: 100%;
height: auto;
}
a {
text-decoration: none;
}
a img {
border: none;
}
/**
* Layout reset
*/
.wrap {
min-width: 280px;
max-width: 750px;
width: 60%;
margin: 0 auto;
}
/**
* Default colours
*/
body, .items > li:first-child {
color: #6e8678;
}
a, .items h1 a:hover {
color: #40c375;
}
a:hover {
color: #1e924d;
}
pre, .hilite, mark {
background: #f9f6ea;
color: #8b657c;
text-shadow: 0 1px 0 rgba(255,255,255,.2);
}
input, textarea {
color: #698172;
}
::-webkit-input-placeholder {
color: #b2c5b9;
}
:-moz-placeholder, :placeholder {
color: #b2c5b9;
}
.error, .success {
padding: 20px 30px;
margin-bottom: 30px;
background: #e25d47;
color: #fff;
border-radius: 5px;
}
.success {
background: #88be33;
}
.error p, .success p {
float: none !important;
width: 100%;
padding: 0;
margin: 0 !important;
}
/**
* Transitions and animations
*/
a, a img {
-webkit-transition: opacity .2s, color .2s;
-moz-transition: opacity .2s, color .2s;
transition: opacity .2s, color .2s;
}
/**
* Small device CSS, mostly to fix alignment
*/
#top {
position: relative;
}
#top .tray {
position: absolute;
right: 10px;
top: 10px;
}
#top #logo, #top ul {
float: none;
}
#top ul li {
padding: 10px 15px 0 0;
}
.slidey form, .slidey aside {
float: none;
width: 100%;
}
.slidey form {
margin-bottom: 25px;
}
#comment p, .footnote {
float: none;
width: 100%;
white-space: normal;
}
#bottom {
padding: 20px 0;
}
#bottom small {
display: block;
}
#bottom ul {
overflow: hidden;
float: none;
margin-bottom: 15px;
}
#bottom li {
padding: 15px 15px 0 0;
}
/**
*
*/
h1 {
padding: 80px 0 40px;
font-size: 40px;
line-height: 48px;
color: #506257;
}
.search h1 {
padding: 60px 0;
}
/* The slide-down panel at the very top of the page. Like literally. It's above the page, hidden. */
.slidey {
overflow: hidden;
padding: 30px 0;
background: #f3f5f8;
border-bottom: 1px solid #e5e8ed;
}
.js-enabled .slidey {
-webkit-transition: margin-top .2s;
-moz-transition: margin-top .2s;
transition: margin-top .2s;
}
.slidey b, .slidey label {
display: block;
font-weight: 500;
padding-bottom: 15px;
font-size: 15px;
font-weight: 500;
}
.slidey form, .slidey aside {
float: left;
width: 50%;
}
.slidey form input {
padding: 20px;
width: 75%;
}
.slidey li {
list-style: none;
}
.slidey a {
display: block;
text-decoration: none;
color: #718579;
}
.slidey a:hover {
color: #41594b;
}
.slidey li span {
float: right;
opacity: .6;
}
#top {
overflow: hidden;
padding: 20px 35px;
background: #fff;
border-bottom: 1px solid rgba(22,36,54,.1);
}
#top a {
float: left;
font-size: 13px;
font-weight: 500;
text-decoration: none;
color: #88a795;
}
#top #logo:hover, #top ul a:hover, #top ul .active a, .posts .items li:first-child h2 a:hover, p a:hover {
color: #41b171;
}
#top ul {
list-style: none;
float: right;
}
#top ul li {
float: left;
padding-left: 40px;
}
#top ul a {
display: inline-block;
color: #556d5f;
}
#top ul img {
display: inline-block;
vertical-align: middle;
position: relative;
top: -2px;
width: 16px;
height: 16px;
opacity: .4;
}
#top ul a:hover img {
opacity: .7;
}
#top ul a.active img {
opacity: 1;
}
/**
* Index page listing, category listing, search page results
*/
.items {
list-style: none;
}
.items > li {
padding: 70px 0 60px;
color: #97c9ae;
background: #3c4552;
}
.posts .items > li:first-child {
background: #fff !important;
padding: 110px 0;
}
.items li h1 a, .posts .items > li:first-child h2 a {
color: #3d5145;
}
.items h1 {
padding: 0 0 8px;
}
.items h1 a {
text-decoration: none;
}
.items h2 {
font-size: 32px;
line-height: 41px;
}
.items h2 a {
display: block;
padding-bottom: 12px;
color: #fff;
color: rgba(176,200,236,.8);
text-decoration: none;
}
.items h2 a:hover {
color: #fff;
}
.items .content {
padding: 10px 0 0;
}
.items .content p {
padding-bottom: 15px;
}
/**
* Pagination
*/
.pagination {
overflow: hidden;
padding: 30px 0;
margin-bottom: 50px;
border-top: 1px solid rgba(22,36,54,.1);
border-bottom: 1px solid rgba(22,36,54,.1);
}
.pagination:empty {
display: none;
}
.pagination a {
float: left;
text-decoration: none;
font-size: 13px;
font-weight: 500;
color: #6f8b7b;
}
.pagination a:hover {
color: #3c5748;
}
.pagination .next {
float: right;
}
/**
* Give some extra space to single-page wrappers
*/
.content {
padding-bottom: 50px;
}
.content ul, .content ol, .items li ul {
padding: 20px 30px;
}
.content ul ul, .content ol ol, .items li ul ul {
padding: 0 20px;
}
.content blockquote {
border-left: 3px solid #98a2b1;
padding-left: 15px;
margin: 15px 0;
}
/**
* Footnotes and straplines
*/
.footnote, .commentlist time, .items footer {
display: block;
padding: 5px 0 15px;
color: #98b1a2;
font-size: 14px;
font-style: italic;
white-space: nowrap;
}
.footnote {
padding: 20px 0 40px;
}
/**
* Comment form
*/
ul.commentlist {
margin-bottom: 40px;
list-style: none;
border-top: 1px solid rgba(22,36,54,.1);
}
ul.commentlist .wrap {
position: relative;
}
ul.commentlist li {
padding: 40px 0;
border-bottom: 1px solid rgba(22,36,54,.1);
}
ul.commentlist time {
font-size: 13px;
}
ul.commentlist h2 {
font-size: 25px;
line-height: 33px;
}
ul.commentlist .counter {
position: absolute;
right: 0;
top: 0;
font-size: 25px;
font-weight: 300;
color: #cddad2;
}
#comment {
overflow: hidden;
}
#comment label[for] {
display: none;
}
#comment p {
float: left;
width: 48%;
margin-right: 4%;
margin-bottom: 10px;
text-indent: 0;
}
#comment p + p {
margin-right: 0;
}
#comment p.textarea {
float: none;
width: 100%;
}
#comment input, #comment textarea {
width: 100%;
padding: 10px 15px;
font-size: 15px;
font-weight: normal;
border: 1px solid rgba(22,36,54,.2);
border-radius: 4px;
}
#comment input:focus, #comment textarea:focus {
outline: none;
background: #f7f9fc;
}
#comment textarea {
min-height: 150px;
max-height: 800px;
resize: vertical;
}
#comment button {
display: inline-block;
padding: 9px 18px;
background: #4e82ce;
color: #fff;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 13px;
font-weight: 500;
}
#comment button:hover {
background: #3c6eb7;
}
/**
* Footer
*/
#bottom {
padding: 30px 0 40px;
}
#bottom ul {
float: right;
list-style: none;
}
#bottom li {
float: left;
padding-left: 35px;
font-size: 14px;
}
#bottom a {
text-decoration: none;
}
<div class="wrap">
<footer id="bottom">
<small>&copy; <?php echo date('Y'); ?> <?php echo site_name(); ?>.
<br/>
Sauf mention contraire, tout le contenu de ce site est plac&eacute; sous licence creative common CC-BY-SA.
<a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a></small>
<ul role="navigation">
<li><a href="<?php echo rss_url(); ?>">RSS</a></li>
<?php if(twitter_account()): ?>
<li><a href="<?php echo twitter_url(); ?>">@<?php echo twitter_account(); ?></a></li>
<?php endif; ?>
<li><a href="<?php echo base_url('admin'); ?>" title="Administration">Administration</a></li>
<li><a href="<?php echo base_url(); ?>" title="Retour &agrave; l'accueil.">Accueil</a></li>
</ul>
</footer>
</div>
</div>
</body>
</html>
<?php
/*
Custom theme functions
Note: we recommend you prefix all your functions to avoid any naming
collisions or wrap your functions with if function_exists braces.
*/
function numeral($number, $hideIfOne = false) {
if($hideIfOne === true and $number == 1) {
return '';
}
$test = abs($number) % 10;
$ext = ((abs($number) % 100 < 21 and abs($number) % 100 > 4) ? 'th' : (($test < 4) ? ($test < 3) ? ($test < 2) ? ($test < 1) ? 'th' : 'st' : 'nd' : 'rd' : 'th'));
return $number . $ext;
}
function count_words($str) {
return count(preg_split('/\s+/', strip_tags($str), null, PREG_SPLIT_NO_EMPTY));
}
function pluralise($amount, $str, $alt = '') {
return intval($amount) === 1 ? $str : $str . ($alt !== '' ? $alt : 's');
}
function relative_time($date) {
if(is_numeric($date)) $date = '@' . $date;
$user_timezone = new DateTimeZone(Config::app('timezone'));
$date = new DateTime($date, $user_timezone);
// get current date in user timezone
$now = new DateTime('now', $user_timezone);
$elapsed = $now->format('U') - $date->format('U');
if($elapsed <= 1) {
return 'Just now';
}
$times = array(
31104000 => 'year',
2592000 => 'month',
604800 => 'week',
86400 => 'day',
3600 => 'hour',
60 => 'minute',
1 => 'second'
);
foreach($times as $seconds => $title) {
$rounded = $elapsed / $seconds;
if($rounded > 1) {
$rounded = round($rounded);
return $rounded . ' ' . pluralise($rounded, $title) . ' ago';
}
}
}
function twitter_account() {
return site_meta('twitter', 'tetrass_-libre');
}
function twitter_url() {
return 'https://twitter.com/' . twitter_account();
}
function total_articles() {
return Post::where(Base::table('posts.status'), '=', 'published')->count();
}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title><?php echo page_title('Page non trouv&eacute;'); ?> - <?php echo site_name(); ?></title>
<meta name="description" content="<?php echo site_description(); ?>">
<link rel="stylesheet" href="<?php echo theme_url('/css/reset.css'); ?>">
<link rel="stylesheet" href="<?php echo theme_url('/css/style.css'); ?>">
<link rel="stylesheet" href="<?php echo theme_url('/css/small.css'); ?>" media="(max-width: 400px)">
<link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo rss_url(); ?>">
<link rel="shortcut icon" href="<?php echo theme_url('img/favicon.png'); ?>">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script>var base = '<?php echo theme_url(); ?>';</script>
<script src="<?php echo asset_url('/js/zepto.js'); ?>"></script>
<script src="<?php echo theme_url('/js/main.js'); ?>"></script>
<meta name="viewport" content="width=device-width">
<meta name="generator" content="Anchor CMS">
<meta property="og:title" content="<?php echo site_name(); ?>">
<meta property="og:type" content="website">
<meta property="og:url" content="<?php echo e(current_url()); ?>">
<meta property="og:image" content="<?php echo theme_url('img/og_image.gif'); ?>">
<meta property="og:site_name" content="<?php echo site_name(); ?>">
<meta property="og:description" content="<?php echo site_description(); ?>">
<?php if(customised()): ?>
<!-- Custom CSS -->
<style><?php echo article_css(); ?></style>
<!-- Custom Javascript -->
<script><?php echo article_js(); ?></script>
<?php endif; ?>
</head>
<body class="<?php echo body_class(); ?>">
<div class="main-wrap">
<div class="slidey" id="tray">
<div class="wrap">
<form id="search" action="<?php echo search_url(); ?>" method="post">
<label for="term">Rechercher sur ce site:</label>
<input type="search" id="term" name="term" placeholder="Rechercher&hellip;" value="<?php echo search_term(); ?>">
<input type="hidden" id="whatSearch" name="whatSearch" value="all" />
</form>
<aside>
<b>Categories</b>
<ul>
<?php while(categories()):
if (category_count() > 0) { ?>
<li>
<a href="<?php echo category_url(); ?>" title="<?php echo category_description(); ?>">
<?php echo category_title(); ?> <span><?php echo category_count(); ?></span>
</a>
</li>
<?php } endwhile; ?>
</ul>
</aside>
</div>
</div>
<header id="top">
<a id="logo" href="<?php echo base_url(); ?>"><?php echo site_name(); ?></a>
<nav id="main" role="navigation">
<ul>
<?php if(has_menu_items()):
while(menu_items()): ?>
<li <?php echo (menu_active() ? 'class="active"' : ''); ?>>
<a href="<?php echo menu_url(); ?>" title="<?php echo menu_title(); ?>">
<?php echo menu_name(); ?>
</a>
</li>
<?php endwhile;
endif; ?>
<li class="tray">
<a href="#tray" class="linky"><img src="<?php echo theme_url('img/categories.png'); ?>" alt="Categories" title="Articles par cat&eacute;gories"></a>
</li>
</ul>
</nav>
</header>
img/categories.png

140 B

img/favicon.png

263 B

img/og_image.gif

600 B

img/search.png

523 B

var Anchor = {
init: function() {
Anchor.slidey = $('.slidey');
Anchor.keys = [];
// Uh, bind to the resizing of the window?
$(window).resize(Anchor.bindResize).trigger('resize');
// Re-/Set keys
$(window).on('keyup', Anchor.keyup);
$(window).on('keydown', Anchor.keydown);
// Set up the toggle link
Anchor.linky = $('.linky').on('click', Anchor.toggleSlidey);
// Hide the thingymabob
setTimeout(function() {
// Set up the slidey panel
Anchor.hideSlidey();
$('body').addClass('js-enabled');
}, 10);
// Listen for search link
$('a[href="#search"]').click(function() {
if(!Anchor.linky.hasClass('active')) {
return Anchor.toggleSlidey.call(Anchor.linky);
}
});
},
keyup: function(event) {
Anchor.keys[event.keyCode] = false;
},
keydown: function(event) {
Anchor.keys[event.keyCode] = true;
// ctrl + shift + f => show Slidey and/or focus search bar
if(Anchor.keys[17] && Anchor.keys[16] && Anchor.keys[70]) {
event.preventDefault();
Anchor.showSlidey.call(Anchor.linky);
$('input[type="search"]').focus();
}
// esc => hide Slidey
if(Anchor.keys[27]) {
event.preventDefault();
Anchor.hideSlidey();
$('input[type="search"]').blur();
}
},
hideSlidey: function() {
Anchor.slidey.css('margin-top', this._slideyHeight);
Anchor.linky && Anchor.linky.removeClass('active');
return this;
},
showSlidey: function() {
Anchor.slidey.css('margin-top', 0);
Anchor.linky && Anchor.linky.addClass('active');
return this;
},
toggleSlidey: function() {
var self = Anchor;
var me = $(this);
me.toggleClass('active');
self.slidey.css('margin-top', me.hasClass('active') ? 0 : self._slideyHeight);
return false;
},
bindResize: function() {
Anchor._slideyHeight = -(Anchor.slidey.height() + 1);
Anchor.hideSlidey();
}
};
// And bind loading
$(Anchor.init);
<?php theme_include('header'); ?>
<section class="content wrap">
<h1><?php echo page_title(); ?></h1>
<?php echo page_content(); ?>
</section>
<?php theme_include('footer'); ?>
<?php theme_include('header'); ?>
<section class="content">
<?php if(has_posts()): ?>
<ul class="items">
<?php posts(); ?>
<li>
<article class="wrap">
<h1>
<a href="<?php echo article_url(); ?>" title="<?php echo article_title(); ?>"><?php echo article_title(); ?></a>
</h1>
<div class="content">
<?php echo article_html(); ?>
</div>
<footer>
Posted <time datetime="<?php echo date(DATE_W3C, article_time()); ?>"><?php echo relative_time(article_time()); ?></time> by <?php echo article_author('real_name'); ?>.
</footer>
</article>
</li>
<?php $i = 0; while(posts()): ?>
<?php $bg = sprintf('background: hsl(215, 28%%, %d%%);', round(((++$i / posts_per_page()) * 20) + 20)); ?>
<li style="<?php echo $bg; ?>">
<article class="wrap">
<h2>
<a href="<?php echo article_url(); ?>" title="<?php echo article_title(); ?>"><?php echo article_title(); ?></a>
</h2>
</article>
</li>
<?php endwhile; ?>
</ul>
<?php if(has_pagination()): ?>
<nav class="pagination">
<div class="wrap">
<div class="previous">
<?php echo posts_prev(); ?>
</div>
<div class="next">
<?php echo posts_next(); ?>
</div>
</div>
</nav>
<?php endif; ?>
<?php else: ?>
<div class="wrap">
<h1>Pas d'articles pour le moment</h1>
<p>Blog en préparation</p>
</div>
<?php endif; ?>
</section>
<?php theme_include('footer'); ?>
<?php theme_include('header'); ?>
<h1 class="wrap">Vous avez cherch&eacute;: &ldquo;<?php echo search_term(); ?>&rdquo;.</h1>
<?php if(has_search_results()): ?>
<ul class="items">
<?php $i = 0; while(search_results()): $i++; ?>
<li style="background: hsl(215,28%,<?php echo round((($i / posts_per_page()) * 20) + 20); ?>%);">
<article class="wrap">
<h2>
<a href="<?php echo search_item_url(); ?>" title="<?php echo search_item_title(); ?>"><?php echo search_item_title(); ?></a>
</h2>
</article>
</li>
<?php endwhile; ?>
</ul>
<?php if(has_search_pagination()): ?>
<nav class="pagination">
<div class="wrap">
<?php echo search_prev(); ?>
<?php echo search_next(); ?>
</div>
</nav>
<?php endif; ?>
<?php else: ?>
<p class="wrap">Aucun r&eacute;sultats trouv&eacute;s pour: &ldquo;<?php echo search_term(); ?>&rdquo;, d&eacute;sol&eacute;...</p>
<?php endif; ?>
<?php theme_include('footer'); ?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment