Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion ansible/roles/wordpress/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,12 @@
vars:
dir: /var/www/nuitdebout
theme: nuitdebout
theme_dir: /vagrant/theme
theme_dir: /vagrant/theme

- include: unit.yml
vars:
dir: /var/www/nuitdebout
site_name: unit
site: nuitdebout.dev/unit
site_title: A very log name for the unit test site to test if all is ok
theme: nuitdebout
26 changes: 26 additions & 0 deletions ansible/roles/wordpress/tasks/unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
- name: Test Unit site is installed
shell: wp site list --path={{dir}} | grep {{site_name}}
register: unit
changed_when: false
ignore_errors: True

- name: Create unit site
when: unit|failed
shell: wp site create --path={{dir}} --slug={{site_name}} --title="{{site_title}}"

- name: Empty the site
when: unit|failed
shell: wp site empty --path={{dir}} --yes --url={{site}}

- name: Active the theme
when: unit|failed
shell: wp theme activate {{theme}} --path={{dir}} --url={{site}}

- name: Download testing datas
when: unit|failed
get_url: url=https://wpcom-themes.svn.automattic.com/demo/theme-unit-test-data.xml dest=~/testing-data.xml

- name: Import testing datas
when: unit|failed
shell: wp import --path={{dir}} --url={{site}} --authors=create ~/testing-data.xml
12 changes: 11 additions & 1 deletion theme/assets/styles/common/_global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,19 @@ a:active {
text-decoration: none;
}

.content {
// to always move the footer at the bottom of the page
body {
display: flex;
flex-direction: column;
min-height: 100vh;
}

.wrap {
flex: 1;
max-width: 100vw;
}


body.sidebar-primary,
body.page:not(.home) {
.main,
Expand Down
21 changes: 0 additions & 21 deletions theme/assets/styles/common/_overload.scss
Original file line number Diff line number Diff line change
@@ -1,22 +1 @@
.navbar {
margin-bottom: 0;
border: none;
}

.navbar-fixed-top {
/* wait for new navbar with smaller height */
/* top: 32px !important; */
position: relative;
}

.opaque-navbar {
background-color: rgba(255,255,255,0.9);
/* Transparent = rgba(0,0,0,0) / Translucent = (0,0,0,0.5) */
height: 60px;
border-bottom: 0px;
transition: background-color .5s ease 0s;
}

h1, h2, h3, h4, h5, h6 {
color: $heading-color;
}
66 changes: 66 additions & 0 deletions theme/assets/styles/common/_user_content.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/**
* This file contains the style of all content enter by the user in the admin interface
* This is the html where we have no control on the class applied
*
* Indeally, this is the only place where you can set style directly on tag name
*/

.user-content {

table {
@extend .table;
}

h1 {
@include title-font;
}

figure,
img {
max-width: 100%;
}


.gallery {
display: flex;
flex-wrap: wrap;
align-items: stretch;
justify-content: space-between;

margin-bottom: 10px;

.gallery-item {
position: relative;
border: 1px solid white;
overflow: hidden;

img {
width: 100%;
height: auto;
}

&:hover .gallery-caption {
transform: translateY(0);
}
}

.gallery-caption {
position: absolute;
bottom: 0;

white-space: nowrap;
background: rgba(255, 255, 255, .8);
width: 100%;

transition: transform .3s;
transform: translateY(100px);
}
}

@for $i from 1 through 10 {
.gallery-columns-#{$i} .gallery-item {
flex: 1 0 100%/$i;

}
}
}
3 changes: 2 additions & 1 deletion theme/assets/styles/layouts/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ $footer-font-color: #e4f7f7 !default;
.footer {
background-color: $footer-bg;
color: $footer-font-color;
clear: both;

.footer__main {
@include make-row();
Expand Down Expand Up @@ -80,5 +81,5 @@ $footer-font-color: #e4f7f7 !default;

}
}

}
7 changes: 6 additions & 1 deletion theme/assets/styles/layouts/_posts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ body.single-post{

}

article.post.format-standard {
article.page.type-page,
article.post {
margin-bottom: 40px;
header {
display: table;
Expand Down Expand Up @@ -174,3 +175,7 @@ article.post.format-standard {
padding: 30px 0 15px;
}
}

.post-pagination {
text-align: center;
}
1 change: 1 addition & 0 deletions theme/assets/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
@import "common/global";
@import "common/fonts";
@import "common/overload";
@import "common/user_content";
@import "components/agenda";
@import "components/buttons";
@import "components/comments";
Expand Down
39 changes: 22 additions & 17 deletions theme/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,16 @@
<html <?php language_attributes(); ?>>
<?php get_template_part('templates/head'); ?>
<body <?php body_class(); ?>>

<?php
do_action('get_header');
get_template_part('templates/header');
?>

<?php if (!is_main_site() && is_front_page()) : ?>
<?php dynamic_sidebar('homepage-banner') ?>
<?php endif; ?>
<?php dynamic_sidebar('homepage-banner') ?>
<?php endif; ?>

<div class="wrap <?php echo $main_container_class ?>" role="document">
<div class="content row">
<main class="main">
Expand All @@ -51,11 +54,13 @@
<?php endif; ?>
</div><!-- /.content -->
</div><!-- /.wrap -->

<?php
do_action('get_footer');
get_template_part('templates/footer');
wp_footer();
?>

<div id="fb-root"></div>
<script>
(function(d, s, id) {
Expand All @@ -74,21 +79,21 @@
</script>
<script src="https://www.google-analytics.com/analytics.js" async defer></script>

<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//piwik.nuitdebout.fr/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', 4]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript><p><img src="//piwik.nuitdebout.fr/piwik.php?idsite=4" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//piwik.nuitdebout.fr/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', 4]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript><p><img src="//piwik.nuitdebout.fr/piwik.php?idsite=4" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->

</body>
</html>
35 changes: 35 additions & 0 deletions theme/components/Navbar/navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,28 @@
);
}

function hasUrl(element) {
var link = element.is('a') ? element : element.find('a');
if (! link.length) {
link = element.closest('a');
}

if (! link.length) {
return false;
}

return link.attr('href').length > 2;
}

$navbar.find('.menu-item-has-children').click(function(event) {
if(isIn(event.target, '.navbar-subnav')) {
return;
}

if (hasUrl($(this))) {
return;
}

event.preventDefault();

var isOpen = $(this).is('.open');
Expand All @@ -33,6 +50,24 @@
event.stopPropagation();
});

$navbar.find('.menu-item-has-children').hover(function(event) {
if(isIn(event.target, '.navbar-subnav')) {
return;
}

if (! hasUrl($(this))) {
return;
}

var isOpen = $(this).is('.open');

$('.menu-item.open').removeClass('open');
if (! isOpen) {
$(this).addClass('open');
}
});


$(document).click(function(event) {
if(isIn(event.target, '.navbar-subnav')) {
return;
Expand Down
5 changes: 4 additions & 1 deletion theme/components/Navbar/navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@
.navbar-nuitdebout-bloginfo {
position: relative;
display: inline-block;
white-space: nowrap;

font-family: 'CommuneB1San31';
text-transform: uppercase;
Expand All @@ -210,6 +209,10 @@
&:before {
content: '//';
}

@media (min-width: $screen-sm-min) {
white-space: nowrap;
}
}

.navbar-subnav-list {
Expand Down
10 changes: 10 additions & 0 deletions theme/components/register_component.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
function instanciate_components() {
global $componentClasses;
global $components;

// on wp-cli
if ($componentClasses === null) {
return;
}

foreach ($componentClasses as $componentClass) {
$reflected = new \ReflectionClass($componentClass);
$component = $reflected->newInstance();
Expand All @@ -21,6 +27,10 @@ function instanciate_components() {

function register_modules_as_widget () {
global $components;
// on wp-cli
if ($components === null) {
return;
}
foreach ($components as $component) {
$component->register_as_widget();
}
Expand Down
Loading