first commit

This commit is contained in:
cupcakearmy 2019-05-03 08:45:48 +02:00
parent f6ff67fa25
commit 72d99748fb
34 changed files with 588 additions and 0 deletions

8
.env Normal file
View File

@ -0,0 +1,8 @@
WORDPRESS_DB_HOST=db
WORDPRESS_DB_USER=root
WORDPRESS_DB_PASSWORD=example
WORDPRESS_DB_NAME=wordpress
WORDPRESS_TABLE_PREFIX=
MYSQL_ROOT_PASSWORD=example
MYSQL_DATABASE=wordpress

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
data/

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# liquet
A minimalistic and clean wordpress theme.

24
docker-compose.yml Executable file
View File

@ -0,0 +1,24 @@
version: '3'
services:
wp:
image: wordpress:5-apache
volumes:
- ./liquet:/var/www/html/wp-content/themes/liquet:ro
ports:
- 80:80
env_file: .env
db:
image: mariadb:10.3
restart: always
volumes:
- ./data/db:/var/lib/mysql
env_file: .env
# adminer:
# image: adminer
# restart: always
# ports:
# - 8080:8080

BIN
docs/Home.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

BIN
docs/Post.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

3
liquet/404.php Normal file
View File

@ -0,0 +1,3 @@
<?php
wp_redirect(get_home_url());
exit;

46
liquet/archive.php Normal file
View File

@ -0,0 +1,46 @@
<?php
get_header();
$obj = get_queried_object();
$type = get_class($obj);
switch ($type) {
case 'WP_Term':
$types = [
'post_tag' => 'tag',
'category' => 'category'
];
$alt_title = $obj->slug;
$alt_subtitle = $types[$obj->taxonomy];
break;
case 'WP_User':
$alt_title = $obj->display_name;
$alt_subtitle = 'author';
break;
default:
$alt_title = null;
break;
}
?>
<div id="home">
<div class="flex container vertical middle" id="list-header">
<a class="gohome" href="<?= get_bloginfo('wpurl'); ?>">
<span class="alt-font"><?= get_bloginfo('name'); ?></span>
</a>
<div id="header">
<h1><?= $alt_title ?></h1>
<h3><?= $alt_subtitle ?></h3>
</div>
</div>
<div class="flex container horizontal center" id="list-container">
<div id="list">
<?php
while (have_posts()) {
the_post();
get_template_part('post-preview', get_post_format());
}
?>
</div>
</div>
</div>
<?php get_footer(); ?>

10
liquet/content.php Normal file
View File

@ -0,0 +1,10 @@
<div class="blog-post">
<h2 class="blog-post-title"><?php the_title(); ?></h2>
<p class="blog-post-meta"><?php the_date(); ?> by <a href="#"><?php the_author(); ?></a></p>
<?php
// the_content();
the_excerpt();
?>
</div>

32
liquet/css/flex.css Normal file
View File

@ -0,0 +1,32 @@
.flex.container {
display: flex;
}
.flex.container.horizontal {
flex-direction: row;
}
.flex.container.vertical {
flex-direction: column;
}
.flex.container.middle {
align-items: center;
}
.flex.container.center {
justify-content: center;
}
.flex.item {
overflow: hidden;
/*display: inline-block;*/
}
.flex.item.grow {
flex: 1 0;
}
.flex.item.shrink {
flex: 0 1 auto;
}

70
liquet/css/home.css Normal file
View File

@ -0,0 +1,70 @@
#home #header {
text-align: center;
margin-top: 8vw;
margin-bottom: 8vw;
padding: 0 2em;
}
#home #header h1 {
font-size: 12vw;
font-family: "Abril Fatface", serif;
}
#home #header h2 {
font-size: 5.5vw;
}
@media only screen and (min-width: 40em) {
#home #header h1 {
font-size: 5em;
}
}
@media only screen and (min-width: 40em) {
#home #header h2 {
font-size: 2em;
}
}
#home #list-container {
/*background: var(--clr-primary);*/
}
#home #list-header {
/*background: var(--clr-primary);*/
/*box-shadow: 0 0 1em -0.5em hsla(0, 0%, 0%, 0.1);*/
}
#home #list {
text-align: left;
width: 100%;
padding: 0 2em;
margin-bottom: 8vw;
}
@media only screen and (min-width: 40em) {
#home #list {
width: var(--text-width);
}
}
#home #list > .item {
padding: .25em 1em;
margin: 1.5em 0;
transition: all ease .1s;
border-radius: .5em;
display: block;
}
#home #list > .item:hover {
box-shadow: 0 0.2em 0.5em -0.1em #00000014;
transform: scale(1.05);
}
#home #list > .item .title {
margin-bottom: .25em;
}
#home #list hr {
margin: 0 1.5em;
}

64
liquet/css/singular.css Normal file
View File

@ -0,0 +1,64 @@
#singular #main {
padding: 8vw 0;
overflow: auto;
}
#singular #header {
text-align: center;
padding: 0 2em;
margin-bottom: 5vmin;
}
#singular #header {
max-width: 60em;
width: calc(100% - 2em);
}
#singular #header h1 {
font-size: 4vmax;
}
#singular #content {
width: 100%;
padding: 0 2em;
}
#singular #content > * {
max-width: var(--text-width);
width: 100%;
}
#singular #content .alignfull {
max-width: initial;
width: calc(100% + 4em);
}
#singular #content .alignwide {
max-width: 60em !important;
width: 100%;
}
#singular .links > div {
transform: rotate(180deg) scale(1);
writing-mode: vertical-rl;
padding: .25em;
height: 100%;
text-align: center;
cursor: pointer;
background: var(--clr-white);
transition: var(--animation);
width: 2em;
line-height: 1em;
}
@media only screen and (min-width: 40em) {
#singular .links > div {
padding: 1em;
width: 3em;
}
}
#singular .links > div:hover {
transform: rotate(180deg) scale(1.5);
}

4
liquet/footer.php Normal file
View File

@ -0,0 +1,4 @@
</div>
<?php wp_footer(); ?>
</body>
</html>

15
liquet/functions.php Normal file
View File

@ -0,0 +1,15 @@
<?php
@ini_set( 'upload_max_size' , '128M' );
@ini_set( 'post_max_size', '128M');
@ini_set( 'max_execution_time', '300' );
add_theme_support( 'align-wide' );
add_action( 'wp_enqueue_scripts', function () {
wp_enqueue_style( 'flex', get_template_directory_uri() . '/css/flex.css' );
wp_enqueue_style( 'liquet', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'liquet-home', get_template_directory_uri() . '/css/home.css' );
wp_enqueue_style( 'liquet-singular', get_template_directory_uri() . '/css/singular.css' );
wp_enqueue_style( 'fonts', get_template_directory_uri() . '/vendor/fonts/import.css' );
} );

12
liquet/header.php Normal file
View File

@ -0,0 +1,12 @@
<?php $dir = get_bloginfo( 'template_directory' ) ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php add_theme_support( 'title-tag' ); ?>
<?php wp_head(); ?>
</head>
<body>
<div id="app">

42
liquet/index.php Normal file
View File

@ -0,0 +1,42 @@
<?php get_header();
$tags = get_tags(['orderby' => 'count', 'order' => 'desc']);
//$tags = array_map(function ($tag) {
// return [
// 'name' => $tag->name,
// 'slug' => $tag->slug,
// 'count' => $tag->count,
// ];
//}, $tags)
?>
<div id="home">
<div class="flex container vertical middle" id="list-header">
<div id="header">
<a href="<?= get_bloginfo('wpurl'); ?>">
<h1><?= get_bloginfo('name'); ?></h1>
<h3><?= get_bloginfo('description'); ?></h3>
</a>
</div>
</div>
<div class="flex container horizontal center" id="list-container">
<div id="list">
<?php if ($tags) { ?>
<!-- <div class="flex container horizontal center" id="list-container">-->
<div class="tags">
<?php foreach ($tags as $tag) { ?>
<a class="tag" href="<?= get_tag_link($tag->term_id); ?>"><?= $tag->name; ?> <b><?= $tag->count ?></b></a>
<?php } ?>
</div>
<!-- </div>-->
<?php } ?>
<br/><br/><br/>
<?php
while (have_posts()) {
the_post();
get_template_part('post-preview', get_post_format());
}
?>
</div>
</div>
</div>
<?php get_footer(); ?>

23
liquet/loop-utils.php Normal file
View File

@ -0,0 +1,23 @@
<?php
function getNextURL( $next ) {
$post = get_adjacent_post( true, '', ! $next, 'post_tag' );
if ( ! $post ) {
$post = get_adjacent_post( false, '', ! $next, 'post_tag' );
}
return ( $post ? get_permalink( $post->ID ) : get_bloginfo( 'wpurl' ) );
}
function getDates() {
$created_year = get_the_date( 'Y' );
$created = get_the_date( ( $created_year == date( 'Y' ) ? 'F j' : null ) );
$modified_year = get_the_modified_date( 'Y' );
$modified = get_the_modified_date( ( $modified_year == $created_year ? 'F j' : null ) );
return [
'created' => $created,
'modified' => $modified,
'different' => $created != $modified,
];
}

26
liquet/post-preview.php Normal file
View File

@ -0,0 +1,26 @@
<?php
include_once('loop-utils.php');
$dates = getDates();
?>
<a href="<?= get_permalink() ?>" class="item">
<div class="flex container vertical">
<h2 class="alt-font title"><?php the_title(); ?></h2>
<div class="flex container horizontal">
<div>
<?= $dates['created'] ?>
</div>
<div class="flex item grow"></div>
<div>
~<?= do_shortcode('[rt_reading_time]'); ?> min
</div>
</div>
<?php if(has_excerpt()){
the_excerpt();
} ?>
</div>
</a>
<hr/>

56
liquet/singular.php Normal file
View File

@ -0,0 +1,56 @@
<?php
get_header();
the_post();
include_once( 'loop-utils.php' );
$dates = getDates();
?>
<div class="flex container vertical fill" id="singular">
<div class="flex item shrink gohome">
<a href="<?= get_bloginfo( 'wpurl' ); ?>">
<span class="alt-font"><?= get_bloginfo( 'name' ); ?></span>
</a>
</div>
<div class="flex item grow">
<div class="flex container horizontal fill">
<a class="flex item shrink links" href="<?= getNextURL( false ) ?>">
<div class="alt-font">previous</div>
</a>
<div class="flex item grow" id="main">
<div class="flex container vertical middle">
<div class="box" id="header">
<h1 class="alt-font"><?= the_title() ?></h1>
</div>
</div>
<div class="flex container vertical middle" id="content">
<div class="flex container horizontal">
<div>
<b><?= $dates['created'] ?></b>
<?php if ( $dates['different'] ) { ?>
<br/>
<small>updated on <?= $dates['modified'] ?></small>
<?php } ?>
</div>
<div class="flex item grow"></div>
<div>
<b>~<?= do_shortcode( '[rt_reading_time]' ); ?> min</b>
</div>
</div>
<br><br>
<?php the_content(); ?>
<br>
<?php get_template_part( 'tags-list', get_post_format() ); ?>
</div>
</div>
<a class="flex item shrink links" href="<?= getNextURL( true ) ?>">
<div class="alt-font">next</div>
</a>
</div>
</div>
</div>
<?php get_footer(); ?>

99
liquet/style.css Normal file
View File

@ -0,0 +1,99 @@
/*
Theme Name: Liquet
Author: Niccolo Borgioli
Description: Minimalistic clean theme
Version: 0.1
License: MIT
Tags: minimal, simple, typography, clean
Author URI: https://nicco.io
License URI: https://opensource.org/licenses/MIT
Theme URI: https://github.com/cupcakearmy/liquet
*/
* {
box-sizing: border-box;
--clr-primary: hsl(194, 100%, 88%);
--clr-white: #ffffff;
--clr-black: #000000;
--clr-dark: #222222;
--clr-ligher: #eeeeee;
--text-width: 35rem;
--animation: all 100ms ease;
}
html, body {
padding: 0;
margin: 0;
font-family: Raleway, serif;
font-size: 1rem;
}
h1, h2, h3, h4, h5, h6 {
margin: 0;
}
pre {
overflow: auto;
background-color: var(--clr-ligher);
padding: 1em;
}
a {
text-decoration: none;
color: inherit;
}
hr {
border: 0;
border-top: 1px solid #f5f5f5;
}
.fill {
height: 100%;
width: 100%;
}
.fill-v {
height: 100%;
}
.fill-h {
width: 100%;
}
.alt-font {
font-family: "Abril Fatface", serif;
}
#app {
width: 100vw;
height: 100vh;
position: fixed;
overflow-x: auto;
}
.view {
max-width: var(--text-width);
}
.tags {
margin-top: -.25em;
}
.tags > a.tag {
padding: .25em;
background: #eee;
border-radius: .25em;
display: inline-block;
margin-top: .25em;
}
.gohome {
padding: .5em;
align-self: center;
transition: var(--animation);
}
.gohome:hover {
transform: scale(1.5);
}

9
liquet/tags-list.php Normal file
View File

@ -0,0 +1,9 @@
<?php
$tags = get_the_tags();
if ($tags) { ?>
<div class="tags">
<?php foreach ($tags as $tag) { ?>
<a class="tag" href="<?= get_tag_link($tag->term_id); ?>"><?= $tag->name; ?></a>
<?php } ?>
</div>
<?php }

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

34
liquet/vendor/fonts/import.css vendored Normal file
View File

@ -0,0 +1,34 @@
@font-face {
font-family: 'Raleway';
font-style: normal;
font-weight: normal;
src: url('./Raleway/Raleway-Regular.woff2') format('woff2')
}
@font-face {
font-family: 'Raleway';
font-style: italic;
font-weight: normal;
src: url('./Raleway/Raleway-Italic.woff2') format('woff2')
}
@font-face {
font-family: 'Raleway';
font-style: normal;
font-weight: bold;
src: url('./Raleway/Raleway-Bold.woff2') format('woff2')
}
@font-face {
font-family: 'Raleway';
font-style: italic;
font-weight: bold;
src: url('./Raleway/Raleway-BoldItalic.woff2') format('woff2')
}
@font-face {
font-family: 'Abril Fatface';
font-style: normal;
font-weight: normal;
src: url('./Abril/AbrilFatface-Regular.woff2') format('woff2')
}

1
liquet/vendor/icons/calendar.svg vendored Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M424 96h-40v24c0 4.4-3.6 8-8 8h-16c-4.4 0-8-3.6-8-8V96H160v24c0 4.4-3.6 8-8 8h-16c-4.4 0-8-3.6-8-8V96H88c-22 0-40 18-40 40v272c0 22 18 40 40 40h336c22 0 40-18 40-40V136c0-22-18-40-40-40zm8 300c0 11-9 20-20 20H100c-11 0-20-9-20-20V216c0-4.4 3.6-8 8-8h336c4.4 0 8 3.6 8 8v180zM160 72c0-4.4-3.6-8-8-8h-16c-4.4 0-8 3.6-8 8v24h32V72zM384 72c0-4.4-3.6-8-8-8h-16c-4.4 0-8 3.6-8 8v24h32V72z"/></svg>

After

Width:  |  Height:  |  Size: 462 B

1
liquet/vendor/icons/contrast.svg vendored Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 48C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48zm127.3 335.3c-34 34-79.2 52.7-127.3 52.7V76c48.1 0 93.3 18.7 127.3 52.7S436 207.9 436 256s-18.7 93.3-52.7 127.3z"/></svg>

After

Width:  |  Height:  |  Size: 275 B

1
liquet/vendor/icons/github.svg vendored Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 32C132.3 32 32 134.9 32 261.7c0 101.5 64.2 187.5 153.2 217.9 1.4.3 2.6.4 3.8.4 8.3 0 11.5-6.1 11.5-11.4 0-5.5-.2-19.9-.3-39.1-8.4 1.9-15.9 2.7-22.6 2.7-43.1 0-52.9-33.5-52.9-33.5-10.2-26.5-24.9-33.6-24.9-33.6-19.5-13.7-.1-14.1 1.4-14.1h.1c22.5 2 34.3 23.8 34.3 23.8 11.2 19.6 26.2 25.1 39.6 25.1 10.5 0 20-3.4 25.6-6 2-14.8 7.8-24.9 14.2-30.7-49.7-5.8-102-25.5-102-113.5 0-25.1 8.7-45.6 23-61.6-2.3-5.8-10-29.2 2.2-60.8 0 0 1.6-.5 5-.5 8.1 0 26.4 3.1 56.6 24.1 17.9-5.1 37-7.6 56.1-7.7 19 .1 38.2 2.6 56.1 7.7 30.2-21 48.5-24.1 56.6-24.1 3.4 0 5 .5 5 .5 12.2 31.6 4.5 55 2.2 60.8 14.3 16.1 23 36.6 23 61.6 0 88.2-52.4 107.6-102.3 113.3 8 7.1 15.2 21.1 15.2 42.5 0 30.7-.3 55.5-.3 63 0 5.4 3.1 11.5 11.4 11.5 1.2 0 2.6-.1 4-.4C415.9 449.2 480 363.1 480 261.7 480 134.9 379.7 32 256 32z"/></svg>

After

Width:  |  Height:  |  Size: 869 B

1
liquet/vendor/icons/hom.svg vendored Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M258.5 104.1c-1.5-1.2-3.5-1.2-5 0l-156 124.8c-.9.8-1.5 1.9-1.5 3.1v230c0 1.1.9 2 2 2h108c1.1 0 2-.9 2-2V322c0-1.1.9-2 2-2h92c1.1 0 2 .9 2 2v140c0 1.1.9 2 2 2h108c1.1 0 2-.9 2-2V232c0-1.2-.6-2.4-1.5-3.1l-156-124.8z"/><path d="M458.7 204.2l-189-151.4C265.9 49.7 261 48 256 48s-9.9 1.7-13.7 4.8L160 119.7V77.5c0-1.1-.9-2-2-2H98c-1.1 0-2 .9-2 2v92.2l-42.7 35.1c-3.1 2.5-5.1 6.2-5.3 10.2-.2 4 1.3 7.9 4.1 10.7 2.6 2.6 6.1 4.1 9.9 4.1 3.2 0 6.3-1.1 8.8-3.1l183.9-148c.5-.4.9-.4 1.3-.4s.8.1 1.3.4l183.9 147.4c2.5 2 5.6 3.1 8.8 3.1 3.7 0 7.2-1.4 9.9-4.1 2.9-2.8 4.4-6.7 4.2-10.7-.3-4-2.2-7.7-5.4-10.2z"/></svg>

After

Width:  |  Height:  |  Size: 673 B

1
liquet/vendor/icons/timer.svg vendored Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 456c-110.3 0-200-89.7-200-200 0-54.8 21.7-105.9 61.2-144 6.4-6.2 16.6-6 22.7.4 6.2 6.4 6 16.6-.4 22.7-33.1 32-51.3 74.9-51.3 120.9 0 92.5 75.3 167.8 167.8 167.8S423.8 348.5 423.8 256c0-87.1-66.7-159-151.8-167.1v62.6c0 8.9-7.2 16.1-16.1 16.1s-16.1-7.2-16.1-16.1V72.1c0-8.9 7.2-16.1 16.1-16.1 110.3 0 200 89.7 200 200S366.3 456 256 456z"/><path d="M175.9 161.9l99.5 71.5c13.5 9.7 16.7 28.5 7 42s-28.5 16.7-42 7c-2.8-2-5.2-4.4-7-7l-71.5-99.5c-3.2-4.5-2.2-10.8 2.3-14 3.6-2.6 8.3-2.4 11.7 0z"/></svg>

After

Width:  |  Height:  |  Size: 572 B

1
liquet/vendor/icons/twitter.svg vendored Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M492 109.5c-17.4 7.7-36 12.9-55.6 15.3 20-12 35.4-31 42.6-53.6-18.7 11.1-39.4 19.2-61.5 23.5C399.8 75.8 374.6 64 346.8 64c-53.5 0-96.8 43.4-96.8 96.9 0 7.6.8 15 2.5 22.1-80.5-4-151.9-42.6-199.6-101.3-8.3 14.3-13.1 31-13.1 48.7 0 33.6 17.2 63.3 43.2 80.7-16-.4-31-4.8-44-12.1v1.2c0 47 33.4 86.1 77.7 95-8.1 2.2-16.7 3.4-25.5 3.4-6.2 0-12.3-.6-18.2-1.8 12.3 38.5 48.1 66.5 90.5 67.3-33.1 26-74.9 41.5-120.3 41.5-7.8 0-15.5-.5-23.1-1.4C62.8 432 113.7 448 168.3 448 346.6 448 444 300.3 444 172.2c0-4.2-.1-8.4-.3-12.5C462.6 146 479 129 492 109.5z"/></svg>

After

Width:  |  Height:  |  Size: 621 B

1
liquet/vendor/icons/youtube.svg vendored Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M508.6 148.8c0-45-33.1-81.2-74-81.2C379.2 65 322.7 64 265 64h-18c-57.6 0-114.2 1-169.6 3.6C36.6 67.6 3.5 104 3.5 149 1 184.6-.1 220.2 0 255.8c-.1 35.6 1 71.2 3.4 106.9 0 45 33.1 81.5 73.9 81.5 58.2 2.7 117.9 3.9 178.6 3.8 60.8.2 120.3-1 178.6-3.8 40.9 0 74-36.5 74-81.5 2.4-35.7 3.5-71.3 3.4-107 .2-35.6-.9-71.2-3.3-106.9zM207 353.9V157.4l145 98.2-145 98.3z"/></svg>

After

Width:  |  Height:  |  Size: 437 B