Remember, there are 'TWIG' tools and then there are 'Timber' tools.
The second is WordPress specific.
# Kinsta Deployment through Github Actions for Bedrock/Sage. | |
# | |
# Placed at: .github/workflow/deploy.yml | |
# | |
# Process should be studied from code, but some quick brief: | |
# - runs composer / sage installation | |
# - moves correct `.env.*` file for multiple configs | |
# - uses rsync to sync files, uses /.rsyncignore file to exclude whatever should not be there | |
# - symlinks uploads folder and symlink release folder to kinsta public hostname | |
# - if you want to clear cache, please uncomment the last job |
Each piece of content in Hugo should have front matter. Front matter is like post meta. It can be formatted 4 ways: JSON, YAML, TOML, or ORG.
yaml format
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
// Removing plugin controls from admin | |
function remove_plugin_controls($actions, $plugin_file, $plugin_data, $context){ | |
if (array_key_exists('edit', $actions)) { | |
unset($actions['edit']); | |
} | |
if (array_key_exists('deactivate', $actions)) { |
You should not use the Open SSH client that comes with Git for Windows. Instead, Windows 10 has its own implementation of Open SSH that is integrated with the system. To achieve this:
ssh-agent
from Windows Services:Services
in the Start Menu
or Win+R
and then type services.msc
to launch the Services window;OpenSSH Authentication Agent
in the list and double click on it;OpenSSH Authentication Agent Properties
window that appears, choose Automatic
from the Startup type:
dropdown and click Start
from Service status:
. Make sure it now says Service status: Running
.git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe
<?php | |
/** | |
* Detect Tribe Events page | |
* @link https://wordpress.stackexchange.com/questions/340515/writing-a-function-to-detect-an-event | |
*/ | |
function is_tribe_calendar() { | |
if (tribe_is_event() || tribe_is_event_category() || tribe_is_in_main_loop() || tribe_is_view() || 'tribe_events' == get_post_type() || is_singular( 'tribe_events' )) { | |
return true; | |
} | |
else { |
version: 2 | |
jobs: | |
build: | |
docker: | |
- image: ruby:2.3.3-alpine | |
working_directory: /home/circleci/masutaka.net | |
steps: | |
- setup_remote_docker: | |
# https://circleci.com/docs/2.0/docker-layer-caching/ | |
reusable: true |
To remove a submodule you need to:
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref | |
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.github.io | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php | |
*/ |
# app/config/deploy.rb | |
# Most of the changes specific to your environment will be set in | |
# the `app/config/deploy/[env].rb` files. | |
# define multiple deployments | |
set :stages, %w(production staging) | |
set :default_stage, "staging" |