Commit dd7837c9 authored by Leonardo Piccioni de Almeida's avatar Leonardo Piccioni de Almeida
Browse files

Remove external hacklab-blocks as a plugin submodule

parent 59e9fd24
[submodule "plugins/hacklab-dev-utils"]
path = plugins/hacklab-dev-utils
url = git@gitlab.hacklab.com.br:open-source/hacklab-dev-utils.git
[submodule "plugins/hacklab-blocks"]
path = plugins/hacklab-blocks
url = git@gitlab.hacklab.com.br:open-source/hacklab-blocks.git
FROM node:14
LABEL mantainer "hacklab/ <contato@hacklab.com.br>"
COPY compose/local/watcher/entrypoint.sh /entrypoint.sh
ENTRYPOINT /entrypoint.sh
RUN chmod +x /entrypoint.sh
RUN mkdir /app
WORKDIR /app
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/../plugins/hacklab-blocks
docker run -it -v `pwd`:/compilar node:14 bash -c "cd compilar && npm install && npm run production"
ls
pwd
cd $DIR/../plugins/
zip -r ../zips/hacklab-blocks.zip hacklab-blocks -x "hacklab-blocks/node_modules/*"
......@@ -20,7 +20,6 @@ services:
- ./wp-root:/var/www/html/
- ./themes/hacklab-theme:/var/www/html/wp-content/themes/hacklab-theme
- ./plugins/hacklab-dev-utils:/var/www/html/wp-content/plugins/hacklab-dev-utils
- ./plugins/hacklab-blocks:/var/www/html/wp-content/plugins/hacklab-blocks
- ./compose/local/wordpress/htaccess:/var/www/html/.htaccess
- ./compose/local/wordpress/php/extra.ini:/usr/local/etc/php/conf.d/extra.ini
......@@ -31,13 +30,6 @@ services:
volumes:
- ./themes/hacklab-theme:/app
watcher-plugin:
build:
context: .
dockerfile: ./compose/local/watcher/Dockerfile-node14 # Workaround until we update the blocks plugin
volumes:
- ./plugins/hacklab-blocks:/app
mariadb:
image: mariadb:10.4
volumes:
......
Subproject commit 8857e9f1386d9ed0f39b9c66d8df617d73c18664
......@@ -13,7 +13,6 @@ require __DIR__ . '/library/sanitizers/index.php';
require __DIR__ . '/library/template-tags/index.php';
require __DIR__ . '/library/utils.php';
require __DIR__ . '/library/blocks/index.php';
require __DIR__ . '/library/hacklab-blocks/index.php';
//Hide menu item if logged
function hide_menu_item_if_logged_in_ethos($items, $menu, $args) {
......
<?php
namespace hacklabr;
/**
* Exemplo para filtrar blocos do plugin Hacklab Blocks
*
* Descomente a linha abaixo e filtre os blocos na função `active_hacklab_blocks`
*/
//add_filter( 'hacklab_blocos_ativos', 'hacklabr\\active_hacklab_blocks' );
function active_hacklab_blocks( $active_blocks ){
// unset( $active_blocks['sample-block'] );
return $active_blocks;
}
/**
* Exemplo de como adicionar elementos nos filtros do bloco Posts via API
*
* Descomente a linha abaixo para adicionar, por exemplo, para adicionar os atributos (image_credits e meta_authors) à resposta da API **no projeto de onde vem os posts**.
*/
// add_filter('hacklab-fetch-posts-api-before-excerpt-embed_post','hacklabr\\add_image_credits',10,3);
function add_image_credits( $content, $attributes, $post ) {
if ( $attributes['showImageCredit'] == true ) {
$content .= '<p class="post-image-credit">Foto: ' . $post['image_credit'] . '</p>';
}
$content .= '<p class="post-authors">' . $post['meta_authors'] . '</p>';
return $content;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment