Compare commits
10 commits
80844fe4eb
...
4b0283f699
| Author | SHA1 | Date | |
|---|---|---|---|
| 4b0283f699 | |||
| 30182d3fc8 | |||
| 9c246b6665 | |||
| 591dfd473f | |||
| aad50bf239 | |||
| c1ca62ea2e | |||
| 9423a7bff0 | |||
| ef9644c8d7 | |||
| dae32307ff | |||
| 5e216478a3 |
11 changed files with 114 additions and 80 deletions
33
Makefile
33
Makefile
|
|
@ -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_deploy:
|
||||||
|
|
||||||
docker run --rm -it \
|
docker run --rm -it \
|
||||||
-v /tmp/backup:/backup -v /var/lib/docker:/docker \
|
-v /tmp/backup:/backup -v /var/lib/docker:/docker \
|
||||||
-v $(shell pwd)/kit:/docker/volumes/web-wordpress-kit_wordpress/_data/wp-content/themes/kit \
|
-v $(shell pwd)/kit:/docker/volumes/${CONTAINER_NAME_WORDPRESS}/_data/wp-content/themes/kit \
|
||||||
alpine:edge tar cpfz /backup/volumes.tgz /docker/volumes/
|
alpine:edge tar cpfz /backup/volumes.tgz /docker/volumes/${CONTAINER_NAME_WORDPRESS} /docker/volumes/${CONTAINER_NAME_DB}
|
||||||
rsync --progress /tmp/backup/volumes.tgz playground.pi:/tmp/
|
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://${DOCKER_HOST}" docker stop ${CONTAINER_NAME_WORDPRESS}_1 ${CONTAINER_NAME_DB}_1
|
||||||
-DOCKER_HOST="ssh://playground.pi" docker rm web-wordpress-kit_db_1 web-wordpress-kit_wordpress_1
|
-DOCKER_HOST="ssh://${DOCKER_HOST}" docker rm ${CONTAINER_NAME_WORDPRESS}_1 ${CONTAINER_NAME_DB}_1
|
||||||
-DOCKER_HOST="ssh://playground.pi" docker volume rm web-wordpress-kit_db web-wordpress-kit_wordpress
|
-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 /var/lib/docker:/docker \
|
||||||
-v /tmp:/volume-backup \
|
-v /tmp:/volume-backup \
|
||||||
alpine:edge tar --strip-components=2 -xpvf /volume-backup/volumes.tgz -C /docker/volumes/
|
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 /var/lib/docker:/docker \
|
||||||
-v /tmp:/volume-backup \
|
-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
|
# # 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
|
cp wordpress.yml /tmp/wordpress.yml
|
||||||
sed -e '/kit/ s/^#*/#/' -i /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://${DOCKER_HOST}" docker-compose -p ${PROJECT_NAME} -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 start
|
||||||
|
|
||||||
docker_up:
|
docker_up:
|
||||||
docker-compose -f wordpress.yml up
|
docker-compose -f wordpress.yml up
|
||||||
|
|
@ -39,3 +44,7 @@ generate_pot:
|
||||||
# generate mo file \
|
# generate mo file \
|
||||||
msgfmt -o kit/languages/$${i18n}.mo kit/languages/$${i18n}.po ; \
|
msgfmt -o kit/languages/$${i18n}.mo kit/languages/$${i18n}.po ; \
|
||||||
done
|
done
|
||||||
|
|
||||||
|
install:
|
||||||
|
mkdir -p $(DESTDIR)
|
||||||
|
cp -r kit $(DESTDIR)/
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
|
@ -181,6 +181,9 @@
|
||||||
font-size: 1.55556rem;
|
font-size: 1.55556rem;
|
||||||
line-height: 1.77778rem;
|
line-height: 1.77778rem;
|
||||||
}
|
}
|
||||||
|
.footer-bottom .content-wrap {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 1024px) {
|
@media (max-width: 1024px) {
|
||||||
|
|
@ -307,6 +310,8 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-bottom .content-wrap ul {
|
.footer-bottom .content-wrap ul {
|
||||||
|
|
@ -340,9 +345,3 @@
|
||||||
.footer-bottom .content-wrap .copyright {
|
.footer-bottom .content-wrap .copyright {
|
||||||
margin-top: 0px;
|
margin-top: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-bottom .content-wrap {
|
|
||||||
overflow-wrap: break-word;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,6 @@ header:not(.sticky-header) .header-button-container {
|
||||||
|
|
||||||
.header-logo {
|
.header-logo {
|
||||||
display: block;
|
display: block;
|
||||||
width: 10rem;
|
|
||||||
height: 4.61111rem;
|
height: 4.61111rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -81,7 +80,6 @@ header:not(.sticky-header) .header-button-container {
|
||||||
|
|
||||||
.header-logo-mobile {
|
.header-logo-mobile {
|
||||||
display: none;
|
display: none;
|
||||||
width: 6.11111rem;
|
|
||||||
height: 2.77778rem;
|
height: 2.77778rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -431,32 +431,70 @@ add_action( 'widgets_init', 'kit_widgets_init' );
|
||||||
|
|
||||||
# Highlight query in search results
|
# Highlight query in search results
|
||||||
|
|
||||||
function highlight_search_term_placeholders() {
|
function generate_excerpt($text, $query, $length) {
|
||||||
static $iter = 0;
|
|
||||||
$ret = "|##{$iter}##|";
|
$words = explode(' ', $text);
|
||||||
$iter++;
|
$total_words = count($words);
|
||||||
return $ret;
|
|
||||||
}
|
if ($total_words > $length) {
|
||||||
function highlight_search_term_cb() {
|
|
||||||
static $iter = 0;
|
$queryLow = array_map('strtolower', $query);
|
||||||
$ret = "##{$iter}##";
|
$wordsLow = array_map('strtolower', $words);
|
||||||
$iter++;
|
|
||||||
return $ret;
|
for ($i=0; $i <= $total_words; $i++) {
|
||||||
}
|
|
||||||
function highlight_search_term($text){
|
foreach ($queryLow as $queryItem) {
|
||||||
if(is_search() && !is_admin()){
|
|
||||||
$keys = implode('|', explode(' ', get_search_query()));
|
if (preg_match("/\b$queryItem\b/", $wordsLow[$i])) {
|
||||||
$pattern = '/<[^>].*?>/i';
|
$posFound = $i;
|
||||||
preg_match_all($pattern,$text,$matches);
|
break;
|
||||||
$placeholders = array();
|
}
|
||||||
foreach ($matches[0] as $v) {
|
}
|
||||||
$placeholders[] = highlight_search_term_placeholders();
|
|
||||||
|
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');
|
|
||||||
|
|
|
||||||
|
|
@ -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/content.css" media="all">
|
||||||
<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_directory');?>/css/custom.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=" ">
|
|
||||||
<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>
|
<script>
|
||||||
window.addEventListener('load',function(){
|
window.addEventListener('load',function(){
|
||||||
window.cookieconsent.initialise(
|
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 |
|
|
@ -44,16 +44,27 @@ get_header();
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<?php
|
<?php
|
||||||
global $wp_query;
|
|
||||||
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
|
# Check if search results exists
|
||||||
$post_count_start = (($paged -1) * 10) + 1;
|
if ($wp_query->found_posts) {
|
||||||
$post_count_end = ((($paged -1) * 10) + $wp_query->post_count);
|
|
||||||
_e("Showing results", 'kit');
|
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
|
||||||
echo "<strong> ";
|
$post_count_start = (($paged -1) * 10) + 1;
|
||||||
printf( esc_html__( '%d to %d', 'kit' ), $post_count_start, $post_count_end );
|
$post_count_end = ((($paged -1) * 10) + $wp_query->post_count);
|
||||||
echo "</strong> ";
|
_e("Showing results", 'kit');
|
||||||
_e("from total results", 'kit');
|
echo "<strong> ";
|
||||||
echo " <strong>" . $wp_query->found_posts. "</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>
|
</p>
|
||||||
|
|
||||||
|
|
@ -77,7 +88,8 @@ get_header();
|
||||||
</span>
|
</span>
|
||||||
</h3>
|
</h3>
|
||||||
<p class="tx-indexedsearch-description">
|
<p class="tx-indexedsearch-description">
|
||||||
<?php the_excerpt(); ?>
|
<!-- <?php the_excerpt(); ?> -->
|
||||||
|
<?php search_excerpt_highlight(); ?>
|
||||||
</p>
|
</p>
|
||||||
<a href="#" class="link-more"><span>Weiterlesen</span></a>
|
<a href="#" class="link-more"><span>Weiterlesen</span></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ services:
|
||||||
|
|
||||||
wordpress:
|
wordpress:
|
||||||
image: wordpress
|
image: wordpress
|
||||||
restart: always
|
restart: on-failure
|
||||||
ports:
|
ports:
|
||||||
- 8080:80
|
- 8080:80
|
||||||
environment:
|
environment:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue