Para crear navegación de un tema a otro (e insertar automáticamente botones de Atrás/Anterior y Adelante/Siguiente en cada tema de la secuencia), lo estoy haciendo de esta manera…
Estoy reutilizando la opción “Responder como tema enlazado” y luego aplicando estilo CSS a los enlaces de la siguiente manera…
Y añadiendo algo de CSS en la Configuración del Tema…
CSS MÍNIMO SOLO PARA LOS BOTONES
.post-links-container {
margin-left: var(--topic-body-width-padding);
position: absolute;
top: 37px;
right: 30px;
}
.post-links-container ul li .d-icon {
display: none;
}
.post-links-container .post-links {
margin-top: 0;
padding-top: 0;
border-top: 0;
}
.post-links-container .post-links li:last-of-type {
margin-bottom: 0;
}
.post-links-container ul li a[href] {
align-items: center;
border: 1px solid var(--primary-low-mid);
background: var(--primary-very-low);
border-bottom-width: 2px;
border-radius: 3px;
box-sizing: border-box;
color: #009a49;
display: inline-flex;
font-family: monospace, monospace;
font-size: var(--font-down-1);
justify-content: center;
line-height: var(--line-height-large);
margin: 0 0.15em;
min-width: 24px;
padding: 0.15em 0.6em;
}
.post-links-container ul li a::after {
content: " ->>";
padding-left: 0.15em;
}
kbd {
align-items: center;
border: 1px solid var(--primary-low-mid);
background: var(--primary-very-low);
border-bottom-width: 2px;
border-radius: 3px;
box-sizing: border-box;
color: var(--primary);
display: inline-flex;
font-family: monospace, monospace;
font-size: var(--font-down-1);
justify-content: center;
line-height: var(--line-height-large);
margin: 0 0.15em;
min-width: 24px;
padding: 0.15em 0.6em;
}
kbd a {
padding: 0;
}
kbd a::before {
content: "<<-";
padding-right: 0.15em;
}
INSTRUCCIONES Y EL CSS COMPLETO QUE ESTOY USANDO
/** Botones Anterior y Siguiente para Libros u otras Secuencias de Temas - esta función se crea reutilizando **/\
/** el selector nativo de Discourse "Responder como Tema Enlazado" en el compositor (arriba a la izquierda). **/\
/** PARA CONFIGURAR ESTO EN TU DISCOURSE **/\
/** Pega <kbd>%{postLink}</kbd> en /admin/customize/site_texts/js.post.continue_discussion. **/\
/** Luego crea 2 categorías: LIBROS (para secuencias de temas estilo Blog) y HISTORIAS (para secuencias de temas estilo Tema Regular). **/\
/** Instala el componente de tema https://meta.discourse.org/t/blog-post-styling/110841 **/\
/** En la Configuración del Componente de Tema de Estilo de Publicaciones de Blog, asigna la Categoría LIBROS (pero no HISTORIAS) como Categoría de Blog. **/\
/** Luego crea una etiqueta: LIBRO y asígnala como Etiqueta de Blog en la Configuración del Componente de Tema de Estilo de Publicaciones de Blog. **/\
/** Luego no olvides pegar el siguiente CSS. Va en la Cabecera de tu Tema. **/\
/** Por supuesto, el CSS aquí necesitará ajustes para funcionar correctamente en otros temas. **/\
/** Ahora puedes crear secuencias de Temas en la Categoría HISTORIAS que tendrán los botones de navegación, **/\
/** pero esos Temas aparecerán de lo contrario en el Estilo de Tema Regular). **/\
/** Si puedes añadir el Estilo de Blog a estos Temas de la Categoría HISTORIAS simplemente añadiendo la etiqueta LIBRO. **/\
/** Un nuevo Tema que compongas en la CATEGORÍA LIBROS usando "Responder como Tema Enlazado" ya tendrá tanto los botones de navegación **/\
/** como el Estilo de Blog. **/\
/** Ve una demostración en https://meta.discourse.org/t/is-pagination-impossible-or-just-hard/231838/16 **/\
.tag-book,
.category-books {
aside.sidebar,
.topic-meta-data,
.tag-book .topic-category .badge-wrapper,
.category-books .topic-category .badge-wrapper {
display:none !important;
}
}
.tag-book .container.posts,
.category-books .container.posts {
justify-content: unset;
justify-items: unset;
padding-left: 0;
display: block;
}
.tag-book .container.posts .topic-post .row,
.category-books .container.posts .topic-post .row {
display: block;
justify-content: center;
}
.tag-book #topic-title .title-wrapper,
.category-books #topic-title .title-wrapper {
display: block;
margin: 0 auto;
}
.tag-book #topic-title,
.category-books #topic-title {
display: block;
margin: 0 auto;
}
.tag-book #topic-title h1,
.category-books #topic-title h1 {
font-size: 2em;
padding-right: 20px;
}
.tag-book #post_1 .topic-body,
.category-books #post_1 .topic-body {
padding-top: 1em;
border-top: none;
max-width: 100%;
}
.tag-book #post_1 .topic-body .contents,
.category-books #post_1 .topic-body .contents {
border-top: none;
margin-left: 0;
padding: 0;
}
.tag-book p,
.category-books p {
/* pon estilos aquí para el texto principal en las páginas del Libro */
}
/* Posiciona el botón Adelante en la parte superior derecha de la página */
.tag-book .post-links-container,
.category-books .post-links-container {
margin-left: var(--topic-body-width-padding);
position: absolute;
top: 1em;
right: 30px;
}
/* Posiciona el botón Atrás en la parte superior izquierda de la página */
.category-stories .post-links-container {
margin-left: var(--topic-body-width-padding);
position: absolute;
top: 2.5em;
right: 30px;
}
/* Elimina el símbolo de enlace del botón Adelante */
.tag-book .post-links-container ul li .d-icon,
.category-books .post-links-container ul li .d-icon,
.category-stories .post-links-container ul li .d-icon {
display: none;
}
.tag-book .post-links-container .post-links,
.category-books .post-links-container .post-links,
.category-stories .post-links-container .post-links {
margin-top: 0;
padding-top: 0;
border-top: 0;
}
.tag-book .post-links-container .post-links li:last-of-type,
.category-books .post-links-container .post-links li:last-of-type,
.category-stories .post-links-container .post-links li:last-of-type {
margin-bottom: 0;
}
/* Estilo del botón Siguiente/Adelante */
.tag-book .post-links-container ul li a[href],
.category-books .post-links-container ul li a[href],
.category-stories .post-links-container ul li a[href] {
align-items: center;
border: 1px solid var(--primary-low-mid);
background: var(--primary-very-low);
border-bottom-width: 2px;
border-radius: 3px;
box-sizing: border-box;
color: #009a49;
display: inline-flex;
font-family: monospace, monospace;
font-size: var(--font-down-1);
justify-content: center;
line-height: var(--line-height-large);
margin: 0 0.15em;
min-width: 24px;
padding: 0.15em 0.6em;
}
/* Añade flechas apuntando a la derecha al botón Adelante */
.tag-book .post-links-container ul li a::after,
.category-books .post-links-container ul li a::after,
.category-stories .post-links-container ul li a::after {
content: " ->>";
padding-left: 0.15em;
}
/* Alternativamente, usa una imagen para la flecha derecha */
/*
.tag-book .post-links-container::after,
.category-books .post-links-container::after,
.category-stories .post-links-container::after {
content: url('../../media/arrow-right.svg');
display: inline-block;
width: 12px;
height: 12px;
}
*/
/* Estilo del botón Atrás/Anterior*/
.tag-book kbd,
.category-books kbd,
.category-stories kbd {
align-items: center;
border: 1px solid var(--primary-low-mid);
background: var(--primary-very-low);
border-bottom-width: 2px;
border-radius: 3px;
box-sizing: border-box;
color: var(--primary);
display: inline-flex;
font-size: var(--font-down-1);
justify-content: center;
line-height: var(--line-height-large);
margin: 0;
min-width: 24px;
padding: 0.15em 0.6em;
}
.tag-book kbd a,
.category-books kbd a,
.category-stories kbd a {
padding: 0;
}
/* Añade flechas al botón Atrás */
.tag-book kbd a::before,
.category-books kbd a::before,
.category-stories kbd a::before {
content: "<<-";
padding-right: 0.15em;
}
/* Alternativamente, usa una imagen para la flecha izquierda */
/*
.tag-book kbd a::before,
.category-books kbd a::before,
.category-stories kbd a::before {
content: url('../../media/arrow-left.svg');
display: inline-block;
width: 12px;
height: 12px;
}
*/
Aquí está el resultado…
Puedes probarlo en vivo aquí…



