Compare commits

..

10 commits

11 changed files with 114 additions and 80 deletions

View file

@ -1,31 +1,36 @@
DOCKER_HOST=playground.pi
SITE_URL=beta.saai.digital
PROJECT_NAME=web-wordpress-kit
CONTAINER_NAME_WORDPRESS=${PROJECT_NAME}_wordpress
CONTAINER_NAME_DB=${PROJECT_NAME}_db
docker_deploy:
docker run --rm -it \
-v /tmp/backup:/backup -v /var/lib/docker:/docker \
-v $(shell pwd)/kit:/docker/volumes/web-wordpress-kit_wordpress/_data/wp-content/themes/kit \
alpine:edge tar cpfz /backup/volumes.tgz /docker/volumes/
rsync --progress /tmp/backup/volumes.tgz playground.pi:/tmp/
-v $(shell pwd)/kit:/docker/volumes/${CONTAINER_NAME_WORDPRESS}/_data/wp-content/themes/kit \
alpine:edge tar cpfz /backup/volumes.tgz /docker/volumes/${CONTAINER_NAME_WORDPRESS} /docker/volumes/${CONTAINER_NAME_DB}
rsync --progress /tmp/backup/volumes.tgz ${DOCKER_HOST}:/tmp/
-DOCKER_HOST="ssh://playground.pi" docker stop web-wordpress-kit_db_1 web-wordpress-kit_wordpress_1
-DOCKER_HOST="ssh://playground.pi" docker rm web-wordpress-kit_db_1 web-wordpress-kit_wordpress_1
-DOCKER_HOST="ssh://playground.pi" docker volume rm web-wordpress-kit_db web-wordpress-kit_wordpress
-DOCKER_HOST="ssh://${DOCKER_HOST}" docker stop ${CONTAINER_NAME_WORDPRESS}_1 ${CONTAINER_NAME_DB}_1
-DOCKER_HOST="ssh://${DOCKER_HOST}" docker rm ${CONTAINER_NAME_WORDPRESS}_1 ${CONTAINER_NAME_DB}_1
-DOCKER_HOST="ssh://${DOCKER_HOST}" docker volume rm ${CONTAINER_NAME_WORDPRESS} ${CONTAINER_NAME_DB}
DOCKER_HOST="ssh://playground.pi" docker run --rm -it \
DOCKER_HOST="ssh://${DOCKER_HOST}" docker run --rm -it \
-v /var/lib/docker:/docker \
-v /tmp:/volume-backup \
alpine:edge tar --strip-components=2 -xpvf /volume-backup/volumes.tgz -C /docker/volumes/
DOCKER_HOST="ssh://playground.pi" docker run --rm -it \
DOCKER_HOST="ssh://${DOCKER_HOST}" docker run --rm -it \
-v /var/lib/docker:/docker \
-v /tmp:/volume-backup \
alpine:edge sed -i 81idefine\\\(\\\'WP_SITEURL\\\',\\\'https://beta.saai.digital\\\'\\\)\\\;\\ndefine\\\(\\\'WP_HOME\\\',\\\'https://beta.saai.digital\\\'\\\)\\\; /docker/volumes/web-wordpress-kit_wordpress/_data/wp-config.php
alpine:edge sed -i 81idefine\\\(\\\'WP_SITEURL\\\',\\\'https://${SITE_URL}\\\'\\\)\\\;\\ndefine\\\(\\\'WP_HOME\\\',\\\'https://${SITE_URL}\\\'\\\)\\\; /docker/volumes/${CONTAINER_NAME_WORDPRESS}/_data/wp-config.php
# # Need to fix MaxSessions in remote ssh daemon https://github.com/docker/compose/issues/6463
# # Disable nftables on remote host
cp wordpress.yml /tmp/wordpress.yml
sed -e '/kit/ s/^#*/#/' -i /tmp/wordpress.yml
DOCKER_HOST="ssh://playground.pi" docker-compose -p web-wordpress-kit -f /tmp/wordpress.yml create
DOCKER_HOST="ssh://playground.pi" docker-compose -p web-wordpress-kit -f /tmp/wordpress.yml start
DOCKER_HOST="ssh://${DOCKER_HOST}" docker-compose -p ${PROJECT_NAME} -f /tmp/wordpress.yml create
DOCKER_HOST="ssh://${DOCKER_HOST}" docker-compose -p ${PROJECT_NAME} -f /tmp/wordpress.yml start
docker_up:
docker-compose -f wordpress.yml up
@ -39,3 +44,7 @@ generate_pot:
# generate mo file \
msgfmt -o kit/languages/$${i18n}.mo kit/languages/$${i18n}.po ; \
done
install:
mkdir -p $(DESTDIR)
cp -r kit $(DESTDIR)/

View file

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Before After
Before After

View file

@ -181,6 +181,9 @@
font-size: 1.55556rem;
line-height: 1.77778rem;
}
.footer-bottom .content-wrap {
padding: 0;
}
}
@media (max-width: 1024px) {
@ -307,6 +310,8 @@
display: flex;
justify-content: space-between;
align-items: center;
overflow-wrap: break-word;
flex-wrap: wrap;
}
.footer-bottom .content-wrap ul {
@ -340,9 +345,3 @@
.footer-bottom .content-wrap .copyright {
margin-top: 0px;
}
.footer-bottom .content-wrap {
overflow-wrap: break-word;
flex-wrap: wrap;
padding: 0;
}

View file

@ -71,7 +71,6 @@ header:not(.sticky-header) .header-button-container {
.header-logo {
display: block;
width: 10rem;
height: 4.61111rem;
}
@ -81,7 +80,6 @@ header:not(.sticky-header) .header-button-container {
.header-logo-mobile {
display: none;
width: 6.11111rem;
height: 2.77778rem;
}

View file

@ -431,32 +431,70 @@ add_action( 'widgets_init', 'kit_widgets_init' );
# Highlight query in search results
function highlight_search_term_placeholders() {
static $iter = 0;
$ret = "|##{$iter}##|";
$iter++;
return $ret;
}
function highlight_search_term_cb() {
static $iter = 0;
$ret = "##{$iter}##";
$iter++;
return $ret;
}
function highlight_search_term($text){
if(is_search() && !is_admin()){
$keys = implode('|', explode(' ', get_search_query()));
$pattern = '/<[^>].*?>/i';
preg_match_all($pattern,$text,$matches);
$placeholders = array();
foreach ($matches[0] as $v) {
$placeholders[] = highlight_search_term_placeholders();
function generate_excerpt($text, $query, $length) {
$words = explode(' ', $text);
$total_words = count($words);
if ($total_words > $length) {
$queryLow = array_map('strtolower', $query);
$wordsLow = array_map('strtolower', $words);
for ($i=0; $i <= $total_words; $i++) {
foreach ($queryLow as $queryItem) {
if (preg_match("/\b$queryItem\b/", $wordsLow[$i])) {
$posFound = $i;
break;
}
}
if ($posFound) {
break;
}
}
if ($i > ($length+($length/2))) {
$i = $i - ($length/2);
} else {
$i = 0;
}
$text = preg_replace_callback($pattern,'highlight_search_term_cb',$text);
$pattern2 = '/(' . $keys .')/iu';
$text = preg_replace($pattern2, ' <strong class="tx-indexedsearch-redMarkup">\1</strong> ', $text);
$text = preg_replace($placeholders,$matches[0],$text);
}
$cutword = array_splice($words,$i,$length);
$excerpt = implode(' ', $cutword);
$keys = implode('|', $query);
$excerpt = preg_replace('/(' . $keys .')/iu', '<strong class="tx-indexedsearch-redMarkup">\0</strong>', $excerpt);
$excerptRet = '<p>';
if ($i !== 0) {
$excerptRet .= '... ';
}
return $text;
$excerptRet .= $excerpt . ' ...</p>';
return $excerptRet;
}
function search_excerpt_highlight() {
# Length in word count
$excerptLength = 32;
$text = wp_strip_all_tags( get_the_content() );
# Filter double quotes from query. They will
# work on the results side but won't help with
# text highlighting and displaying.
$query=get_search_query(false);
$query=str_replace('"','',$query);
$query=esc_html($query);
$query = explode(' ', $query);
echo generate_excerpt($text, $query, $excerptLength);
}
add_filter('the_excerpt', 'highlight_search_term');

View file

@ -22,28 +22,6 @@
<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_directory');?>/css/content.css" media="all">
<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_directory');?>/css/custom.css" media="all">
<link rel="apple-touch-icon" href="<?php bloginfo('stylesheet_directory');?>/img/apple-touch-icon.png">
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="<?php bloginfo('stylesheet_directory');?>/img/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="<?php bloginfo('stylesheet_directory');?>/img/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="<?php bloginfo('stylesheet_directory');?>/img/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="<?php bloginfo('stylesheet_directory');?>/img/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon-precomposed" sizes="60x60" href="<?php bloginfo('stylesheet_directory');?>/img/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="<?php bloginfo('stylesheet_directory');?>/img/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="<?php bloginfo('stylesheet_directory');?>/img/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="<?php bloginfo('stylesheet_directory');?>/img/apple-touch-icon-152x152.png">
<link rel="icon" type="image/png" href="<?php bloginfo('stylesheet_directory');?>/img/favicon-ogp/favicon-196x196.png" sizes="196x196">
<link rel="icon" type="image/png" href="<?php bloginfo('stylesheet_directory');?>/img/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="<?php bloginfo('stylesheet_directory');?>/img/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="<?php bloginfo('stylesheet_directory');?>/img/favicon-16x16.png" sizes="16x16">
<link rel="icon" type="image/png" href="<?php bloginfo('stylesheet_directory');?>/img/favicon-128.png" sizes="128x128">
<meta name="application-name" content="&nbsp;">
<meta name="msapplication-TileColor" content="#0065A9">
<meta name="msapplication-TileImage" content="<?php bloginfo('stylesheet_directory');?>/img/mstile-144x144.png">
<meta name="msapplication-square70x70logo" content="<?php bloginfo('stylesheet_directory');?>/img/mstile-70x70.png">
<meta name="msapplication-square150x150logo" content="<?php bloginfo('stylesheet_directory');?>/img/mstile-150x150.png">
<meta name="msapplication-wide310x150logo" content="<?php bloginfo('stylesheet_directory');?>/img/mstile-310x150.png">
<meta name="msapplication-square310x310logo" content="<?php bloginfo('stylesheet_directory');?>/img/mstile-310x310.png">
<script>
window.addEventListener('load',function(){
window.cookieconsent.initialise(

Binary file not shown.

Before

Width:  |  Height:  |  Size: 477 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 995 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

View file

@ -44,16 +44,27 @@ get_header();
<p>
<?php
global $wp_query;
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$post_count_start = (($paged -1) * 10) + 1;
$post_count_end = ((($paged -1) * 10) + $wp_query->post_count);
_e("Showing results", 'kit');
echo "<strong> ";
printf( esc_html__( '%d to %d', 'kit' ), $post_count_start, $post_count_end );
echo "</strong> ";
_e("from total results", 'kit');
echo " <strong>" . $wp_query->found_posts. "</strong>";
# Check if search results exists
if ($wp_query->found_posts) {
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$post_count_start = (($paged -1) * 10) + 1;
$post_count_end = ((($paged -1) * 10) + $wp_query->post_count);
_e("Showing results", 'kit');
echo "<strong> ";
printf( esc_html__( '%d to %d', 'kit' ), $post_count_start, $post_count_end );
echo "</strong> ";
_e("from total results", 'kit');
echo " <strong>" . $wp_query->found_posts. "</strong>";
} else {
echo "<p>";
_e("No results found", 'kit');
echo ".</p>";
}
?>
</p>
@ -77,7 +88,8 @@ get_header();
</span>
</h3>
<p class="tx-indexedsearch-description">
<?php the_excerpt(); ?>
<!-- <?php the_excerpt(); ?> -->
<?php search_excerpt_highlight(); ?>
</p>
<a href="#" class="link-more"><span>Weiterlesen</span></a>
</div>

View file

@ -4,7 +4,7 @@ services:
wordpress:
image: wordpress
restart: always
restart: on-failure
ports:
- 8080:80
environment: