Giter VIP home page Giter VIP logo

commonplace-wp-theme's Introduction

Commonplace WordPress theme

This is a simple, translation-ready WordPress theme that came about after conversations with designer Bec Worth about the usefulness of a Commonplace Book and what it could feel like on the web. Technically, it borrows heavily from my Notebook theme. Most text is set in the variable versions of Source Serif Pro and Source Sans Pro with appropriate fallbacks for Chinese and Japanese characters.

⚠️ Fair warning: This is a work in progress! 🚧 It’s currently in use on piperhaywood.com, but there are definitely bugs, particularly when it comes to Gutenberg compatibility. Please feel free to raise an issue if you notice anything weird or have suggestions. Unfortunately I do not have the capacity to provide individualized support, so it is provided as-is for you to work with as you wish.

Installation and updates

I deliberately do not list this theme in the WordPress theme library because I do not have capacity to go through and maintain that process. As such, installation and all updates must be done manually as described below.

To install the theme, compress the compiled theme folder /commonplace-theme and upload that ZIP file in the WordPress theme management page. Alternatively, the ZIP file can be manually uploaded via your hosting dashboard such as cPanel or FTP/SFTP. For further instructions, see the WordPress documentation page Using Themes.

Shortcodes

The shortcode [notebooksearch] displays a search form.

The shortcode [notebookindex] displays an alphabetical index of terms. The Index shortcode can be passed attributes that modify the included taxonomies, the post count threshold, and whether or not year archive links are displayed. For example, [notebookindex taxonomy="category" years="false" count="2"] will pull through only categories with a post count of at least 2 and no year archive links. If no attributes are passed to the notebookindex shortcode, then these default attributes will be used: [notebookindex taxonomy="post_tag, category, post_format" years="true" count="1"].

The shortcode [notebooklist] displays a chronological list of posts.

Utility classes

See the /css/_utility.scss styles for utility classes. The classes that can be useful for content editing are described below.

.hidden sets the element to display: none;. Do NOT use that class if it is an important UI element like a form label; instead, use the .visuallyhidden class for accessibility.

.screenshot will give an element a bit of a box shadow, similar to what a window looks like on a Mac. It can be useful for displaying screenshots.

.pixels should be used on pixel art images to render with crisp edges.

.thumbs should be used on wrapper elements that contain a series of thumb-like images. If you add the class .thumbs--with-border to this wrapper, the images will be given a solid grey border.

.smallcaps can be used to set text in small caps.

.mocking can be used for sarcastic or mocking text, the sort of thing might NoRMaLy wRItE LIkE tHiS if you didn’t have this class.

.discreet-links can be used to make links discreet (only underline on hover).

.notes and .small can be used for small text.

Plugins & Extras

This theme integrates the plugin Related Posts By Taxonomy. This plugin was previously an optional add-on, but I have since incorporated it in to the theme since the plugin itself is no longer actively maintained. Related posts generated by this plugin are displayed using the same styles as the [notebooklist] shortcode.

This theme uses Prism for syntax highlighting.

Development

To use this theme in a development environment locally, install WordPress in a separate directory (as in, not within this repo). You can use this multi-environment wp-config.php gist, or Local by Flywheel can help. Once you have WordPress set up, symlink the theme folder /commonplace-theme within this repo in to your new local WordPress site’s /wp-content/themes directory.

Note that you use the same symlink approach to hook the theme up to multiple WordPress installations. This can be useful for testing your styles against different content. For example, I maintain one site with an environment and content that reflects piperhaywood.com, and another that uses WordPress’s theme testing database.

At this point, run npm i from the root of this repo to install dependencies. Run gulp to build the theme or gulp dev for development. The command gulp dev will compile the files and then use BrowserSync for live reloading. To set a BrowserSync proxy other than the default, run gulp dev --proxy custom-proxy (replace custom-proxy).

Notes

The build borrows significantly from my Notebook theme. I’ve opted to be pretty opinionated with the base styles, and then individual components like the menu in the header or the archive list are given classes and styled separately. The classes are a little wild currently, an amalgamation of a few different styles. I’m hoping to streamline them soon. WordPress-specific styles are confined to the wp namespaced CSS files. These styles cover the craziness that Gutenberg and the classic editor can spit out. I’m 100% sure I haven’t caught every eventuality that can arise, so that’s an ongoing task.

commonplace-wp-theme's People

Contributors

piperhaywood avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

commonplace-wp-theme's Issues

Hook up new fonts

This will happen after advised by Bec. Should also consider the appropriate fonts for languages with non-Latin alphabets.

Add guidance to docs

Changing fonts, most appropriate image sizes, managed WP hosting (sustainable data centers? also, constantly being on up-to-date PHP is better for energy usage), etc.

Recommended plugins incl. Wordfence, server caching, related, etc.

throttling bots helps with energy usage

Consider visual flag for images w/o alt text

It’s so common for ppl not to add alt text to their images... Could do something simple to flag images w/o alt text to logged in editors (blur the image, put a red border around the image, etc.)

Consider slideshow block

Or gallery setting? Not sure.

At any rate, this would be useful for Work pages for a lot of people, and probably on certain posts.

Consider a "hide media" setting

If you’re on a crap internet connection, want to save on mobile bandwidth, or just don’t want to use as much energy, you might want to hide images on a website. Could we make this an option, either w/in the theme settings or exposed to the user?

Consider alphabetical anchor links on index

Suggestion by Bec: Could be nice to have alphabetical anchor links on the index! Hurdles include:

  • If the index is just a shortcode as it currently is, this means it could be used anywhere (on a page, on a post, etc.). If this is the case, we probably can’t place this where the page title would normally go, even though that would look nicest. Way around this would be to make the Index its own, permanent page, but this would reduce flexibility.
  • What if the language is not using latin characters? TBH this is a problem with the existing index as well so will raise an issue for it.

Improve search input

make it a bit friendlier. placeholder text? keyline to left of search button?

Fun possibility: Pile of images on list

When we were messing with the theme, SB did this cool experiment. Set .post-index__post-item to display: contents and .post-item__image to position:sticky, resulted in this pile of images being moved from bottom to top of page as you scroll.

Could be a fun thing to explore, but note that you should not implement it exactly as written above due to probable accesibility issues.

Add “Drafts” shortcode

IDK, I just want it, could be cool.

This came about kinda off the back of coming across AZL’s Cocoon page. I’ve got about 114 drafts, some of which I’d like to revisit but haven’t had the chance to. Would be curious even to just put the titles out there.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.