Skip to content

Commit

Permalink
Merge Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pattyok committed Oct 12, 2022
1 parent d5a2a7e commit f8ccd86
Show file tree
Hide file tree
Showing 25 changed files with 503 additions and 2,155 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# carkeek-blocks

Blocks plugin for Carkeek Based Theme.
Based on resources from Gutenberg Blocks for WordPress and React Developers (Udemy)
https://github.com/alialaa/gutenberg-course-blocks/branches/

## NPM Version
`nvm use 10`

## Uses @wordpress/create-block
Refer to the documentation for help with build processes.
https://developer.wordpress.org/block-editor/reference-guides/packages/packages-create-block/

## To Run

`npm run watch`
`npm start`
Will build and watch files.

`npm run bundle`
`npm run build`
Makes a production ready bundle

## Other notes
Expand Down
204 changes: 204 additions & 0 deletions build/blocks/custom-archive/block.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"name": "carkeek-blocks/custom-archive",
"title": "Custom Post Type Archive",
"category": "carkeek-category",
"description": "Block showing the latest items by post type.",
"keywords": [
"archive",
"posts",
"list"
],
"version": "1.0.0",
"textdomain": "carkeek-blocks",
"attributes": {
"numberOfPosts": {
"type": "number",
"default": 3
},
"honorStickyPosts": {
"type": "boolean",
"default": false
},
"postTypeSelected": {
"type": "string",
"default": "post"
},
"displayPostExcerpt": {
"type": "boolean",
"default": true
},
"displayFeaturedImage": {
"type": "boolean",
"default": true
},
"imageOrientation": {
"type": "string",
"default": "landscape"
},
"openAsModal": {
"type": "boolean",
"default": false
},
"postLayout": {
"type": "string",
"default": "grid"
},
"columns": {
"type": "number",
"default": 3
},
"columnsMobile": {
"type": "number",
"default": 1
},
"columnsTablet": {
"type": "number",
"default": 3
},
"limitItemsMobile": {
"type": "boolean",
"default": false
},
"itemsMobile": {
"type": "number",
"default": 1
},
"itemsTablet": {
"type": "number",
"default": 3
},
"sortBy": {
"type": "string",
"default": "date"
},
"sortByMeta": {
"type": "string",
"default": ""
},
"order": {
"type": "string",
"default": "ASC"
},
"excerptLength": {
"type": "number",
"default": 25
},
"filterByTaxonomy": {
"type": "boolean",
"default": false
},
"groupListings": {
"type": "boolean",
"default": false
},
"groupTaxSelected": {
"type": "string",
"default": ""
},
"groupHideParents": {
"type": "boolean",
"default": false
},
"groupHideEmpty": {
"type": "boolean",
"default": false
},
"taxonomySelected": {
"type": "string",
"default": ""
},
"taxTermsSelected": {
"type": "string",
"default": ""
},
"taxQueryType": {
"type": "string",
"default": "AND"
},
"hideIfEmpty": {
"type": "boolean",
"default": true
},
"emptyMessage": {
"type": "string",
"default": "No posts found."
},
"useHeadingTitle": {
"type": "boolean",
"default": false
},
"headlineLevel": {
"type": "number",
"default": 2
},
"showPublishDate": {
"type": "boolean",
"default": false
},
"showPagination": {
"type": "boolean",
"default": false
},
"showTerms": {
"type": "boolean",
"default": false
},
"publishDateLocation": {
"type": "string",
"default": "below"
},
"publishDatePrefix": {
"type": "string",
"default": ""
},
"showLearnMoreLink": {
"type": "boolean",
"default": false
},
"learnMoreLinkTitle": {
"type": "string",
"default": "Learn More"
},
"imageSize": {
"type": "string",
"default": "default"
},
"newWindow": {
"type": "boolean",
"default": false
},
"addlContentBefore": {
"type": "string",
"default": ""
},
"addlContentAfter": {
"type": "string",
"default": ""
},
"blockId": {
"type": "string"
},
"align": {
"type": "string",
"default": ""
},
"className": {
"type": "string",
"default": ""
}
},
"supports": {
"align": [
"wide",
"full",
"left",
"center",
"right"
],
"anchor": false,
"spacing": true
},
"editorScript": "file:./index.js"
}
1 change: 1 addition & 0 deletions build/blocks/custom-archive/index.asset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php return array('dependencies' => array('lodash', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-editor', 'wp-element', 'wp-i18n'), 'version' => '8e2d4f011e64d0a6e148');
1 change: 1 addition & 0 deletions build/blocks/custom-archive/index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions build/blocks/custom-archive/index.js

Large diffs are not rendered by default.

134 changes: 134 additions & 0 deletions build/blocks/custom-archive/style-index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@

.ck-custom-archive-headline {
text-align: center;
}

.wp-block-carkeek-blocks-custom-archive {


& .ck-custom-archive-image-link {
position: relative;
display: block;
margin-bottom: var(--ck-archive-image-text-gap);

&.layout-square {
--ck-archive-image-ratio: 100%;
}

&.layout-portrait {
--ck-archive-image-ratio: 150%;
}

&.layout-portrait-43 {
--ck-archive-image-ratio: 133%;
}

&.layout-landscape-34 {
--ck-archive-image-ratio: 75%;
}

&::after {
display: block;
width: 100%;
content: "";
padding-bottom: var(--ck-archive-image-ratio);
}

& img {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
object-fit: cover;
object-position: 50% 50%;
}

}

&.is-grid {

& .ck-columns__wrap {
flex-wrap: wrap;
}

& .archive-entry {
display: flex;
flex-direction: column;
}
}

&.is-list {

& .ck-custom-archive-item {
display: flex;
flex-direction: column;
margin-bottom: var(--ck-column-gap-vert);
}

& .ck-custom-archive-image-link {
width: 100%;
}
}

& .ck-custom-archive-more-link {
display: block;
margin-top: 1rem;
}

&.group-hide-parents {

& .ck-archive-tax-header.level-0 {
display: none;
}
}
}

.ck_pagination {

& ul {
list-style: none;
margin: 0;
padding: 0;
display: flex;

& li {

& a {
padding: 5px 10px;
}

& .current {
padding: 5px 10px;
background-color: var(--color-link);
color: #fff;
}

}
}
}

@media (--tablet-up) {

.wp-block-carkeek-blocks-custom-archive {

&.is-list {

& .ck-custom-archive-item {
flex-direction: row;
}

& .ck-custom-archive-image-link {
flex: 1 1 33%;
margin-right: var(--ck-archive-image-text-gap);
margin-bottom: 0;
align-self: flex-start;
}

& .ck-custom-archive__content-wrap {
flex: 1 1 67%;
}
}
}
}

Loading

0 comments on commit f8ccd86

Please sign in to comment.