- ',
+ 'after' => '
diff --git a/ansible/roles/wordpress/tasks/main.yml b/ansible/roles/wordpress/tasks/main.yml index 64e958b..4376fdc 100644 --- a/ansible/roles/wordpress/tasks/main.yml +++ b/ansible/roles/wordpress/tasks/main.yml @@ -8,4 +8,12 @@ vars: dir: /var/www/nuitdebout theme: nuitdebout - theme_dir: /vagrant/theme \ No newline at end of file + 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 diff --git a/ansible/roles/wordpress/tasks/unit.yml b/ansible/roles/wordpress/tasks/unit.yml new file mode 100644 index 0000000..c0917c4 --- /dev/null +++ b/ansible/roles/wordpress/tasks/unit.yml @@ -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 diff --git a/theme/assets/styles/common/_global.scss b/theme/assets/styles/common/_global.scss index 32a14e2..0771d3b 100644 --- a/theme/assets/styles/common/_global.scss +++ b/theme/assets/styles/common/_global.scss @@ -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, diff --git a/theme/assets/styles/common/_overload.scss b/theme/assets/styles/common/_overload.scss index 93012e0..8b13789 100644 --- a/theme/assets/styles/common/_overload.scss +++ b/theme/assets/styles/common/_overload.scss @@ -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; -} diff --git a/theme/assets/styles/common/_user_content.scss b/theme/assets/styles/common/_user_content.scss new file mode 100644 index 0000000..edde0cf --- /dev/null +++ b/theme/assets/styles/common/_user_content.scss @@ -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; + + } + } +} diff --git a/theme/assets/styles/layouts/_footer.scss b/theme/assets/styles/layouts/_footer.scss index 1505b70..565f461 100644 --- a/theme/assets/styles/layouts/_footer.scss +++ b/theme/assets/styles/layouts/_footer.scss @@ -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(); @@ -80,5 +81,5 @@ $footer-font-color: #e4f7f7 !default; } } - + } diff --git a/theme/assets/styles/layouts/_posts.scss b/theme/assets/styles/layouts/_posts.scss index a1519e4..8c6d2c8 100644 --- a/theme/assets/styles/layouts/_posts.scss +++ b/theme/assets/styles/layouts/_posts.scss @@ -138,7 +138,8 @@ body.single-post{ } -article.post.format-standard { +article.page.type-page, +article.post { margin-bottom: 40px; header { display: table; @@ -174,3 +175,7 @@ article.post.format-standard { padding: 30px 0 15px; } } + +.post-pagination { + text-align: center; +} diff --git a/theme/assets/styles/main.scss b/theme/assets/styles/main.scss index 6da7c4e..c4124d4 100644 --- a/theme/assets/styles/main.scss +++ b/theme/assets/styles/main.scss @@ -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"; diff --git a/theme/base.php b/theme/base.php index cfea366..94de240 100644 --- a/theme/base.php +++ b/theme/base.php @@ -32,13 +32,16 @@ >
> + + - - + + +' . __('Pages:'), + 'after' => '
', + 'before_link' => '', + 'after_link' => '', + 'current_before' => '', + 'current_after' => '', + 'link_before' => '', + 'link_after' => '', + 'pagelink' => '%', + 'echo' => 1 + ); + $r = wp_parse_args( $args, $defaults ); + $r = apply_filters( 'wp_link_pages_args', $r ); + extract( $r, EXTR_SKIP ); + global $page, $numpages, $multipage, $more, $pagenow; + if ( ! $multipage ) { + return; + } + $output = $before; + for ( $i = 1; $i < ( $numpages + 1 ); $i++ ) { + $j = str_replace( '%', $i, $pagelink ); + $output .= ' '; + if ( $i != $page || ( ! $more && 1 == $page ) ) { + $output .= "{$before_link}" . _wp_link_page( $i ) . "{$link_before}{$j}{$link_after}{$after_link}"; + } else { + $output .= "{$current_before}{$link_before}{$j}{$link_after}{$current_after}"; + } + } + print $output . $after; +} +add_action( 'bootstrap_link_pages', 'bootstrap_link_pages', 10, 1 ); \ No newline at end of file diff --git a/theme/lib/setup.php b/theme/lib/setup.php index dd8e023..8252a85 100644 --- a/theme/lib/setup.php +++ b/theme/lib/setup.php @@ -57,55 +57,47 @@ function setup() { * Register sidebars */ function widgets_init() { - register_sidebar([ - 'name' => 'Bannière homepage', // TODO translate - 'id' => 'homepage-banner', - 'before_widget' => '
'ol', 'short_ping' => true]); ?>