diff options
Diffstat (limited to 'srcs/wordpress/wp-content/themes/twentynineteen')
90 files changed, 29184 insertions, 0 deletions
diff --git a/srcs/wordpress/wp-content/themes/twentynineteen/404.php b/srcs/wordpress/wp-content/themes/twentynineteen/404.php new file mode 100644 index 0000000..23ae5e7 --- /dev/null +++ b/srcs/wordpress/wp-content/themes/twentynineteen/404.php @@ -0,0 +1,33 @@ +<?php +/** + * The template for displaying 404 pages (not found) + * + * @link https://codex.wordpress.org/Creating_an_Error_404_Page + * + * @package WordPress + * @subpackage Twenty_Nineteen + * @since 1.0.0 + */ + +get_header(); +?> + + <div id="primary" class="content-area"> + <main id="main" class="site-main"> + + <div class="error-404 not-found"> + <header class="page-header"> + <h1 class="page-title"><?php _e( 'Oops! That page can’t be found.', 'twentynineteen' ); ?></h1> + </header><!-- .page-header --> + + <div class="page-content"> + <p><?php _e( 'It looks like nothing was found at this location. Maybe try a search?', 'twentynineteen' ); ?></p> + <?php get_search_form(); ?> + </div><!-- .page-content --> + </div><!-- .error-404 --> + + </main><!-- #main --> + </div><!-- #primary --> + +<?php +get_footer(); diff --git a/srcs/wordpress/wp-content/themes/twentynineteen/archive.php b/srcs/wordpress/wp-content/themes/twentynineteen/archive.php new file mode 100644 index 0000000..423db00 --- /dev/null +++ b/srcs/wordpress/wp-content/themes/twentynineteen/archive.php @@ -0,0 +1,54 @@ +<?php +/** + * The template for displaying archive pages + * + * @link https://developer.wordpress.org/themes/basics/template-hierarchy/ + * + * @package WordPress + * @subpackage Twenty_Nineteen + * @since 1.0.0 + */ + +get_header(); +?> + + <div id="primary" class="content-area"> + <main id="main" class="site-main"> + + <?php if ( have_posts() ) : ?> + + <header class="page-header"> + <?php + the_archive_title( '<h1 class="page-title">', '</h1>' ); + ?> + </header><!-- .page-header --> + + <?php + // Start the Loop. + while ( have_posts() ) : + the_post(); + + /* + * Include the Post-Format-specific template for the content. + * If you want to override this in a child theme, then include a file + * called content-___.php (where ___ is the Post Format name) and that will be used instead. + */ + get_template_part( 'template-parts/content/content', 'excerpt' ); + + // End the loop. + endwhile; + + // Previous/next page navigation. + twentynineteen_the_posts_navigation(); + + // If no content, include the "No posts found" template. + else : + get_template_part( 'template-parts/content/content', 'none' ); + + endif; + ?> + </main><!-- #main --> + </div><!-- #primary --> + +<?php +get_footer(); diff --git a/srcs/wordpress/wp-content/themes/twentynineteen/classes/class-twentynineteen-svg-icons.php b/srcs/wordpress/wp-content/themes/twentynineteen/classes/class-twentynineteen-svg-icons.php new file mode 100644 index 0000000..cc10fcc --- /dev/null +++ b/srcs/wordpress/wp-content/themes/twentynineteen/classes/class-twentynineteen-svg-icons.php @@ -0,0 +1,458 @@ +<?php +/** + * SVG Icons class + * + * @package WordPress + * @subpackage Twenty_Nineteen + * @since 1.0.0 + */ + +/** + * This class is in charge of displaying SVG icons across the site. + * + * Place each <svg> source on its own array key, without adding the + * both `width` and `height` attributes, since these are added dynamically, + * before rendering the SVG code. + * + * All icons are assumed to have equal width and height, hence the option + * to only specify a `$size` parameter in the svg methods. + * + * @since 1.0.0 + */ +class TwentyNineteen_SVG_Icons { + + /** + * Gets the SVG code for a given icon. + */ + public static function get_svg( $group, $icon, $size ) { + if ( 'ui' == $group ) { + $arr = self::$ui_icons; + } elseif ( 'social' == $group ) { + $arr = self::$social_icons; + } else { + $arr = array(); + } + if ( array_key_exists( $icon, $arr ) ) { + $repl = sprintf( '<svg class="svg-icon" width="%d" height="%d" aria-hidden="true" role="img" focusable="false" ', $size, $size ); + $svg = preg_replace( '/^<svg /', $repl, trim( $arr[ $icon ] ) ); // Add extra attributes to SVG code. + $svg = preg_replace( "/([\n\t]+)/", ' ', $svg ); // Remove newlines & tabs. + $svg = preg_replace( '/>\s*</', '><', $svg ); // Remove white space between SVG tags. + return $svg; + } + return null; + } + + /** + * Detects the social network from a URL and returns the SVG code for its icon. + */ + public static function get_social_link_svg( $uri, $size ) { + static $regex_map; // Only compute regex map once, for performance. + if ( ! isset( $regex_map ) ) { + $regex_map = array(); + $map = &self::$social_icons_map; // Use reference instead of copy, to save memory. + foreach ( array_keys( self::$social_icons ) as $icon ) { + $domains = array_key_exists( $icon, $map ) ? $map[ $icon ] : array( sprintf( '%s.com', $icon ) ); + $domains = array_map( 'trim', $domains ); // Remove leading/trailing spaces, to prevent regex from failing to match. + $domains = array_map( 'preg_quote', $domains ); + $regex_map[ $icon ] = sprintf( '/(%s)/i', implode( '|', $domains ) ); + } + } + foreach ( $regex_map as $icon => $regex ) { + if ( preg_match( $regex, $uri ) ) { |
