Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5891467266 | ||
|
|
b9b8307088 |
@@ -18,9 +18,14 @@ wp-content/plugins/akismet/
|
|||||||
wp-content/plugins/fluentform/
|
wp-content/plugins/fluentform/
|
||||||
wp-content/plugins/fluent-crm/
|
wp-content/plugins/fluent-crm/
|
||||||
wp-content/plugins/fluent-smtp/
|
wp-content/plugins/fluent-smtp/
|
||||||
|
wp-content/plugins/redis-cache/
|
||||||
|
wp-content/plugins/query-monitor/
|
||||||
wp-content/plugins/hello.php
|
wp-content/plugins/hello.php
|
||||||
wp-content/plugins/index.php
|
wp-content/plugins/index.php
|
||||||
|
|
||||||
|
# Redis object cache drop-in (auto-installed by wpcli service)
|
||||||
|
wp-content/object-cache.php
|
||||||
|
|
||||||
# Keep only project plugins/themes
|
# Keep only project plugins/themes
|
||||||
!wp-content/plugins/gustavoo-portfolio-core/
|
!wp-content/plugins/gustavoo-portfolio-core/
|
||||||
!wp-content/themes/gustavoo-portfolio/
|
!wp-content/themes/gustavoo-portfolio/
|
||||||
|
|||||||
@@ -33,7 +33,43 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
db:
|
db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
redis:
|
||||||
|
condition: service_healthy
|
||||||
|
|
||||||
|
redis:
|
||||||
|
image: redis:7-alpine
|
||||||
|
volumes:
|
||||||
|
- redis_data:/data
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "redis-cli", "ping"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 10
|
||||||
|
start_period: 10s
|
||||||
|
|
||||||
|
wpcli:
|
||||||
|
image: wordpress:cli-php8.3
|
||||||
|
user: "33:33"
|
||||||
|
depends_on:
|
||||||
|
wordpress:
|
||||||
|
condition: service_started
|
||||||
|
redis:
|
||||||
|
condition: service_healthy
|
||||||
|
environment:
|
||||||
|
WORDPRESS_DB_HOST: db
|
||||||
|
WORDPRESS_DB_NAME: ${WORDPRESS_DB_NAME}
|
||||||
|
WORDPRESS_DB_USER: ${WORDPRESS_DB_USER}
|
||||||
|
WORDPRESS_DB_PASSWORD: ${WORDPRESS_DB_PASSWORD}
|
||||||
|
HOME: /tmp
|
||||||
|
volumes:
|
||||||
|
- wordpress_data:/var/www/html
|
||||||
|
- ./wp-content/themes:/var/www/html/wp-content/themes
|
||||||
|
- ./wp-content/plugins:/var/www/html/wp-content/plugins
|
||||||
|
- ./docker/wp-init.sh:/wp-init.sh:ro
|
||||||
|
entrypoint: ["sh", "/wp-init.sh"]
|
||||||
|
restart: "no"
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
db_data:
|
db_data:
|
||||||
wordpress_data:
|
wordpress_data:
|
||||||
|
redis_data:
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "[wpcli] Waiting for WordPress core install..."
|
||||||
|
until wp core is-installed --path=/var/www/html 2>/dev/null; do
|
||||||
|
sleep 3
|
||||||
|
done
|
||||||
|
|
||||||
|
if ! wp language core is-installed pt_BR --path=/var/www/html 2>/dev/null; then
|
||||||
|
echo "[wpcli] Installing pt_BR language pack..."
|
||||||
|
wp language core install pt_BR --path=/var/www/html
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "[wpcli] Activating pt_BR site language..."
|
||||||
|
wp language core activate pt_BR --path=/var/www/html
|
||||||
|
|
||||||
|
echo "[wpcli] Setting Redis connection constants..."
|
||||||
|
wp config set WP_REDIS_HOST redis --type=constant --path=/var/www/html
|
||||||
|
wp config set WP_REDIS_PORT 6379 --type=constant --raw --path=/var/www/html
|
||||||
|
|
||||||
|
if ! wp plugin is-installed redis-cache --path=/var/www/html; then
|
||||||
|
echo "[wpcli] Installing Redis Object Cache plugin..."
|
||||||
|
wp plugin install redis-cache --path=/var/www/html
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "[wpcli] Activating Redis Object Cache plugin..."
|
||||||
|
wp plugin activate redis-cache --path=/var/www/html
|
||||||
|
|
||||||
|
echo "[wpcli] Enabling Redis object cache..."
|
||||||
|
wp redis enable --path=/var/www/html || wp redis update-dropin --path=/var/www/html
|
||||||
|
|
||||||
|
echo "[wpcli] Redis setup complete."
|
||||||
|
|
||||||
|
if ! wp plugin is-installed query-monitor --path=/var/www/html; then
|
||||||
|
echo "[wpcli] Installing Query Monitor plugin..."
|
||||||
|
wp plugin install query-monitor --path=/var/www/html
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "[wpcli] Activating Query Monitor plugin..."
|
||||||
|
wp plugin activate query-monitor --path=/var/www/html
|
||||||
|
|
||||||
|
echo "[wpcli] Activating Gustavo Portfolio Core dependencies..."
|
||||||
|
wp plugin activate fluentform fluent-crm fluent-smtp --path=/var/www/html
|
||||||
|
|
||||||
|
echo "[wpcli] Activating Gustavo Portfolio Core plugin..."
|
||||||
|
wp plugin activate gustavoo-portfolio-core --path=/var/www/html
|
||||||
|
|
||||||
|
echo "[wpcli] Activating Gustavo Portfolio theme..."
|
||||||
|
wp theme activate gustavoo-portfolio --path=/var/www/html
|
||||||
@@ -2684,6 +2684,79 @@ p:last-child {
|
|||||||
|
|
||||||
.menu-drawer-close { display: none; }
|
.menu-drawer-close { display: none; }
|
||||||
|
|
||||||
|
.header-search {
|
||||||
|
position: relative;
|
||||||
|
flex: 0 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-search__toggle {
|
||||||
|
display: flex;
|
||||||
|
width: 42px;
|
||||||
|
height: 42px;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
color: var(--color-text);
|
||||||
|
background: rgba(255, 255, 255, 0.035);
|
||||||
|
border: 1px solid var(--color-line-soft);
|
||||||
|
border-radius: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-search__toggle:hover,
|
||||||
|
.header-search__toggle[aria-expanded="true"] {
|
||||||
|
color: var(--color-brand-strong);
|
||||||
|
border-color: var(--color-brand);
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-search__panel {
|
||||||
|
position: absolute;
|
||||||
|
top: calc(100% + 10px);
|
||||||
|
right: 0;
|
||||||
|
z-index: 60;
|
||||||
|
display: flex;
|
||||||
|
width: 400px;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
padding: 12px;
|
||||||
|
background: var(--color-bg-alt);
|
||||||
|
border: 1px solid var(--color-line-soft);
|
||||||
|
border-radius: 12px;
|
||||||
|
box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-search__panel[hidden] { display: none; }
|
||||||
|
.header-search__panel .search-form { flex: 1; }
|
||||||
|
|
||||||
|
.header-search__close {
|
||||||
|
display: none;
|
||||||
|
width: 34px;
|
||||||
|
height: 34px;
|
||||||
|
flex: 0 0 auto;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
color: var(--color-text-soft);
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 920px) {
|
||||||
|
.header-search__panel {
|
||||||
|
position: fixed;
|
||||||
|
top: var(--header-height);
|
||||||
|
right: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 1002;
|
||||||
|
width: auto;
|
||||||
|
padding: 14px var(--gutter);
|
||||||
|
border-radius: 0;
|
||||||
|
border-width: 0 0 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-search__close { display: flex; }
|
||||||
|
|
||||||
|
.header-search__panel .search-form__submit span:not([aria-hidden]) { display: none; }
|
||||||
|
.header-search__panel .search-form__submit { min-width: 44px; padding: 10px; }
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* WordPress inserts its native Customizer shortcut just outside the left edge
|
* WordPress inserts its native Customizer shortcut just outside the left edge
|
||||||
* of a partial by default. The preview iframe clips that area behind the
|
* of a partial by default. The preview iframe clips that area behind the
|
||||||
@@ -3863,7 +3936,7 @@ a.entry-category-badge:hover { color: #052b28; background: var(--color-brand-str
|
|||||||
.latest-news-card__excerpt { color: var(--color-text-soft); }
|
.latest-news-card__excerpt { color: var(--color-text-soft); }
|
||||||
|
|
||||||
.latest-news-list {
|
.latest-news-list {
|
||||||
width: min(100%, 720px);
|
width: min(100%, 1080px);
|
||||||
margin-top: clamp(64px, 8vw, 100px);
|
margin-top: clamp(64px, 8vw, 100px);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3884,14 +3957,14 @@ a.entry-category-badge:hover { color: #052b28; background: var(--color-brand-str
|
|||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.latest-news-list__items { display: grid; gap: 28px; }
|
.latest-news-list__items { display: grid; gap: 40px; }
|
||||||
|
|
||||||
.latest-news-list__item {
|
.latest-news-list__item {
|
||||||
display: grid;
|
display: grid;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 17px;
|
gap: 28px;
|
||||||
grid-template-columns: 120px minmax(0, 1fr);
|
grid-template-columns: 340px minmax(0, 1fr);
|
||||||
}
|
}
|
||||||
|
|
||||||
.latest-news-list__image {
|
.latest-news-list__image {
|
||||||
@@ -3910,23 +3983,24 @@ a.entry-category-badge:hover { color: #052b28; background: var(--color-brand-str
|
|||||||
}
|
}
|
||||||
|
|
||||||
.latest-news-list__item:hover .latest-news-list__image img { transform: scale(1.05); }
|
.latest-news-list__item:hover .latest-news-list__image img { transform: scale(1.05); }
|
||||||
.latest-news-list__body .latest-news-card__category { margin-bottom: 8px; }
|
.latest-news-list__body .latest-news-card__category { margin-bottom: 14px; font-size: 0.95rem; }
|
||||||
|
|
||||||
.latest-news-list__body h3 {
|
.latest-news-list__body h3 {
|
||||||
margin: 0 0 7px;
|
margin: 0 0 14px;
|
||||||
color: var(--color-text);
|
color: var(--color-text);
|
||||||
font-size: clamp(0.94rem, 1.4vw, 1.08rem);
|
font-size: clamp(1.5rem, 2.6vw, 2.1rem);
|
||||||
line-height: 1.28;
|
line-height: 1.24;
|
||||||
}
|
}
|
||||||
|
|
||||||
.latest-news-list__body h3 a { color: inherit; text-decoration: none; }
|
.latest-news-list__body h3 a { color: inherit; text-decoration: none; }
|
||||||
.latest-news-list__body h3 a:hover { color: var(--color-brand-strong); }
|
.latest-news-list__body h3 a:hover { color: var(--color-brand-strong); }
|
||||||
.latest-news-list__body time { color: var(--color-text-muted); font-size: 0.76rem; }
|
.latest-news-list__body time { color: var(--color-text-muted); font-size: 1rem; }
|
||||||
|
|
||||||
@media (max-width: 560px) {
|
@media (max-width: 760px) {
|
||||||
.latest-news-list { margin-top: 58px; }
|
.latest-news-list { margin-top: 58px; }
|
||||||
.latest-news-list__heading { margin-bottom: 28px; }
|
.latest-news-list__heading { margin-bottom: 28px; }
|
||||||
.latest-news-list__item { gap: 13px; grid-template-columns: 92px minmax(0, 1fr); }
|
.latest-news-list__item { gap: 16px; grid-template-columns: 1fr; }
|
||||||
|
.latest-news-list__body h3 { font-size: clamp(1.2rem, 5vw, 1.5rem); }
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Editorial page header order: site header, categories, then page heading. */
|
/* Editorial page header order: site header, categories, then page heading. */
|
||||||
|
|||||||
@@ -177,6 +177,62 @@
|
|||||||
desktopQuery.addEventListener("change", handleDesktop);
|
desktopQuery.addEventListener("change", handleDesktop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const searchToggle = document.querySelector(".header-search__toggle");
|
||||||
|
const searchPanel = document.querySelector(".header-search__panel");
|
||||||
|
|
||||||
|
if (searchToggle && searchPanel) {
|
||||||
|
const searchClose = searchPanel.querySelector(".header-search__close");
|
||||||
|
const searchField = searchPanel.querySelector(".search-form__field, .search-field");
|
||||||
|
|
||||||
|
const closeSearch = (restoreFocus) => {
|
||||||
|
searchToggle.setAttribute("aria-expanded", "false");
|
||||||
|
searchPanel.hidden = true;
|
||||||
|
|
||||||
|
if (restoreFocus) {
|
||||||
|
searchToggle.focus();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const openSearch = () => {
|
||||||
|
searchToggle.setAttribute("aria-expanded", "true");
|
||||||
|
searchPanel.hidden = false;
|
||||||
|
|
||||||
|
if (searchField) {
|
||||||
|
window.requestAnimationFrame(() => searchField.focus());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
searchToggle.addEventListener("click", function () {
|
||||||
|
if (searchToggle.getAttribute("aria-expanded") === "true") {
|
||||||
|
closeSearch(false);
|
||||||
|
} else {
|
||||||
|
openSearch();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (searchClose) {
|
||||||
|
searchClose.addEventListener("click", function () {
|
||||||
|
closeSearch(true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener("click", function (event) {
|
||||||
|
if (searchToggle.getAttribute("aria-expanded") !== "true") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!event.target.closest(".header-search")) {
|
||||||
|
closeSearch(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
document.addEventListener("keydown", function (event) {
|
||||||
|
if (event.key === "Escape" && searchToggle.getAttribute("aria-expanded") === "true") {
|
||||||
|
closeSearch(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (window.location.hash.length > 1) {
|
if (window.location.hash.length > 1) {
|
||||||
const hashId = decodeURIComponent(window.location.hash.slice(1));
|
const hashId = decodeURIComponent(window.location.hash.slice(1));
|
||||||
const hashTarget = document.getElementById(hashId);
|
const hashTarget = document.getElementById(hashId);
|
||||||
|
|||||||
@@ -61,6 +61,20 @@ $gustavoo_primary_shortcut_attr = is_customize_preview() ? ' data-customize-part
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
<?php if ( $gustavoo_is_editorial_page ) : ?>
|
||||||
|
<div class="header-search">
|
||||||
|
<button class="header-search__toggle" type="button" aria-expanded="false" aria-controls="header-search-panel" aria-label="<?php esc_attr_e( 'Pesquisar', 'gustavoo-portfolio' ); ?>">
|
||||||
|
<svg aria-hidden="true" viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="7"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>
|
||||||
|
</button>
|
||||||
|
<div class="header-search__panel" id="header-search-panel" hidden>
|
||||||
|
<?php get_search_form(); ?>
|
||||||
|
<button class="header-search__close" type="button" data-search-close aria-label="<?php esc_attr_e( 'Fechar busca', 'gustavoo-portfolio' ); ?>">
|
||||||
|
<svg aria-hidden="true" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
|||||||
@@ -532,24 +532,19 @@ function gustavoo_portfolio_reading_time( $post_id = null ) {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function gustavoo_portfolio_entry_terms() {
|
function gustavoo_portfolio_entry_terms() {
|
||||||
$categories = get_the_category_list( esc_html_x( ', ', 'category list separator', 'gustavoo-portfolio' ) );
|
|
||||||
$tags = get_the_tag_list( '', esc_html_x( ', ', 'tag list separator', 'gustavoo-portfolio' ) );
|
$tags = get_the_tag_list( '', esc_html_x( ', ', 'tag list separator', 'gustavoo-portfolio' ) );
|
||||||
|
|
||||||
if ( $categories ) {
|
if ( ! $tags ) {
|
||||||
printf(
|
return false;
|
||||||
'<div class="entry-terms entry-terms--categories"><span>%1$s</span> %2$s</div>',
|
|
||||||
esc_html__( 'Categorias:', 'gustavoo-portfolio' ),
|
|
||||||
wp_kses_post( $categories )
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $tags ) {
|
|
||||||
printf(
|
printf(
|
||||||
'<div class="entry-terms entry-terms--tags"><span>%1$s</span> %2$s</div>',
|
'<div class="entry-terms entry-terms--tags"><span>%1$s</span> %2$s</div>',
|
||||||
esc_html__( 'Tags:', 'gustavoo-portfolio' ),
|
esc_html__( 'Tags:', 'gustavoo-portfolio' ),
|
||||||
wp_kses_post( $tags )
|
wp_kses_post( $tags )
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -62,9 +62,11 @@ get_header();
|
|||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<?php if ( get_the_tag_list() ) : ?>
|
||||||
<footer class="entry-footer">
|
<footer class="entry-footer">
|
||||||
<?php gustavoo_portfolio_entry_terms(); ?>
|
<?php gustavoo_portfolio_entry_terms(); ?>
|
||||||
</footer>
|
</footer>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$gustavoo_categories = get_the_category();
|
$gustavoo_categories = get_the_category();
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ $gustavoo_args = isset( $args ) && is_array( $args ) ? $args : array();
|
|||||||
$gustavoo_query_args = array(
|
$gustavoo_query_args = array(
|
||||||
'post_type' => 'post',
|
'post_type' => 'post',
|
||||||
'post_status' => 'publish',
|
'post_status' => 'publish',
|
||||||
'posts_per_page' => 4,
|
'posts_per_page' => 10,
|
||||||
'post__not_in' => array_map( 'absint', $gustavoo_args['exclude'] ?? array() ),
|
'post__not_in' => array_map( 'absint', $gustavoo_args['exclude'] ?? array() ),
|
||||||
'ignore_sticky_posts' => true,
|
'ignore_sticky_posts' => true,
|
||||||
'orderby' => 'date',
|
'orderby' => 'date',
|
||||||
@@ -26,8 +26,7 @@ if ( ! $gustavoo_latest_posts->have_posts() ) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<section class="latest-news-list" aria-labelledby="latest-news-list-title">
|
<section class="latest-news-list" aria-label="<?php esc_attr_e( 'Últimas notícias', 'gustavoo-portfolio' ); ?>">
|
||||||
<h2 id="latest-news-list-title" class="latest-news-list__heading"><?php esc_html_e( 'Últimas notícias', 'gustavoo-portfolio' ); ?></h2>
|
|
||||||
<div class="latest-news-list__items">
|
<div class="latest-news-list__items">
|
||||||
<?php while ( $gustavoo_latest_posts->have_posts() ) : $gustavoo_latest_posts->the_post(); ?>
|
<?php while ( $gustavoo_latest_posts->have_posts() ) : $gustavoo_latest_posts->the_post(); ?>
|
||||||
<?php $gustavoo_categories = get_the_category(); $gustavoo_category = $gustavoo_categories ? $gustavoo_categories[0] : null; $gustavoo_image_url = gustavoo_portfolio_get_news_image_url(); ?>
|
<?php $gustavoo_categories = get_the_category(); $gustavoo_category = $gustavoo_categories ? $gustavoo_categories[0] : null; $gustavoo_image_url = gustavoo_portfolio_get_news_image_url(); ?>
|
||||||
|
|||||||
Reference in New Issue
Block a user