From 48d58d784193a343a4c3fc75f0b3ee83f780b950 Mon Sep 17 00:00:00 2001 From: Cory Hughart Date: Wed, 27 Jul 2022 23:01:33 -0400 Subject: [PATCH 01/33] new template-part folder for "tags", aka template-tags in template-part format, date tag --- template-parts/tag/date.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 template-parts/tag/date.php diff --git a/template-parts/tag/date.php b/template-parts/tag/date.php new file mode 100644 index 0000000..9d34087 --- /dev/null +++ b/template-parts/tag/date.php @@ -0,0 +1,28 @@ + 'span', + 'format' => '', +); + +$args = wp_parse_args( $args, $defaults ); + +$time_string_template = ''; +$time_string = sprintf( + $time_string_template, + esc_attr( get_the_date( DATE_W3C ) ), + esc_html( get_the_date( $args['format'] ) ), +); +?> + +< class="tag-date"> + + +> From 9b4018fb7608d98b9f9b64c35c7a0dc3458d9abd Mon Sep 17 00:00:00 2001 From: Cory Hughart Date: Wed, 27 Jul 2022 23:02:13 -0400 Subject: [PATCH 02/33] term-list tag with taxonomy and linked options --- template-parts/tag/term-list.php | 44 ++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 template-parts/tag/term-list.php diff --git a/template-parts/tag/term-list.php b/template-parts/tag/term-list.php new file mode 100644 index 0000000..f1d2b4e --- /dev/null +++ b/template-parts/tag/term-list.php @@ -0,0 +1,44 @@ + 'post_tag', + 'element' => 'span', + 'linked' => true, +); + +$args = wp_parse_args( $args, $defaults ); + +$term_list = ''; +if ( $args['linked'] ) { + $term_list = get_the_term_list( get_the_ID(), $args['taxonomy'], '', esc_html__( ', ', 'davidwilkinson' ), '' ); +} else { + $terms = get_the_terms( get_the_ID(), $args['taxonomy'] ); + if ( is_array( $terms ) && $terms[0] instanceof WP_Term ) { + $terms = wp_list_pluck( $terms, 'name' ); + $terms = array_map( + function( $term ) { + return sprintf( '%s', $term ); + }, + $terms + ); + $term_list = implode( ', ', $terms ); + } +} + +if ( $term_list ) : + ?> + +< class="tag-term-list" data-taxonomy=""> + + +> + + Date: Wed, 27 Jul 2022 23:16:24 -0400 Subject: [PATCH 03/33] missed a :focus in previous release --- src/styles/modules/_menu-toggle.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/styles/modules/_menu-toggle.scss b/src/styles/modules/_menu-toggle.scss index c27e032..1db06a2 100644 --- a/src/styles/modules/_menu-toggle.scss +++ b/src/styles/modules/_menu-toggle.scss @@ -87,7 +87,8 @@ $color: theme.get-var( 'theme-colors', 'foreground' ); } // Expanded hover state. - &:hover { + &:hover, + &:focus { } } } From ea1ef6182923e0a60988c8ad390e1f2351702518 Mon Sep 17 00:00:00 2001 From: Cory Hughart Date: Wed, 27 Jul 2022 23:16:52 -0400 Subject: [PATCH 04/33] add linked option to date tag --- template-parts/tag/date.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/template-parts/tag/date.php b/template-parts/tag/date.php index 9d34087..daabc36 100644 --- a/template-parts/tag/date.php +++ b/template-parts/tag/date.php @@ -10,6 +10,7 @@ $defaults = array( 'element' => 'span', 'format' => '', + 'linked' => false, ); $args = wp_parse_args( $args, $defaults ); @@ -20,9 +21,16 @@ esc_attr( get_the_date( DATE_W3C ) ), esc_html( get_the_date( $args['format'] ) ), ); + +$date_format = $args['linked'] ? '%1$s' : '%1$s'; +$date = sprintf( + $date_format, + $time_string, + esc_url( get_permalink() ) +); ?> < class="tag-date"> - + > From 738d4b127622ba42c8af1cdf503d49d2770d9d39 Mon Sep 17 00:00:00 2001 From: Cory Hughart Date: Wed, 27 Jul 2022 23:18:01 -0400 Subject: [PATCH 05/33] replace date template-tag with template-part --- template-parts/content/entry.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template-parts/content/entry.php b/template-parts/content/entry.php index c08e879..43fcbff 100644 --- a/template-parts/content/entry.php +++ b/template-parts/content/entry.php @@ -20,8 +20,8 @@ if ( 'post' === get_post_type() ) : ?> From e6cf493eac8425ff6baaf9e5ec56aa79fcc83b9f Mon Sep 17 00:00:00 2001 From: Cory Hughart Date: Thu, 28 Jul 2022 07:45:50 -0400 Subject: [PATCH 06/33] author tag with label and link options --- languages/theme-scaffold.pot | 17 ++++++++++++++++- template-parts/tag/author.php | 28 ++++++++++++++++++++++++++++ template-parts/tag/date.php | 4 ++-- template-parts/tag/term-list.php | 6 +++--- 4 files changed, 49 insertions(+), 6 deletions(-) create mode 100644 template-parts/tag/author.php diff --git a/languages/theme-scaffold.pot b/languages/theme-scaffold.pot index 0c97fa0..fa8593a 100644 --- a/languages/theme-scaffold.pot +++ b/languages/theme-scaffold.pot @@ -114,7 +114,7 @@ msgid "by %s" msgstr "" #. translators: used between list items, there is a space after the comma -#: inc/template-tags.php:61 +#: inc/template-tags.php:61, template-parts/tag/term-list.php:20 msgid ", " msgstr "" @@ -168,3 +168,18 @@ msgstr "" #: template-parts/loop/archive-search.php:15 msgid "Search Results for: %s" msgstr "" + +#: template-parts/tag/author.php:13 +msgctxt "post author byline" +msgid "by" +msgstr "" + +#: template-parts/tag/date.php:34 +msgctxt "post date" +msgid "Posted on" +msgstr "" + +#: template-parts/tag/term-list.php:39 +msgctxt "post tags" +msgid "Posted in" +msgstr "" diff --git a/template-parts/tag/author.php b/template-parts/tag/author.php new file mode 100644 index 0000000..2e798cd --- /dev/null +++ b/template-parts/tag/author.php @@ -0,0 +1,28 @@ + 'span', + 'linked' => true, + 'label' => esc_html_x( 'by', 'post author byline', 'theme-scaffold' ), +); + +$byline_format = $args['linked'] ? '%1$s' : '%1$s'; +$byline = sprintf( + $byline_format, + esc_html( get_the_author() ), + esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) +); + +?> + +< class="tag-author"> + + +> diff --git a/template-parts/tag/date.php b/template-parts/tag/date.php index daabc36..90eac32 100644 --- a/template-parts/tag/date.php +++ b/template-parts/tag/date.php @@ -4,7 +4,7 @@ * * Output the post date. * - * @package davidwilkinson + * @package theme-scaffold */ $defaults = array( @@ -31,6 +31,6 @@ ?> < class="tag-date"> - + > diff --git a/template-parts/tag/term-list.php b/template-parts/tag/term-list.php index f1d2b4e..a4155c5 100644 --- a/template-parts/tag/term-list.php +++ b/template-parts/tag/term-list.php @@ -4,7 +4,7 @@ * * Output a list of terms from the post. Taxonomy defaults to `post_tag`. * - * @package davidwilkinson + * @package theme-scaffold */ $defaults = array( @@ -17,7 +17,7 @@ $term_list = ''; if ( $args['linked'] ) { - $term_list = get_the_term_list( get_the_ID(), $args['taxonomy'], '', esc_html__( ', ', 'davidwilkinson' ), '' ); + $term_list = get_the_term_list( get_the_ID(), $args['taxonomy'], '', esc_html__( ', ', 'theme-scaffold' ), '' ); } else { $terms = get_the_terms( get_the_ID(), $args['taxonomy'] ); if ( is_array( $terms ) && $terms[0] instanceof WP_Term ) { @@ -36,7 +36,7 @@ function( $term ) { ?> < class="tag-term-list" data-taxonomy=""> - + > From 42caf81eefa1f0a8d6d2a5de00599abc5de69746 Mon Sep 17 00:00:00 2001 From: Cory Hughart Date: Thu, 28 Jul 2022 08:00:51 -0400 Subject: [PATCH 07/33] add label option to each tag --- template-parts/tag/author.php | 2 +- template-parts/tag/date.php | 3 ++- template-parts/tag/term-list.php | 7 ++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/template-parts/tag/author.php b/template-parts/tag/author.php index 2e798cd..fa88f5d 100644 --- a/template-parts/tag/author.php +++ b/template-parts/tag/author.php @@ -9,8 +9,8 @@ $defaults = array( 'element' => 'span', - 'linked' => true, 'label' => esc_html_x( 'by', 'post author byline', 'theme-scaffold' ), + 'linked' => true, ); $byline_format = $args['linked'] ? '%1$s' : '%1$s'; diff --git a/template-parts/tag/date.php b/template-parts/tag/date.php index 90eac32..8498900 100644 --- a/template-parts/tag/date.php +++ b/template-parts/tag/date.php @@ -10,6 +10,7 @@ $defaults = array( 'element' => 'span', 'format' => '', + 'label' => esc_html_x( 'Posted on', 'post date label', 'theme-scaffold' ), 'linked' => false, ); @@ -31,6 +32,6 @@ ?> < class="tag-date"> - + > diff --git a/template-parts/tag/term-list.php b/template-parts/tag/term-list.php index a4155c5..4d35971 100644 --- a/template-parts/tag/term-list.php +++ b/template-parts/tag/term-list.php @@ -8,9 +8,10 @@ */ $defaults = array( - 'taxonomy' => 'post_tag', 'element' => 'span', + 'label' => esc_html_x( 'Posted in', 'post tags label', 'theme-scaffold' ), 'linked' => true, + 'taxonomy' => 'post_tag', ); $args = wp_parse_args( $args, $defaults ); @@ -36,8 +37,8 @@ function( $term ) { ?> < class="tag-term-list" data-taxonomy=""> - - + + > Date: Thu, 28 Jul 2022 08:06:18 -0400 Subject: [PATCH 08/33] basic styles for author, date, and term-list tags --- src/styles/modules/_tag-author.scss | 0 src/styles/modules/_tag-date.scss | 10 +++++++++ src/styles/modules/_tag-term-list.scss | 30 ++++++++++++++++++++++++++ template-parts/tag/author.php | 1 - 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 src/styles/modules/_tag-author.scss create mode 100644 src/styles/modules/_tag-date.scss create mode 100644 src/styles/modules/_tag-term-list.scss diff --git a/src/styles/modules/_tag-author.scss b/src/styles/modules/_tag-author.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/styles/modules/_tag-date.scss b/src/styles/modules/_tag-date.scss new file mode 100644 index 0000000..1ad8a44 --- /dev/null +++ b/src/styles/modules/_tag-date.scss @@ -0,0 +1,10 @@ +@use '../utilities/accessibility'; + +.tag-date { + display: inline-block; + white-space: nowrap; + + &__label { + @extend .screen-reader-text; + } +} diff --git a/src/styles/modules/_tag-term-list.scss b/src/styles/modules/_tag-term-list.scss new file mode 100644 index 0000000..1079c26 --- /dev/null +++ b/src/styles/modules/_tag-term-list.scss @@ -0,0 +1,30 @@ +@use '../utilities/accessibility'; + +.tag-term-list { + $self: &; + + display: block; + + &__label { + @extend .screen-reader-text; + } + + &__terms { + a, + span { + white-space: nowrap; + } + } + + // Target specific taxonomy (post_tag) with data attribute. + &[data-taxonomy='post_tag'] { + #{$self}__list { + a, + span { + &:before { + content: '#'; + } + } + } + } +} diff --git a/template-parts/tag/author.php b/template-parts/tag/author.php index fa88f5d..f6462f4 100644 --- a/template-parts/tag/author.php +++ b/template-parts/tag/author.php @@ -19,7 +19,6 @@ esc_html( get_the_author() ), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) ); - ?> < class="tag-author"> From fd969c528cc93d75dbdceef62de915f0ccf18983 Mon Sep 17 00:00:00 2001 From: Cory Hughart Date: Thu, 28 Jul 2022 08:10:47 -0400 Subject: [PATCH 09/33] fix author tag args --- languages/theme-scaffold.pot | 12 ++++++------ template-parts/tag/author.php | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/languages/theme-scaffold.pot b/languages/theme-scaffold.pot index fa8593a..f63a194 100644 --- a/languages/theme-scaffold.pot +++ b/languages/theme-scaffold.pot @@ -114,7 +114,7 @@ msgid "by %s" msgstr "" #. translators: used between list items, there is a space after the comma -#: inc/template-tags.php:61, template-parts/tag/term-list.php:20 +#: inc/template-tags.php:61, template-parts/tag/term-list.php:21 msgid ", " msgstr "" @@ -169,17 +169,17 @@ msgstr "" msgid "Search Results for: %s" msgstr "" -#: template-parts/tag/author.php:13 +#: template-parts/tag/author.php:12 msgctxt "post author byline" msgid "by" msgstr "" -#: template-parts/tag/date.php:34 -msgctxt "post date" +#: template-parts/tag/date.php:13 +msgctxt "post date label" msgid "Posted on" msgstr "" -#: template-parts/tag/term-list.php:39 -msgctxt "post tags" +#: template-parts/tag/term-list.php:12 +msgctxt "post tags label" msgid "Posted in" msgstr "" diff --git a/template-parts/tag/author.php b/template-parts/tag/author.php index f6462f4..1c157e6 100644 --- a/template-parts/tag/author.php +++ b/template-parts/tag/author.php @@ -13,6 +13,8 @@ 'linked' => true, ); +$args = wp_parse_args( $args, $defaults ); + $byline_format = $args['linked'] ? '%1$s' : '%1$s'; $byline = sprintf( $byline_format, From 34110f12b95b5a90e5eb4b90f8b86f7b920c9a75 Mon Sep 17 00:00:00 2001 From: Cory Hughart Date: Thu, 28 Jul 2022 08:35:11 -0400 Subject: [PATCH 10/33] use new date and author tag templates in content template parts --- languages/theme-scaffold.pot | 2 +- template-parts/content/entry.php | 4 +--- template-parts/content/excerpt.php | 6 ++---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/languages/theme-scaffold.pot b/languages/theme-scaffold.pot index f63a194..3a8655c 100644 --- a/languages/theme-scaffold.pot +++ b/languages/theme-scaffold.pot @@ -144,7 +144,7 @@ msgstr "" msgid "Edit %s" msgstr "" -#: template-parts/content/entry.php:39, template-parts/content/page.php:28 +#: template-parts/content/entry.php:37, template-parts/content/page.php:28 msgid "Pages:" msgstr "" diff --git a/template-parts/content/entry.php b/template-parts/content/entry.php index 43fcbff..e86be68 100644 --- a/template-parts/content/entry.php +++ b/template-parts/content/entry.php @@ -21,9 +21,7 @@ ?> diff --git a/template-parts/content/excerpt.php b/template-parts/content/excerpt.php index e71e803..0db489f 100644 --- a/template-parts/content/excerpt.php +++ b/template-parts/content/excerpt.php @@ -30,10 +30,8 @@ if ( 'post' === get_post_type() ) : ?>
- + +
Date: Thu, 28 Jul 2022 08:35:37 -0400 Subject: [PATCH 11/33] basic author tag styles --- src/styles/modules/_tag-author.scss | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/styles/modules/_tag-author.scss b/src/styles/modules/_tag-author.scss index e69de29..4f14c93 100644 --- a/src/styles/modules/_tag-author.scss +++ b/src/styles/modules/_tag-author.scss @@ -0,0 +1,10 @@ +@use '../utilities/accessibility'; + +.tag-author { + &__label { + //@extend .screen-reader-text; + } + + &__author { + } +} From a70b52127d89198f592f1a66532f5f34ef6fbc9f Mon Sep 17 00:00:00 2001 From: Cory Hughart Date: Thu, 28 Jul 2022 08:36:19 -0400 Subject: [PATCH 12/33] fix situation where term-list may be WP_Error due to bad taxonomy passed in --- languages/theme-scaffold.pot | 7 ++++++- template-parts/tag/term-list.php | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/languages/theme-scaffold.pot b/languages/theme-scaffold.pot index 3a8655c..499f7fc 100644 --- a/languages/theme-scaffold.pot +++ b/languages/theme-scaffold.pot @@ -114,7 +114,7 @@ msgid "by %s" msgstr "" #. translators: used between list items, there is a space after the comma -#: inc/template-tags.php:61, template-parts/tag/term-list.php:21 +#: inc/template-tags.php:61 msgid ", " msgstr "" @@ -183,3 +183,8 @@ msgstr "" msgctxt "post tags label" msgid "Posted in" msgstr "" + +#: template-parts/tag/term-list.php:21 +msgctxt "term list separator" +msgid ", " +msgstr "" diff --git a/template-parts/tag/term-list.php b/template-parts/tag/term-list.php index 4d35971..7fba78a 100644 --- a/template-parts/tag/term-list.php +++ b/template-parts/tag/term-list.php @@ -18,7 +18,7 @@ $term_list = ''; if ( $args['linked'] ) { - $term_list = get_the_term_list( get_the_ID(), $args['taxonomy'], '', esc_html__( ', ', 'theme-scaffold' ), '' ); + $term_list = get_the_term_list( get_the_ID(), $args['taxonomy'], '', esc_html_x( ', ', 'term list separator', 'theme-scaffold' ), '' ); } else { $terms = get_the_terms( get_the_ID(), $args['taxonomy'] ); if ( is_array( $terms ) && $terms[0] instanceof WP_Term ) { @@ -33,7 +33,7 @@ function( $term ) { } } -if ( $term_list ) : +if ( $term_list && ! is_wp_error( $term_list ) ) : ?> < class="tag-term-list" data-taxonomy=""> From 9eae26b060c574fd760d83aede59c491a11065cc Mon Sep 17 00:00:00 2001 From: Cory Hughart Date: Thu, 28 Jul 2022 08:38:29 -0400 Subject: [PATCH 13/33] remove nebulous footer template tag in favor of explicit taxonomy tag templates --- template-parts/content/entry.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/template-parts/content/entry.php b/template-parts/content/entry.php index e86be68..cf251f1 100644 --- a/template-parts/content/entry.php +++ b/template-parts/content/entry.php @@ -42,6 +42,13 @@
- + + +
From dc0d651029434fb651b2480f581853b2967fbeae Mon Sep 17 00:00:00 2001 From: Cory Hughart Date: Thu, 28 Jul 2022 08:38:40 -0400 Subject: [PATCH 14/33] fix hashtag style --- src/styles/modules/_tag-term-list.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles/modules/_tag-term-list.scss b/src/styles/modules/_tag-term-list.scss index 1079c26..c2a0140 100644 --- a/src/styles/modules/_tag-term-list.scss +++ b/src/styles/modules/_tag-term-list.scss @@ -18,7 +18,7 @@ // Target specific taxonomy (post_tag) with data attribute. &[data-taxonomy='post_tag'] { - #{$self}__list { + #{$self}__terms { a, span { &:before { From 7e211611ffe211a562e787c08ae2f3e9bf8465ed Mon Sep 17 00:00:00 2001 From: Cory Hughart Date: Thu, 28 Jul 2022 09:48:38 -0400 Subject: [PATCH 15/33] comment-link tag --- languages/theme-scaffold.pot | 3 ++- template-parts/content/entry.php | 6 ++---- template-parts/content/excerpt.php | 4 ++++ template-parts/tag/comment-link.php | 33 +++++++++++++++++++++++++++++ 4 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 template-parts/tag/comment-link.php diff --git a/languages/theme-scaffold.pot b/languages/theme-scaffold.pot index 499f7fc..b009f74 100644 --- a/languages/theme-scaffold.pot +++ b/languages/theme-scaffold.pot @@ -135,7 +135,8 @@ msgid "Tagged %1$s" msgstr "" #. translators: %s: post title -#: inc/template-tags.php:81 +#. translators: %s: post title +#: inc/template-tags.php:81, template-parts/tag/comment-link.php:19 msgid "Leave a Comment on %s" msgstr "" diff --git a/template-parts/content/entry.php b/template-parts/content/entry.php index cf251f1..4970b6b 100644 --- a/template-parts/content/entry.php +++ b/template-parts/content/entry.php @@ -43,10 +43,8 @@
- + +
+ +
diff --git a/template-parts/loop/archive.php b/template-parts/loop/archive.php index 57477b9..2954cb2 100644 --- a/template-parts/loop/archive.php +++ b/template-parts/loop/archive.php @@ -24,8 +24,10 @@ get_template_part( 'template-parts/content/excerpt', get_post_type() ); endwhile; - - the_posts_navigation(); ?> + +
+ +
From b68e40b3ccaf1d4ac9bd390e506d9a049a618f05 Mon Sep 17 00:00:00 2001 From: Cory Hughart Date: Thu, 28 Jul 2022 13:10:48 -0400 Subject: [PATCH 21/33] ensure each template part has an existing style module with variations added, add additional comments about usage in template part header --- archive.php | 12 ++++------- languages/theme-scaffold.pot | 12 +++++------ src/styles/modules/_content-entry.scss | 3 +++ src/styles/modules/_content-excerpt.scss | 26 +++++++++++++++++++++++ src/styles/modules/_content-none.scss | 20 +++++++++++++++++ src/styles/modules/_content-page.scss | 3 +++ src/styles/modules/_loop-archive.scss | 12 ++++++----- src/styles/modules/_nav-pagination.scss | 4 ++++ src/styles/modules/_pagination.scss | 3 ++- src/styles/modules/_tag-comment-link.scss | 4 ++++ src/styles/modules/_tag-date.scss | 4 ++++ src/styles/modules/_tag-term-list.scss | 4 ++++ template-parts/content/entry.php | 5 ++--- template-parts/content/excerpt-search.php | 2 ++ template-parts/content/excerpt.php | 2 ++ template-parts/content/none.php | 2 ++ template-parts/loop/archive-search.php | 4 +++- template-parts/loop/archive.php | 2 ++ 18 files changed, 100 insertions(+), 24 deletions(-) create mode 100644 src/styles/modules/_content-excerpt.scss create mode 100644 src/styles/modules/_content-none.scss diff --git a/archive.php b/archive.php index f1ae619..a014662 100644 --- a/archive.php +++ b/archive.php @@ -13,15 +13,11 @@
diff --git a/languages/theme-scaffold.pot b/languages/theme-scaffold.pot index a29e119..9a10a89 100644 --- a/languages/theme-scaffold.pot +++ b/languages/theme-scaffold.pot @@ -145,28 +145,28 @@ msgstr "" msgid "Edit %s" msgstr "" -#: template-parts/content/entry.php:37, template-parts/content/page.php:28 +#: template-parts/content/entry.php:36, template-parts/content/page.php:28 msgid "Pages:" msgstr "" -#: template-parts/content/none.php:12 +#: template-parts/content/none.php:14 msgid "Nothing Found" msgstr "" -#: template-parts/content/none.php:42 +#: template-parts/content/none.php:44 msgid "It seems we can’t find what you’re looking for. Perhaps searching can help." msgstr "" -#: template-parts/content/none.php:35 +#: template-parts/content/none.php:37 msgid "Sorry, but nothing matched your search terms. Please try again with some different keywords." msgstr "" -#: template-parts/content/none.php:22 +#: template-parts/content/none.php:24 msgid "Ready to publish your first post? Get started here." msgstr "" #. translators: %s: search query. -#: template-parts/loop/archive-search.php:15 +#: template-parts/loop/archive-search.php:17 msgid "Search Results for: %s" msgstr "" diff --git a/src/styles/modules/_content-entry.scss b/src/styles/modules/_content-entry.scss index eb1df17..0ade5b2 100644 --- a/src/styles/modules/_content-entry.scss +++ b/src/styles/modules/_content-entry.scss @@ -15,6 +15,9 @@ &__meta { } + &__content { + } + &__footer { } } diff --git a/src/styles/modules/_content-excerpt.scss b/src/styles/modules/_content-excerpt.scss new file mode 100644 index 0000000..81bb0c7 --- /dev/null +++ b/src/styles/modules/_content-excerpt.scss @@ -0,0 +1,26 @@ +// +// Module: content-excerpt. +// + +.content-excerpt { + &__header { + } + + &__title { + } + + &__meta { + } + + &__content { + } + + &__footer { + } + + // Variations. + + &--search { + @extend .content-excerpt; + } +} diff --git a/src/styles/modules/_content-none.scss b/src/styles/modules/_content-none.scss new file mode 100644 index 0000000..f0250d5 --- /dev/null +++ b/src/styles/modules/_content-none.scss @@ -0,0 +1,20 @@ +// +// Module: content-none. +// + +.content-none { + &__header { + } + + &__title { + } + + &__meta { + } + + &__content { + } + + &__footer { + } +} diff --git a/src/styles/modules/_content-page.scss b/src/styles/modules/_content-page.scss index e8bc390..0d5346e 100644 --- a/src/styles/modules/_content-page.scss +++ b/src/styles/modules/_content-page.scss @@ -12,6 +12,9 @@ &__title { } + &__content { + } + &__footer { } } diff --git a/src/styles/modules/_loop-archive.scss b/src/styles/modules/_loop-archive.scss index 6fcbca7..273fdae 100644 --- a/src/styles/modules/_loop-archive.scss +++ b/src/styles/modules/_loop-archive.scss @@ -1,15 +1,11 @@ // -// Module: content-entry. +// Module: loop-archive. // @use '../tools/context'; @include context.is-front { .loop-archive { - &--search { - @extend .loop-archive; - } - &__header { } @@ -21,5 +17,11 @@ &__footer { } + + // Variations. + + &--search { + @extend .loop-archive; + } } } diff --git a/src/styles/modules/_nav-pagination.scss b/src/styles/modules/_nav-pagination.scss index cb4fac2..8552639 100644 --- a/src/styles/modules/_nav-pagination.scss +++ b/src/styles/modules/_nav-pagination.scss @@ -1,3 +1,7 @@ +// +// Module: nav-pagination. +// + @use '../settings/theme'; @use '../tools/layout'; @use '../utilities/accessibility'; diff --git a/src/styles/modules/_pagination.scss b/src/styles/modules/_pagination.scss index 43b4f62..99952af 100644 --- a/src/styles/modules/_pagination.scss +++ b/src/styles/modules/_pagination.scss @@ -2,8 +2,9 @@ // Module: pagination. // -.comment-navigation, // the_comment_navigation() +.comment-navigation, // the_comments_navigation() .post-navigation // the_post_navigation() +.posts-navigation // the_posts_navigation() { .site-content & { margin: 0 0 1.5em; diff --git a/src/styles/modules/_tag-comment-link.scss b/src/styles/modules/_tag-comment-link.scss index 438253d..5e81450 100644 --- a/src/styles/modules/_tag-comment-link.scss +++ b/src/styles/modules/_tag-comment-link.scss @@ -1,3 +1,7 @@ +// +// Module: tag-comment-link. +// + .tag-comment-link { a { } diff --git a/src/styles/modules/_tag-date.scss b/src/styles/modules/_tag-date.scss index 1ad8a44..0cdebcf 100644 --- a/src/styles/modules/_tag-date.scss +++ b/src/styles/modules/_tag-date.scss @@ -1,3 +1,7 @@ +// +// Module: tag-date. +// + @use '../utilities/accessibility'; .tag-date { diff --git a/src/styles/modules/_tag-term-list.scss b/src/styles/modules/_tag-term-list.scss index c2a0140..7379e46 100644 --- a/src/styles/modules/_tag-term-list.scss +++ b/src/styles/modules/_tag-term-list.scss @@ -1,3 +1,7 @@ +// +// Module: tag-term-list. +// + @use '../utilities/accessibility'; .tag-term-list { diff --git a/template-parts/content/entry.php b/template-parts/content/entry.php index 4970b6b..30d0115 100644 --- a/template-parts/content/entry.php +++ b/template-parts/content/entry.php @@ -2,10 +2,9 @@ /** * Partial: content-entry. * - * This partial is meant for any post type that can by syndicated, meaning + * This partial is meant for any post type that can be syndicated, meaning * timestamped with author information. Note the hAtom classes entry-title and - * entry-content are present, and others are added by the theme_scaffold - * template tags. + * entry-content are present, and others are added by the "tag" template-parts. * * @package theme-scaffold */ diff --git a/template-parts/content/excerpt-search.php b/template-parts/content/excerpt-search.php index e951f79..eeaa1ed 100644 --- a/template-parts/content/excerpt-search.php +++ b/template-parts/content/excerpt-search.php @@ -2,6 +2,8 @@ /** * Partial: content-excerpt, search variation. * + * Used to display a standardized post excerpt in search results. + * * @package theme-scaffold */ diff --git a/template-parts/content/excerpt.php b/template-parts/content/excerpt.php index 661e87a..0caf5a6 100644 --- a/template-parts/content/excerpt.php +++ b/template-parts/content/excerpt.php @@ -2,6 +2,8 @@ /** * Partial: content-excerpt. * + * Used to display a post excerpt in feeds and archives. + * * @package theme-scaffold */ diff --git a/template-parts/content/none.php b/template-parts/content/none.php index 81845b4..6d79c79 100644 --- a/template-parts/content/none.php +++ b/template-parts/content/none.php @@ -2,6 +2,8 @@ /** * Partial: content-none. * + * Displayed when there are no posts in a loop. + * * @package theme-scaffold */ diff --git a/template-parts/loop/archive-search.php b/template-parts/loop/archive-search.php index a8edb19..4b34226 100644 --- a/template-parts/loop/archive-search.php +++ b/template-parts/loop/archive-search.php @@ -1,6 +1,8 @@ Date: Fri, 29 Jul 2022 10:55:12 -0400 Subject: [PATCH 22/33] use same comment to indicate style module variations --- src/styles/modules/_site-navigation.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/styles/modules/_site-navigation.scss b/src/styles/modules/_site-navigation.scss index a8af33f..1b5255a 100644 --- a/src/styles/modules/_site-navigation.scss +++ b/src/styles/modules/_site-navigation.scss @@ -192,7 +192,8 @@ padding-left: 1rem; } - // Footer. + // Variations. + &--footer { @extend %reset; From 2786f34dc37d00ade355c6b8d7da316d5b4b2b6c Mon Sep 17 00:00:00 2001 From: Cory Hughart Date: Fri, 29 Jul 2022 10:58:23 -0400 Subject: [PATCH 23/33] focus on use case of pagination template for archives --- src/styles/modules/_nav-pagination.scss | 8 ++++++++ template-parts/nav/pagination.php | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/styles/modules/_nav-pagination.scss b/src/styles/modules/_nav-pagination.scss index 8552639..2d09ddb 100644 --- a/src/styles/modules/_nav-pagination.scss +++ b/src/styles/modules/_nav-pagination.scss @@ -14,11 +14,15 @@ } &__nav { + } + + &__links { display: flex; gap: theme.get-var( 'sizes', 'gutter' ); justify-content: center; } + // Each item has a `page-numbers` class. .page-numbers { &.current { } @@ -28,5 +32,9 @@ &.next { } + + // Elipsis indicate pages inbetween, not linked. + &.dots { + } } } diff --git a/template-parts/nav/pagination.php b/template-parts/nav/pagination.php index 065b9d7..9a57f46 100644 --- a/template-parts/nav/pagination.php +++ b/template-parts/nav/pagination.php @@ -2,7 +2,7 @@ /** * Partial: nav-pagination. * - * Output numbered pagination links with prev/next for the current query. + * Output numbered pagination links with prev/next for the current archive/feed. * * This template can be used for custom pagination if you pass some options to * `paginate_links_args` if you know the current page and max pages: @@ -33,7 +33,9 @@ From 993c64834efbb6de1d82e2e396f565e42811d196 Mon Sep 17 00:00:00 2001 From: Cory Hughart Date: Fri, 29 Jul 2022 11:02:01 -0400 Subject: [PATCH 24/33] navigation template part for prev/next post links, remove unused pagination style module --- languages/theme-scaffold.pot | 12 ++---- single.php | 7 ---- src/styles/modules/_nav-navigation.scss | 35 ++++++++++++++++++ src/styles/modules/_pagination.scss | 30 --------------- template-parts/content/entry.php | 2 + template-parts/nav/navigation.php | 49 +++++++++++++++++++++++++ 6 files changed, 90 insertions(+), 45 deletions(-) create mode 100644 src/styles/modules/_nav-navigation.scss delete mode 100644 src/styles/modules/_pagination.scss create mode 100644 template-parts/nav/navigation.php diff --git a/languages/theme-scaffold.pot b/languages/theme-scaffold.pot index 9a10a89..1e4d5a9 100644 --- a/languages/theme-scaffold.pot +++ b/languages/theme-scaffold.pot @@ -45,14 +45,6 @@ msgstr "" msgid "Skip to content" msgstr "" -#: single.php:28 -msgid "Previous:" -msgstr "" - -#: single.php:29 -msgid "Next:" -msgstr "" - #: style.css:2 msgid "Theme Scaffold" msgstr "" @@ -170,6 +162,10 @@ msgstr "" msgid "Search Results for: %s" msgstr "" +#: template-parts/nav/navigation.php:19 +msgid "Post navigation" +msgstr "" + #: template-parts/nav/pagination.php:25 msgctxt "pagination label" msgid "Page navigation" diff --git a/single.php b/single.php index 098dde4..2447f36 100644 --- a/single.php +++ b/single.php @@ -23,13 +23,6 @@ // If post type is not hierarchical, it should probably be displayed as an entry. get_template_part( 'template-parts/content/entry', get_post_type() ); - the_post_navigation( - array( - 'prev_text' => '' . esc_html__( 'Previous:', 'theme-scaffold' ) . ' %title', - 'next_text' => '' . esc_html__( 'Next:', 'theme-scaffold' ) . ' %title', - ) - ); - /* // If comments are open or we have at least one comment, load up the comment template. if ( comments_open() || get_comments_number() ) : diff --git a/src/styles/modules/_nav-navigation.scss b/src/styles/modules/_nav-navigation.scss new file mode 100644 index 0000000..99a2426 --- /dev/null +++ b/src/styles/modules/_nav-navigation.scss @@ -0,0 +1,35 @@ +// +// Module: nav-navigation. +// + +@use '../settings/theme'; + +.nav-navigation { + margin-block: theme.get-var( 'sizes', 'gutter' ); + + &__label { + @extend .screen-reader-text; + } + + &__nav { + } + + &__links { + display: flex; + flex-direction: row; + flex-flow: row wrap; + gap: theme.get-var( 'sizes', 'gutter' ); + justify-content: space-between; + } + + &__link { + flex: 1 1 18.75rem; + + &--prev { + } + + &--next { + text-align: right; + } + } +} diff --git a/src/styles/modules/_pagination.scss b/src/styles/modules/_pagination.scss deleted file mode 100644 index 99952af..0000000 --- a/src/styles/modules/_pagination.scss +++ /dev/null @@ -1,30 +0,0 @@ -// -// Module: pagination. -// - -.comment-navigation, // the_comments_navigation() -.post-navigation // the_post_navigation() -.posts-navigation // the_posts_navigation() -{ - .site-content & { - margin: 0 0 1.5em; - } - - .nav-links { - display: flex; - } - - .nav-previous { - flex: 1 0 50%; - } - - .nav-next { - text-align: end; - flex: 1 0 50%; - } -} - -.page-links { - clear: both; - margin: 0 0 1.5em; -} diff --git a/template-parts/content/entry.php b/template-parts/content/entry.php index 30d0115..d4f0e3d 100644 --- a/template-parts/content/entry.php +++ b/template-parts/content/entry.php @@ -47,5 +47,7 @@ + +
diff --git a/template-parts/nav/navigation.php b/template-parts/nav/navigation.php new file mode 100644 index 0000000..47617f4 --- /dev/null +++ b/template-parts/nav/navigation.php @@ -0,0 +1,49 @@ + 'Previous: %title', + 'next_text' => 'Next: %title', + 'in_same_term' => false, + 'excluded_terms' => '', + 'taxonomy' => 'category', + 'label' => __( 'Post navigation', 'theme-scaffold' ), + 'class' => 'post-navigation', +); + +$args = wp_parse_args( $args, $defaults ); +?> + + + + From 1bcbf0af9481629d3a0e3a37557a22709dbb6ad0 Mon Sep 17 00:00:00 2001 From: Cory Hughart Date: Fri, 29 Jul 2022 15:18:42 -0400 Subject: [PATCH 25/33] move escape of nav template labels to output --- languages/theme-scaffold.pot | 1 + src/styles/modules/_nav-navigation.scss | 6 +++--- src/styles/modules/_nav-pagination.scss | 6 +++--- template-parts/nav/navigation.php | 4 ++-- template-parts/nav/pagination.php | 4 ++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/languages/theme-scaffold.pot b/languages/theme-scaffold.pot index 1e4d5a9..ed8a21d 100644 --- a/languages/theme-scaffold.pot +++ b/languages/theme-scaffold.pot @@ -163,6 +163,7 @@ msgid "Search Results for: %s" msgstr "" #: template-parts/nav/navigation.php:19 +msgctxt "post prev/next links label" msgid "Post navigation" msgstr "" diff --git a/src/styles/modules/_nav-navigation.scss b/src/styles/modules/_nav-navigation.scss index 99a2426..e7f28db 100644 --- a/src/styles/modules/_nav-navigation.scss +++ b/src/styles/modules/_nav-navigation.scss @@ -7,11 +7,11 @@ .nav-navigation { margin-block: theme.get-var( 'sizes', 'gutter' ); - &__label { - @extend .screen-reader-text; + &__nav { } - &__nav { + &__label { + @extend .screen-reader-text; } &__links { diff --git a/src/styles/modules/_nav-pagination.scss b/src/styles/modules/_nav-pagination.scss index 2d09ddb..4c80664 100644 --- a/src/styles/modules/_nav-pagination.scss +++ b/src/styles/modules/_nav-pagination.scss @@ -9,11 +9,11 @@ .nav-pagination { margin-block: theme.get-var( 'sizes', 'gutter' ); - &__label { - @extend .screen-reader-text; + &__nav { } - &__nav { + &__label { + @extend .screen-reader-text; } &__links { diff --git a/template-parts/nav/navigation.php b/template-parts/nav/navigation.php index 47617f4..37c017a 100644 --- a/template-parts/nav/navigation.php +++ b/template-parts/nav/navigation.php @@ -16,7 +16,7 @@ 'in_same_term' => false, 'excluded_terms' => '', 'taxonomy' => 'category', - 'label' => __( 'Post navigation', 'theme-scaffold' ), + 'label' => _x( 'Post navigation', 'post prev/next links label', 'theme-scaffold' ), 'class' => 'post-navigation', ); @@ -26,7 +26,7 @@