Edgar Allan Poe: Marginalia

The concept of writing in the margins of a printed text has always perplexed me. Not that it’s defacing the tome. Rather that if I come across it again years later I’ll look at the notes and think.

“Well, that was silly of me to think that”

I’ll check out this link later and see what Edgar thinks of the subject. Could even change my mind.

https://books.eserver.org/fiction/poe/marginalia

A week with the System76 Galago Pro

My new System76 Galago Pro arrived last Friday and I promised to use it for at least a month before typing up a review. So for now here’s a few photos and a list of what I’ve been up to with this new computer.

  • Used Libre Office Writer and Calc at the office
  • Used Vim and gEdit for extensive coding
  • Installed WordPress
  • Added Rhythmbox for locally stored music playback
  • Copy edited a magazine in Evince
  • Tested WordPress 5.0 Release Candidate 3 and filed a bug report
  • Spoke at a meetup and presented on WordPress’s new release
  • Wrote this quick post 🙂

Removing specific Gutenberg core blocks and options

As I eagerly await WordPress 5.0 and its integration of the Gutenberg block editor there were several features that I found troubling from the standpoint of a web designer and developer. All of which are the result of too many options for the end user.

I work in an enterprise environment so many of these features would be fantastic for a blog, but can easily get in the way of a higher education website.

  1. Limit the available core blocks to only what’s needed.
  2. Remove the ability for users to set almost any font size in the paragraph tool.
  3. Remove ability for users to set their own text and background colors.

Limit the available core blocks

function pz_allowed_block_types( $allowed_block_types, $post ) {
    if ( $post->post_type !== 'post' ) {
        return $allowed_block_types;
    }
    return array( 
	'core/paragraph',
	'core/image',
	'core/gallery',
	'core/html',
	'core/list',
	'core/heading',
	'core/subhead',
	'core/quote',
	'core/audio',
	'core/cover-image',
	'core/file',
	'core/video',
	'core/table',
	'core/verse',
	'core/freeform',
	'core/preformatted',
	'core/pullquote',
	'core/button',
	'core/text-columns',
	'core/next-page',
	'core/separator',
	'core/spacer',
	'core/shortcode',
	'core/archieves',
	'core-embed/twitter',
	'core-embed/youtube',
	'core-embed/facebook',
	'core-embed/instagram',
	'core-embed/wordpress',
	'core-embed/spotify',
	'core-embed/flickr',
	'core-embed/vimeo',
	'core-embed/issuu',
	'core-embed/slideshare',
	);
}

add_filter( 'allowed_block_types', 'pz_allowed_block_types', 10, 2 );

Font sizes

// disable manual font sizes
add_theme_support( 'disable-custom-font-sizes' );

Remove the color palette

// disable custom colors
add_theme_support( 'disable-custom-colors' );

// remove color palette
add_theme_support( 'editor-color-palette' );

The Complete Plugin

I’m still learning all things Gutenberg Use at your own risk 🙂

<?php
/**
 * @package pz_gutenberg_settings
 * @version 1.0
 */
/*
Plugin Name: PZ Gutenberg Block Editor Settings
Plugin URI: https://www.pitzer.edu
Description: Restricts some Gutenberg block editor core features and adds customized defaults
Author: Joseph Dickson
Version: 1.0
Author URI: https://www.pitzer.edu

Allow only the following core blocks
Blog post that worked: https://rudrastyh.com/gutenberg/remove-default-blocks.html
Official Documentation: https://wordpress.org/gutenberg/handbook/designers-developers/developers/filters/block-filters/
*/

function pz_allowed_block_types( $allowed_block_types, $post ) {
    if ( $post->post_type !== 'post' ) {
        return $allowed_block_types;
    }
    return array( 
	'core/paragraph',
	'core/image',
	'core/gallery',
	'core/html',
	'core/list',
	'core/heading',
	'core/subhead',
	'core/quote',
	'core/audio',
	'core/cover-image',
	'core/file',
	'core/video',
	'core/table',
	'core/verse',
	'core/freeform',
	'core/preformatted',
	'core/pullquote',
	'core/button',
	'core/text-columns',
	'core/next-page',
	'core/separator',
	'core/spacer',
	'core/shortcode',
	'core/archieves',
	'core-embed/twitter',
	'core-embed/youtube',
	'core-embed/facebook',
	'core-embed/instagram',
	'core-embed/wordpress',
	'core-embed/spotify',
	'core-embed/flickr',
	'core-embed/vimeo',
	'core-embed/issuu',
	'core-embed/slideshare',
	);
}

add_filter( 'allowed_block_types', 'pz_allowed_block_types', 10, 2 );

// disable manual font size slider and input box
add_theme_support( 'disable-custom-font-sizes' );

// disable custom colors
add_theme_support( 'disable-custom-colors' );

// remove color palette
add_theme_support( 'editor-color-palette' );

// adjust preset font sizes
add_theme_support( 'editor-font-sizes', array(
	array(
		'name' => __( 'small', 'themeLangDomain' ),
		'shortName' => __( 'S', 'themeLangDomain' ),
		'size' => 13,
		'slug' => 'small'
    	),
	array(
        	'name' => __( 'Standard', 'themeLangDomain' ),
        	'shortName' => __( 'D', 'themeLangDomain' ),
        	'size' => 16,
        	'slug' => 'standard'
	),	
	array(
        	'name' => __( 'medium', 'themeLangDomain' ),
        	'shortName' => __( 'M', 'themeLangDomain' ),
        	'size' => 20,
        	'slug' => 'medium'
	),
	array(
		'name' => __( 'large', 'themeLangDomain' ),
		'shortName' => __( 'L', 'themeLangDomain' ),
		'size' => 24,
		'slug' => 'large'
    	),
	array(
		'name' => __( 'extra large', 'themeLangDomain' ),
        	'shortName' => __( 'XL', 'themeLangDomain' ),
		'size' => 28,
		'slug' => 'extra-large'
	)
) );
?>

The above code was wrapped together from the following pages