creativecommons / creativecommons-base Goto Github PK
View Code? Open in Web Editor NEWBase WordPress theme for Creative Commons websites.
Home Page: https://opensource.creativecommons.org/creativecommons-base/
License: MIT License
Base WordPress theme for Creative Commons websites.
Home Page: https://opensource.creativecommons.org/creativecommons-base/
License: MIT License
We have some minor changes that we would like to release.
The footer area currently contains hard-coded structure and information including:
Rather than hard-coding that information, consider allowing content editors to use generic WordPress blocks to structure the page footer. This could open up possibilities to not only changing the content but also the layout of the footer without requiring a designer or developer.
Not only does WordPress 5.8 support block-based widget layout, it also helps users to create higher-level widget combinations, such as a "social media links" icon row.
The creativecommons-base
theme currently defines theme configuration forms and templates for two specific components:
However, the hard-coded nature of these templates may be inflexible while introducing a maintenance burden to the project.
Consider creating two generic theme block areas, such as below_header
and above_footer
wherein we can place Gutenberg blocks. For example, there can be a separate project for CC-specific Gutenberg blocks such as a Donation Appeal Block and a Featured Content Card block.
WordPress 5.8 allows developers to define template regions that can contain Gutenberg blocks.
When tried to upload this theme to wordpress, it gives an error in functions.php
. Tried in localhost.
The files that have been linked have different names, they need to be updated in functions.php
Split from PR #75
Related issue: #69 (due to abandoned dependency causing error below)
I am unable to install the package dependencies in composer.json due to incompatibilities.
Your lock file does not contain a compatible set of packages. Please run composer update.
|
| Problem 1
| - doctrine/inflector is locked to version v1.2.0 and an update of this package was not requested.
| - doctrine/inflector v1.2.0 requires php ^7.0 -> your php version (8.0.7) does not satisfy that requirement.
| Problem 2
| - doctrine/inflector v1.2.0 requires php ^7.0 -> your php version (8.0.7) does not satisfy that requirement.
| - felipelavinz/queulat v2019.4.2 requires doctrine/inflector v1.2.* -> satisfiable by doctrine/inflector[v1.2.0].
| - felipelavinz/queulat is locked to version v2019.4.2 and an update of this package was not requested.
composer install
Project dependencies would install correctly without conflict.
The breadcrumb is being rendered twice:
The breadcrumb should only render once. The breadcrumb should be aligned with the overall theme container, rather than right against the edge of the screen.
Remove the project dependency on Queulat.
The project depends on a WordPress development framework called Queulat. The Queulat framework has some possible shortcomings
Before making the decision whether to deprecate Queulat, it is good to
Queulat is used to
Use standard WordPress functions to define the theme options forms
Use conventional WordPress code to define metaboxes.
Queulat is used in the following files:
creativecommons-base/inc/settings.php
Lines 2 to 11 in 39e7252
creativecommons-base/inc/metaboxes.php
Lines 2 to 5 in 39e7252
creativecommons-base/composer.json
Lines 12 to 17 in 39e7252
Avoid adding new plugins to this theme, particular those with premium extensions or features.
The vue-eslint rule that restricts mixing vue-for and vue-if was broken in the sidebar component.
The screenshot below captures the error
Our docker-compose.yml
currently uses a deprecated link
definition to allow for inter-container communication.
Replace the link
with a user-defined network configuration in our docker-compose.yml
.
The project does not currently include instructions for setting up a development environment.
Add some developer "getting started" steps so it is easy to get the project running locally. Further, a Dockerfile and docker-compose.yml can make it as easy as running docker-compose up
to get started developing.
If it is useful, include a devcontainer
configuration to run the development server with all requirements.
It is useful to run the project locally when developing so that you can see the results of changes.
💡 One approach would be to add a develop/
subdirectory in this project with several files:
Below are some work-in-progress files that are not yet ready to commit to a new branch.
version: '3'
services:
wp:
image: wordpress:latest # https://hub.docker.com/_/wordpress/
ports:
- ${IP}:80:80 # change ip if required
volumes:
- ./config/php.conf.ini:/usr/local/etc/php/conf.d/conf.ini
- ./wp-app:/var/www/html # Full wordpress project
#- ./plugin-name/trunk/:/var/www/html/wp-content/plugins/plugin-name # Plugin development
- ./:/var/www/html/wp-content/themes/creativecommons-base # Theme development
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_NAME: "${DB_NAME}"
WORDPRESS_DB_USER: root
WORDPRESS_DB_PASSWORD: "${DB_ROOT_PASSWORD}"
depends_on:
- db
links:
- db
wpcli:
image: wordpress:cli
volumes:
- ./config/php.conf.ini:/usr/local/etc/php/conf.d/conf.ini
- ./wp-app:/var/www/html
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_NAME: "${DB_NAME}"
WORDPRESS_DB_USER: root
WORDPRESS_DB_PASSWORD: "${DB_ROOT_PASSWORD}"
depends_on:
- db
- wp
pma:
image: phpmyadmin/phpmyadmin
environment:
# https://docs.phpmyadmin.net/en/latest/setup.html#docker-environment-variables
PMA_HOST: db
PMA_PORT: 3306
MYSQL_ROOT_PASSWORD: "${DB_ROOT_PASSWORD}"
ports:
- ${IP}:8080:80
links:
- db:db
db:
image: mysql:latest # https://hub.docker.com/_/mysql/ - or mariadb https://hub.docker.com/_/mariadb
ports:
- ${IP}:3306:3306 # change ip if required
command: [
'--default_authentication_plugin=mysql_native_password',
'--character-set-server=utf8mb4',
'--collation-server=utf8mb4_unicode_ci'
]
volumes:
- ./wp-data:/docker-entrypoint-initdb.d
- db_data:/var/lib/mysql
environment:
MYSQL_DATABASE: "${DB_NAME}"
MYSQL_ROOT_PASSWORD: "${DB_ROOT_PASSWORD}"
volumes:
db_data:
file_uploads = On
memory_limit = 500M
upload_max_filesize = 30M
post_max_size = 30M
max_execution_time = 600
IP=127.0.0.1
DB_ROOT_PASSWORD=password
DB_NAME=wordpress
Currently, in the docs directory, we do not have a coding standard enforced, so it is difficult to maintain code consistency.
I want to add the two npm modules eslint and prettier to the project as well as a script to automate linting and code formatting.
The navigation menu is not visible due to the text being white on a white background:
main navigation
menu locationMenu text should be visible and have a high degree of contrast. The menu text should use the default font color, which is a shade of grey.
composer gives the following warning:
Package jakub-onderka/php-parallel-lint is abandoned, you should avoid using it. Use php-parallel-lint/php-parallel-lint instead.
Use php-parallel-lint/php-parallel-lint instead
We have a small bugfix release prepared and need to deploy those changes to production.
Not only do we have some dependency conflicts (#76), we also have some warnings about abandoned dependencies:
Package anahkiasen/underscore-php is abandoned, you should avoid using it. No replacement was suggested.
Package patchwork/utf8 is abandoned, you should avoid using it. Use symfony/polyfill-mbstring or symfony/string instead.
Determine how best to upgrade and clean our project dependencies.
To test out emails it is also recomended to add a system like mailhog so you read the email on our local development instance without actual sending email by an outgoing smtp server.
Then you you the internal sendmail protocol to send it locally
Our default layout currently displays a sidebar. The sidebar renders a page list where the pages are children of the parent:
Lines 18 to 36 in f49ec2a
However, having the sidebar doesn't allow Gutenberg blocks to display full-width.
Determine how best to handle the sidebar menu, such as
We already compile most (if not all) of Bulma into vocabulary-styles
. Adding Bulma CDN to projects with vocabulary-styles
makes the CSS redundant and a tard annoying to work through problems involving the CSS.
cc @brylie
Currently, the default page template has a container
class that adds 24px of the bottom margin. This causes an empty white bar to appear between the page content and the footer.
We added the content
class with the idea that it would cause typical HTML elements to behave as expected since Bulma contains a minireset.css
that removes HTML default styles like margin and padding.
It is worth considering that our page template already defines main-content
and entry-page-content
elements that may make the Bulma content
class unnecessary in that context.
main-content
and entry-page-content
classesThis project currently defines come custom post behavior for video and gallery posts. In order to define some of the custom post functionality, we use the Queulat project, which we have agreed to deprecate (#69). The project roadmap has now shifted to focus on replacing functionality built with Queulat.
Rather than re-create a custom-code solution for video and gallery posts, we should use the WordPress Gutenberg editor. The Gutenberg editor essentially allows content editors to create arbitrary post types, including video embeds and photo galleries.
There would be several benefits of using Gutenberg
One alternative would be to continue to define custom post types. Defining our own custom post types means we need to maintain unnecessary code. It also limits the creative possibilities of content managers.
Gutenberg editor was released in 2018 with WordPress 5.0.
Split from #93
@alainseys made the excellent recommendation that we use GitHub actions to test our Docker images. GitHub actions can be triggered by pull requests and can be used as part of the approval process.
We have 2000 minutes a month on the free plan, with additional minutes billed as described on the GitHub billing page.
In contribute.md under the heading Recommended Setup for WordPress Coding Standards in item 3 titled Confirm Installation the suggested PATH
will not work with linux Ubuntu 20.04 distribution. Instead this one below works:
export PATH="$HOME/.config/composer/vendor/bin:$PATH"
composer
to install the php code sniffer
instead of creating a .composer
folder for the configs the system created a .config/composer
directory. The differences in the installation procedure might be either due to differences in OS or its coming up because of updates.Prospective contributors are not advised to run composer install
after project setup so as to install package dependencies
In addition to that contributors should be informed that the dependency Quelat
will not load automatically despite being a mu-plugin
and advised how to proceed. I personally used the composer auto-loader
.
I recommend we update contribute.md
and add that detail so as to ensure faster on-boarding of linux Ubuntu contributors.
Edit the docs where there is a problem area, by just adding a statement detailing what would work for Ubuntu users and also by enriching the docs' content so as to make it more intuitive.
Our composer.json
contains a requirement for felipelavinz/queulat
.
creativecommons-base/composer.json
Lines 23 to 25 in 1ca33ae
Under the repositories
section, we have configured a fork of the queulat
package.
creativecommons-base/composer.json
Lines 12 to 17 in 1ca33ae
For some reason, the queulat
dependency does not seem to be installing, since the felipelavinz
directory is empty after running composer install
, despite the message indicating the archive was extracting:
- Installing felipelavinz/queulat (v2019.4.2): Extracting archive
composer install
felipelavinz/
directorycreativecommons/queulat/
directory (from VCS)creativecommons/queulat
project does not seem to have been clonedThe queulat
dependency would install correctly either from
felipelavinz/queulat
orcreativecommons/queulat
Regardless of whether we decide to deprecate Queulat (#69) it would be useful if the dependency would install correctly.
Please add HTML Comments around the WordPress HTML we want to use other places. These places include:
This will allows us to extract the header and footer so that they can be updated automatically based on the live header and footer instead of being edited manually in each project.
(Please replace this text with any related links.)
We would like to unify our static documentation deployment to use GitHub Pages.
This project is currently configured to be deployed by Netlify. We would like to use fewer tools related to documentation deployment and want to use GitHub Pages as the primary solution.
Whenever we do a simple yarn install then bugs are reported while when we do a npm install nos uch bugs are found.
Until recently, almost every Git repository had a default branch named "master". But thankfully, as part of a movement to make the tech industry more inclusive and open, many software teams and open source projects are moving away from this unhealthy naming.
We could leave the master
branch as-is. However, renaming the branch is relatively easy and would be consistent with other repos in the CC org.
would it not be intresting to add a slack channel to github so we can chat while working on issues ?
Add a Slack button to the project README that links to our Slack sign up page:
https://slack-signup.creativecommons.org/
That way other contributors can join the conversation.
creativecommons-base
still uses the old vocabulary imports. We have since separated the vocabulary project into three distinct projects and have published these 3 packages individually.
Update the CDN imports to use the respective latest versions.
Do nothing
We are enabling Gutenberg to control page layout as part of #130
Consider making the Gutenberg full-width template the default. The current default layout contains a sidebar, which may be deprecated in #132
page.php
to template-sidebar.php
template-no-sidebar.php
to page.php
Most of the Figma mockups don't contain a sidebar menu so the menu should not be the default template.
At some point, we may need to define custom Gutenberg blocks for some of the desired design elements from our Figma mockups. In that case, we may need inspiration or code from other open-source Gutenberg block libraries. One such library is the CoBlocks project, which is fully open-source (no "pro" or "VIP" version.)
If/when it becomes relevant, review the components and source code for CoBlocks project to determine how the components or architecture might be adopted to serve the needs of CC.
It may also be worth researching other fully open-source Gutenberg component libraries.
By default, WordPress pages have a title. Typically, the page title is hard-coded into the template to define the desired layout. However, the Gutenberg editor also has a "post title" block that allows the content editor to control the placement of the page title. In some cases, we may want to have a pre-defined placement for the page heading, but in others, such as the Home Page, we want to let the user control the placement with the Gutenberg editor.
Determine whether the default page template should have a hard-coded heading placement. If so, create a new template for full control of page layout with Gutenberg's editor. If not, rename the default template to something like "page with static heading" and duplicate the code without the heading part as the default page template.
It would be useful to understand what the most common use case would be. I.e., will it be more common for content managers to want to control the placement of the page heading, or is the hard-coded placement desired in most cases? The default template should probably cover most cases, where the content editors would use a secondary template for more rare cases.
I'm getting error while going to use this theme
Activate the theme and i can modify based on my preference.
Fatal error: Class 'Queulat\Metabox' not found
Screenshot : https://prnt.sc/t8ikzv
We recently switched to using GitHub pages for hosting static documentation for this project. Now that GitHub pages is enabled, there are a few minor housekeeping and bug fixing tasks.
We want to preserve all content from the previous Gridsome project while removing any Gridsome-specific boilerplate/configuration.
/docs/README.md
/docs/
root directory
/docs/content/*
-> /docs/
docs/data/settings.json
/assets/**
folder while removing any unused elements/assets/img/CC-theme-base.svg
) via a theme configuration variable/docs/.editorconfig
/docs/.eslintrc.js
/docs/.gitignore
/docs/.prettierrc.js
/docs/gridsome.config.js
/docs/gridsome.server.js
/docs/netlify.toml
/docs/package.json
/docs/data/
directory/docs/content/
directory (after moving content markdown files)/docs/src/
directory after moving content from /docs/src/pages/index.vue
to /docs/README.md
Netlify and Gridsome add unnecessary complexity to this relatively simple static documentation site. The main idea here is to remove unnecessary complexity while preserving the essential content and functionality of the creativecommons-base
documentation site.
We want to find the source code for this documentation: https://cc-wp-theme-base.netlify.app/getting-started
We want to ensure the source code is within a CC repository, so that it can be evolved as a developer and/or user guide over time.
Merge the docs
branch into main
to make it easier to find the documentation.
We have completed template designs for all pages on CreativeCommons.org:
https://www.figma.com/file/K6kbDVsx4Zpluhd52yEdDB/Mockups?node-id=1503%3A0
We need to review each of these template designs and determine which ones should be added to the Base theme, and which one to the Child theme for CC.org.
Note, this issue may be updated to include similar listings for other CC sites under construction, such as Certs and CCGN
Release a new version
v
(ex. v0.1.0
)
0.1.0
)
composer.json
readme.txt
Our theme currently has a hard-coded layout for the page content area, whereby the layout is specified in columns with column width. For example, there is a sidebar of three columns and a content area of eight columns. The hard-coded layout means that Gutenberg content cannot display full-width.
Remove hard-coded columns in page content areas so that Gutenberg can be used as a page builder.
The icon in the footer donate button needs to be updated to use the cc-letterheart-filled icon.
Update footer.php and component class if needed
Original Issue: creativecommons/vocabulary#589
We don't currently have a list of CC websites that use creativecommons-base as a base theme.
Add a list of all CC websites that use creativecommons-base as a base theme to the project README
The following table shows Creative Commons WordPress projects and indicates whether the theme inherits from creativecommons-base
. The table will be used as the basis for the final list of projects inheriting from creativecommons-base
and includes negative cases for thoroughness.
The following themes inherit from creativecommons-base
:
Project | is child-them | not child-theme |
---|---|---|
certificate | ✔️ | |
commoners | ✔️ | |
new-creativecommons.org | ✔️ | |
open4us.org | ✔️ | |
openpolicynetwork.org | ✔️ | |
sotc-2016-wordpress | ✔️ | |
wp-theme-cc-chapter | ✔️ | |
wp-theme-cc-commoners | ✔️ | |
wp-theme-cctoolkit | ✔️ | |
wp-theme-openglam | ✔️ | |
wp-theme-summit | ✔️ | |
wp-theme-creativecommons.org | ✔️ |
This is related to the possibility of deprecating Queulat (#69), on which this base theme depends.
@TimidRobot and I were debugging some composer issues on the new certificate server and noticed a discrepancy between the repo name and the composer metadata. One is wp-theme-base
, one is wp-base-theme
:
This is a good opportunity to rename the repository to something else, as described in this issue (private repo).
We will need to think about the consequences of renaming—what site(s) could break, what projects that reference this theme would need to be renamed, etc.
We have agreed to create an "umbrella" project to combine WordPress themes/plugins related to the creativecommons.org project. The new project repository will primarily consist, at first, of development instructions and environment.
Move or duplicate the developer environment/instructions from this project to the new creativecommons/project_creativecommons.org.
We need to get permission from previous contributors, to the development tooling, to make sure it is alright for us to relicense their work under MIT.
The Post_Metabox
is currently defined using the Queulat
package.
Since we have established a consensus to deprecate the Queulat package, we need to re-create the Post_Metabox
using conventional WordPress code.
Post_Metabox
Post_Metabox
using conventional WordPress codeDevelopers currently need to have Composer installed globally on their computers in order to develop this theme.
Installing Composer within the development container would mean fewer development dependencies. Further, the containerized Composer could install the composer dependencies automatically at build time.
Determine how to install Composer within the development container and then run the composer install
command during the image build.
The development container currently uses MySQL. However, our production systems tend to use MariaDB.
Change the db
layer in the docker-compose.yml
to use MariaDB image. Make sure the WordPress layer can still connect to the database.
The repository root is currently cluttered by a mix of theme files and project metadata (editor config, license, code of conduct, etc.).
Move all theme files to a theme/
subdirectory. That would make the repository root a bit cleaner and separate metadata from the theme files. Likewise, the docs/
subdirectory will soon contain theme documentation that we don't want to publish with the theme (#67)
We would need to understand how this theme is intended to be published and included in the CC website deployments. We would only want to include the contents of theme/
in the deployed version of this project.
Check for WordPress main classes $wp_scripts & $wp_styles to use them in a custom WP-API endpoint. the goal is to gather styles and script dependencies to be available to use on licenses, FAQ and others non-WordPress websites
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.