Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛Fix zen mode footer line bug #2001

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions assets/js/zen-mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ function _toogleZenMode(zendModeButton) {
const tocInside = document.querySelector('.toc-inside');
const articleContent = document.querySelector('.article-content');
const header = document.querySelector('#single_header');
const footer = document.querySelector(''#single_footer''); // Add footer ref for class transformation


// Add semantic class into body tag
Expand All @@ -23,6 +24,10 @@ function _toogleZenMode(zendModeButton) {
// Change width of article title
header.classList.toggle('max-w-full');
header.classList.toggle('max-w-prose');

// Change width of article footer
header.classList.toggle('max-w-full');
header.classList.toggle('max-w-prose');

// Read i18n title from data-attributes
const titleI18nDisable = zendModeButton.getAttribute('data-title-i18n-disable');
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ <h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral">
{{ end }}

</section>
<footer class="pt-8 max-w-prose print:hidden">
<footer id="single_footer" class="pt-8 max-w-prose print:hidden">

{{ partial "article-pagination.html" . }}
{{ if .Params.showComments | default (.Site.Params.article.showComments | default false) }}
Expand Down