This commit is contained in:
2018-02-09 15:55:19 +00:00
commit fb5d64742c
30 changed files with 9921 additions and 0 deletions

3
theme/404.php Normal file
View File

@@ -0,0 +1,3 @@
<main>
<h1>404</h1>
</main>

22
theme/functions.php Normal file
View File

@@ -0,0 +1,22 @@
<?php
function windycoys_the_tags() {
$tags = get_the_tags();
if ($tags) {
foreach($tags as $key=>$tag) {
echo '<a class="Metadata-categoriesLink" href="' .
home_url() . '/tags/' . $tag->name . '" rel="tag">' .
$tag->name . '</a>';
if ($key < count($tags) - 1) {
echo ', ';
}
}
}
}
function windycoys_share_twitter_url() {
$url = 'https://twitter.com/intent/tweet?text=';
$title = get_the_title();
$link = get_the_permalink();
echo $url . urlencode($title . ': ' . $link . ' by @WindyCOYS');
}

14
theme/header.php Normal file
View File

@@ -0,0 +1,14 @@
<!doctype html>
<html <?php language_attributes(); ?> class="no-js">
<head>
<meta charset="<?php bloginfo('charset'); ?>">
<title><?php wp_title(''); ?><?php if(wp_title('', false)) { echo ' :'; } ?> <?php bloginfo('name'); ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, user-scalable=no">
<meta name="theme-color" content="#4b88b6">
<meta name="description" content="<?php bloginfo('description'); ?>">
<?php wp_head(); ?>
<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/style.css">
<link href="https://fonts.googleapis.com/css?family=Open+Sans|Raleway:700" rel="stylesheet">
</head>
<body>
<?php get_template_part('icons') ?>

53
theme/icons.php Normal file
View File

@@ -0,0 +1,53 @@
<svg style="position: absolute;width: 0;height: 0;overflow: hidden;">
<symbol id="icon-calendar" viewBox="0 0 448 512">
<path fill="currentColor" d="M148 288h-40c-6.6
0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12
12zm108-12v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12
12h40c6.6 0 12-5.4 12-12zm96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12
12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96
96v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0
12-5.4 12-12zm-96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4
12 12 12h40c6.6 0 12-5.4 12-12zm192 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12
5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96-260v352c0 26.5-21.5
48-48 48H48c-26.5 0-48-21.5-48-48V112c0-26.5 21.5-48 48-48h48V12c0-6.6 5.4-12
12-12h40c6.6 0 12 5.4 12 12v52h128V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12
12v52h48c26.5 0 48 21.5 48 48zm-48 346V160H48v298c0 3.3 2.7 6 6 6h340c3.3 0
6-2.7 6-6z"></path>
</symbol>
<symbol id="icon-facebook" viewBox="0 0 512 512">
<path fill="currentColor" d="M448 56.7v398.5c0
13.7-11.1 24.7-24.7 24.7H309.1V306.5h58.2l8.7-67.6h-67v-43.2c0-19.6 5.4-32.9
33.5-32.9h35.8v-60.5c-6.2-.8-27.4-2.7-52.2-2.7-51.6 0-87 31.5-87
89.4v49.9h-58.4v67.6h58.4V480H24.7C11.1 480 0 468.9 0 455.3V56.7C0 43.1 11.1 32
24.7 32h398.5c13.7 0 24.8 11.1 24.8 24.7z"></path>
</symbol>
<symbol id="icon-hash" viewBox="0 0 448 512">
<path fill="currentColor" d="M440.667
182.109l7.143-40c1.313-7.355-4.342-14.109-11.813-14.109h-74.81l14.623-81.891C377.123
38.754 371.468 32 363.997 32h-40.632a12 12 0 0 0-11.813 9.891L296.175
128H197.54l14.623-81.891C213.477 38.754 207.822 32 200.35 32h-40.632a12 12 0 0
0-11.813 9.891L132.528 128H53.432a12 12 0 0 0-11.813 9.891l-7.143 40C33.163
185.246 38.818 192 46.289 192h74.81L98.242 320H19.146a12 12 0 0 0-11.813
9.891l-7.143 40C-1.123 377.246 4.532 384 12.003 384h74.81L72.19 465.891C70.877
473.246 76.532 480 84.003 480h40.632a12 12 0 0 0 11.813-9.891L151.826
384h98.634l-14.623 81.891C234.523 473.246 240.178 480 247.65 480h40.632a12 12 0
0 0 11.813-9.891L315.472 384h79.096a12 12 0 0 0
11.813-9.891l7.143-40c1.313-7.355-4.342-14.109-11.813-14.109h-74.81l22.857-128h79.096a12
12 0 0 0 11.813-9.891zM261.889 320h-98.634l22.857-128h98.634l-22.857
128z"></path>
</symbol>
<symbol id="icon-twitter" viewBox="0 0 512 512">
<path fill="currentColor" d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0
138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106
8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568
130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624
19.818 1.624 9.421 0 18.843-1.3
27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797
30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492
5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365
109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934
104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32
66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273
41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"></path>
</symbol>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
theme/img/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

31
theme/index.php Normal file
View File

@@ -0,0 +1,31 @@
<?php get_header() ?>
<main class="Grid">
<?php get_template_part('partials/logo') ?>
<?php while ( have_posts() ) : the_post() ?>
<section class="Grid-article">
<article class="Article">
<div class="Article-date">
<svg class="Icon">
<use href="#icon-calendar"></use>
</svg>
<span class="Article-dateText">
<?php the_time(get_option('date_format')) ?>
</span>
</div>
<h1 class="Article-title">
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
</h1>
<div class="Article-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">&raquo;</span>', 'windycoys' ) ); ?>
</div>
</article>
</section>
<section class="Grid-metadata">
<?php get_template_part('partials/metadata') ?>
</section>
<?php endwhile; ?>
<section class="Grid-footer">
<?php get_template_part('partials/footer') ?>
</section>

View File

@@ -0,0 +1,3 @@
<footer class="Footer">
<p>This is the footer</p>
</footer>

6
theme/partials/logo.php Normal file
View File

@@ -0,0 +1,6 @@
<section class="Logo">
<a class="Logo-link" href="<?php echo home_url(); ?>">
<img src="<?php echo get_template_directory_uri(); ?>/img/logo.png" alt="Logo" class="Logo-image">
</a>
</section>

View File

@@ -0,0 +1,36 @@
<section class="Metadata">
<div class="Metadata-date">
<svg class="Icon">
<use href="#icon-calendar"></use>
</svg>
<span class="Metadata-dateText">
<?php the_time(get_option('date_format')) ?>
</span>
</div>
<div class="Metadata-comments">
<a class="Metadata-commentsLink" href="<?php the_permalink() ?>">
<?php comments_number(); ?>
</a>
</div>
<div class="Metadata-categories">
<svg class="Icon">
<use href="#icon-hash"></use>
</svg>
<span class="Metadata-categoriesText">
<?php windycoys_the_tags() ?>
</span>
</div>
<div class="Metadata-share">
<a class="Metadata-shareLink" href="#">
<svg class="Icon Icon--facebook">
<use href="#icon-facebook"></use>
</svg>
</a>
<a class="Metadata-shareLink" href="<?php windycoys_share_twitter_url() ?>">
<svg class="Icon Icon--twitter">
<use href="#icon-twitter"></use>
</svg>
</a>
</div>
</section>

14
theme/partials/nav.php Normal file
View File

@@ -0,0 +1,14 @@
<header class="Header">
<div class="Header-logo">
<a href="<?php echo home_url(); ?>">
<img src="<?php echo get_template_directory_uri(); ?>/img/logo.png" alt="Logo" class="logo-img">
</a>
</div>
<nav class="Nav">
<ul class="Nav-list">
<li class="Nav-item">
<a class="Nav-link" href="#">About</a>
</li>
</ul>
</nav>
</header>

14
theme/single.php Normal file
View File

@@ -0,0 +1,14 @@
<?php get_header(); ?>
<main>
<?php if (have_posts()): while (have_posts()) : the_post(); ?>
<article>
<h1><?php the_title(); ?></h1>
</article>
<?php endwhile; ?>
<?php else: ?>
<article>
<h1>Sorry, nothing to display</h1>
</article>
<?php endif; ?>
</main>