Actualiza listas y resaltado de sintaxis código

Detalle:
  - Se revisan las listas y se crea una nueva plantilla sólo para
    páginas recientes.
  - Se sustituye el plugin de resaltado de sintaxis por otro que usa
    Prism.js y se integra bien con Enfold. Se ajustan estilos.
  - Se actualizan algunos estilos básicos.
This commit is contained in:
Manuel Cillero 2020-07-20 21:01:47 +02:00
parent 29d3a19129
commit 516b5f4413
7 changed files with 504 additions and 18 deletions

View file

@ -1,11 +1,11 @@
<?php
/**
* Flexible Posts Widget: Old Default widget template
*
*
* @since 1.0.0
*
* This is the ORIGINAL default template used by the plugin.
* There is a new default template (default.php) that will be
* There is a new default template (default.php) that will be
* used by default if no template was specified in a widget.
*/
@ -36,7 +36,7 @@ if( $flexible_posts->have_posts() ):
}
?>
<h4 class="title"><?php the_title(); ?></h4>
<p class="meta"><?php echo 'desde '; the_time('F \d\e Y'); ?></p>
<p class="meta"><?php echo 'desde '; the_time('F \d\e Y'); ?></p>
</a>
</li>
<?php endwhile; ?>
@ -45,7 +45,7 @@ if( $flexible_posts->have_posts() ):
<div class="dpe-flexible-posts no-posts">
<p><?php _e( 'No post found', 'flexible-posts-widget' ); ?></p>
</div>
<?php
<?php
endif; // End have_posts()
echo $after_widget;

View file

@ -1,11 +1,11 @@
<?php
/**
* Flexible Posts Widget: Old Default widget template
*
*
* @since 1.0.0
*
* This is the ORIGINAL default template used by the plugin.
* There is a new default template (default.php) that will be
* There is a new default template (default.php) that will be
* used by default if no template was specified in a widget.
*/
@ -39,7 +39,7 @@ if( $flexible_posts->have_posts() ):
}
?>
<h4 class="title"><?php the_title(); ?></h4>
<p class="meta"><?php the_time('\d\e\l d \d\e F \d\e Y'); ?></p>
<p class="meta"><?php the_time('\d\e\l d \d\e F \d\e Y'); ?></p>
</a>
</li>
<?php endwhile; ?>
@ -48,7 +48,7 @@ if( $flexible_posts->have_posts() ):
<div class="dpe-flexible-posts no-posts">
<p><?php _e( 'No post found', 'flexible-posts-widget' ); ?></p>
</div>
<?php
<?php
endif; // End have_posts()
echo $after_widget;

View file

@ -0,0 +1,54 @@
<?php
/**
* Flexible Posts Widget: Old Default widget template
*
* @since 1.0.0
*
* This is the ORIGINAL default template used by the plugin.
* There is a new default template (default.php) that will be
* used by default if no template was specified in a widget.
*/
// Block direct requests
if ( !defined('ABSPATH') )
die('-1');
echo $before_widget;
if ( !empty($title) )
echo $before_title . $title . $after_title;
if( $flexible_posts->have_posts() ):
?>
<ul class="dpe-flexible-posts list-pages">
<?php while( $flexible_posts->have_posts() ) : $flexible_posts->the_post(); global $post; ?>
<li id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
global $wp;
$permalink = get_permalink();
$current_url = home_url( add_query_arg( array(), $wp->request ) );
echo '<a href="' . $permalink . ( trim( $permalink, '/' ) == $current_url ? '" class="active">' : '">' );
if( $thumbnail == true ) {
// If the post has a feature image, show it
if( has_post_thumbnail() ) {
the_post_thumbnail( $thumbsize );
// Else if the post has a mime type that starts with "image/" then show the image directly.
} elseif( 'image/' == substr( $post->post_mime_type, 0, 6 ) ) {
echo wp_get_attachment_image( $post->ID, $thumbsize );
}
}
?>
<h4 class="title"><?php the_title(); ?></h4>
<p class="meta"><?php echo 'del '; the_modified_time('d \d\e F \d\e Y'); ?></p>
</a>
</li>
<?php endwhile; ?>
</ul><!-- .dpe-flexible-posts -->
<?php else: // We have no posts ?>
<div class="dpe-flexible-posts no-posts">
<p><?php _e( 'No post found', 'flexible-posts-widget' ); ?></p>
</div>
<?php
endif; // End have_posts()
echo $after_widget;

View file

@ -69,7 +69,7 @@ function fix_single_post_title( $args, $id ) {
else {
// Post categories by name:
$categories = array_values( array_column( get_the_category(), 'name' ) );
if ( in_array( $categories[0], array( 'Blog', 'Archivo de notas', 'Notas breves', 'Álbum de fotos' ) ) ) {
if ( in_array( $categories[0], array( 'Blog', 'Archivo de notas', 'Marcadores', 'Álbum de fotos' ) ) ) {
$args['title'] = $categories[0];
}
}

View file

@ -0,0 +1,322 @@
/* PrismJS 1.20.0
https://prismjs.com/download.html#themes=prism-coy&languages=markup+css+clike+javascript+bash+batch+dart+diff+docker+git+json+markdown+markup-templating+perl+php+rust+sql+toml+typescript&plugins=line-highlight+line-numbers */
/**
* prism.js Coy theme for JavaScript, CoffeeScript, CSS and HTML
* Based on https://github.com/tshedor/workshop-wp-theme (Example: http://workshop.kansan.com/category/sessions/basics or http://workshop.timshedor.com/category/sessions/basics);
* @author Tim Shedor
*/
code[class*="language-"],
pre[class*="language-"] {
color: black;
background: none;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
font-size: 1em;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
/* Code blocks */
pre[class*="language-"] {
position: relative;
margin: .5em 0;
overflow: visible;
padding: 0;
}
pre[class*="language-"]>code {
position: relative;
border-left: 10px solid #358ccb;
box-shadow: -1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf;
background-color: #fdfdfd;
background-image: linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%);
background-size: 3em 3em;
background-origin: content-box;
background-attachment: local;
}
code[class*="language-"] {
max-height: inherit;
height: inherit;
padding: 0 1em;
display: block;
overflow: auto;
}
/* Margin bottom to accommodate shadow */
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background-color: #fdfdfd;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin-bottom: 1em;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
position: relative;
padding: .2em;
border-radius: 0.3em;
color: #c92c2c;
border: 1px solid rgba(0, 0, 0, 0.1);
display: inline;
white-space: normal;
}
pre[class*="language-"]:before,
pre[class*="language-"]:after {
content: '';
z-index: -2;
display: block;
position: absolute;
bottom: 0.75em;
left: 0.18em;
width: 40%;
height: 20%;
max-height: 13em;
box-shadow: 0px 13px 8px #979797;
-webkit-transform: rotate(-2deg);
-moz-transform: rotate(-2deg);
-ms-transform: rotate(-2deg);
-o-transform: rotate(-2deg);
transform: rotate(-2deg);
}
pre[class*="language-"]:after {
right: 0.75em;
left: auto;
-webkit-transform: rotate(2deg);
-moz-transform: rotate(2deg);
-ms-transform: rotate(2deg);
-o-transform: rotate(2deg);
transform: rotate(2deg);
}
.token.comment,
.token.block-comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: #7D8B99;
}
.token.punctuation {
color: #5F6364;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.function-name,
.token.constant,
.token.symbol,
.token.deleted {
color: #c92c2c;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.function,
.token.builtin,
.token.inserted {
color: #2f9c0a;
}
.token.operator,
.token.entity,
.token.url,
.token.variable {
color: #a67f59;
background: rgba(255, 255, 255, 0.5);
}
.token.atrule,
.token.attr-value,
.token.keyword,
.token.class-name {
color: #1990b8;
}
.token.regex,
.token.important {
color: #e90;
}
.language-css .token.string,
.style .token.string {
color: #a67f59;
background: rgba(255, 255, 255, 0.5);
}
.token.important {
font-weight: normal;
}
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
.token.namespace {
opacity: .7;
}
@media screen and (max-width: 767px) {
pre[class*="language-"]:before,
pre[class*="language-"]:after {
bottom: 14px;
box-shadow: none;
}
}
/* Plugin styles: Line Numbers */
pre[class*="language-"].line-numbers.line-numbers {
padding-left: 0;
}
pre[class*="language-"].line-numbers.line-numbers code {
padding-left: 3.8em;
}
pre[class*="language-"].line-numbers.line-numbers .line-numbers-rows {
left: 0;
}
/* Plugin styles: Line Highlight */
pre[class*="language-"][data-line] {
padding-top: 0;
padding-bottom: 0;
padding-left: 0;
}
pre[data-line] code {
position: relative;
padding-left: 4em;
}
pre .line-highlight {
margin-top: 0;
}
pre[data-line] {
position: relative;
padding: 1em 0 1em 3em;
}
.line-highlight {
position: absolute;
left: 0;
right: 0;
padding: inherit 0;
margin-top: 1em; /* Same as .prisms padding-top */
background: hsla(24, 20%, 50%,.08);
background: linear-gradient(to right, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
pointer-events: none;
line-height: inherit;
white-space: pre;
}
.line-highlight:before,
.line-highlight[data-end]:after {
content: attr(data-start);
position: absolute;
top: .4em;
left: .6em;
min-width: 1em;
padding: 0 .5em;
background-color: hsla(24, 20%, 50%,.4);
color: hsl(24, 20%, 95%);
font: bold 65%/1.5 sans-serif;
text-align: center;
vertical-align: .3em;
border-radius: 999px;
text-shadow: none;
box-shadow: 0 1px white;
}
.line-highlight[data-end]:after {
content: attr(data-end);
top: auto;
bottom: .4em;
}
.line-numbers .line-highlight:before,
.line-numbers .line-highlight:after {
content: none;
}
pre[id].linkable-line-numbers span.line-numbers-rows {
pointer-events: all;
}
pre[id].linkable-line-numbers span.line-numbers-rows > span:before {
cursor: pointer;
}
pre[id].linkable-line-numbers span.line-numbers-rows > span:hover:before {
background-color: rgba(128, 128, 128, .2);
}
pre[class*="language-"].line-numbers {
position: relative;
padding-left: 3.8em;
counter-reset: linenumber;
}
pre[class*="language-"].line-numbers > code {
position: relative;
white-space: inherit;
}
.line-numbers .line-numbers-rows {
position: absolute;
pointer-events: none;
top: 0;
font-size: 100%;
left: -3.8em;
width: 3em; /* works for line-numbers below 1000 lines */
letter-spacing: -1px;
border-right: 1px solid #999;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.line-numbers-rows > span {
display: block;
counter-increment: linenumber;
}
.line-numbers-rows > span:before {
content: counter(linenumber);
color: #999;
display: block;
padding-right: 0.8em;
text-align: right;
}

File diff suppressed because one or more lines are too long

View file

@ -204,9 +204,9 @@ a.avia-cookie-consent-button:hover {
background-color: #e9146c;
height: 4px;
}
#menu-item-5777 {
#menu-item-5777,
#menu-item-13589 {
border-top: 1px solid #556372;
border-bottom: 1px solid #556372;
}
/*
@ -313,6 +313,15 @@ a.avia-cookie-consent-button:hover {
.entry-content-wrapper .text-underline {
border-bottom: 1px solid currentcolor;
}
.entry-content-wrapper code {
border: 1px dotted #e2e2e8;
border-radius: 3px;
background-color: rgba(245, 245, 250, 0.75);
padding: 1px 5px;
margin: 0 3px;
font-size: smaller;
vertical-align: middle;
}
/* Text styles */
span[data-avia-tooltip] {
padding-left: 2px;
@ -355,13 +364,13 @@ span[data-avia-tooltip] {
max-height: 900px;
width: auto;
}
/* Notas breves posts */
article.category-breves .entry-content-wrapper div.entry-content {
/* Marcadores posts */
article.category-marcadores .entry-content-wrapper div.entry-content {
border-left: 7px solid #3c8dbc;
padding-left: 20px;
}
article.category-breves .entry-content-wrapper p {
font-size: 1.235em;
article.category-marcadores .entry-content-wrapper p {
font-size: 1.1em;
line-height: 1.5em;
text-align: left;
color: #999999 !important;
@ -523,6 +532,14 @@ li.comment {
border-right-width: 3px;
}
/*
* Content Cards PLUGIN.
*/
a.content_cards_image_link > br,
a.content_cards_title_link > br {
display: none;
}
/*
* LuckyWP Table of Contents PLUGIN.
*/
@ -561,7 +578,75 @@ div.lwptoc_item > div.lwptoc_itemWrap span.lwptoc_item_label:before {
}
div.lwptoc_i {
width: 100%;
max-width: 100%;;
max-width: 100%;
}
}
/*
* Highlighting Code Block PLUGIN.
*/
.hcb_wrap {
display: flex !important;
margin: 0 !important;
}
.hcb_wrap .line-highlight {
margin-top: 0 !important;
}
.hcb_wrap .undefined-numbers .line-highlight {
margin-top: 9px !important;
}
.hcb_wrap .undefined-numbers code {
padding-top: 9px !important;
padding-bottom: 9px !important;
}
/*
* Tooltips PLUGIN.
*/
div.qtip {
background-color: black;
}
div.qtip-content {
line-height: 14px;
}
div.qtip-content a {
color: #a8d1ff;
font-weight: bold;
}
div.tooltips_directory {
text-align: center;
}
div.tooltips_table_title {
width: 18%;
padding-right: 12px;
text-align: right;
background-color: #f9f9f9;
}
div.tooltips_table_content {
width: 82%;
text-align: left;
}
a.navitem {
font-size: 16px !important;
}
a.navitem.allDirectory {
visibility: hidden;
text-indent: -9999px;
}
a.navitem.allDirectory:after {
content: "TODOS";
text-indent: 0;
display: block;
visibility: visible;
}
@media (max-width: 767px) {
div.tooltips_table_title {
width: 100%;
text-align: center;
}
div.tooltips_table_content {
width: 100%;
padding: 8px 0 16px;
}
}
@ -628,6 +713,7 @@ ul.dpe-flexible-posts li {
list-style-image: none;
margin-left: 0 !important;
margin-bottom: 8px;
padding: 3px 0;
text-align: left;
}
ul.dpe-flexible-posts li img {