-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added table index and fixed few minor bugs
- Loading branch information
Showing
13 changed files
with
197 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
# Application | ||
# application | ||
application.base-uri=http://localhost:${quarkus.http.port} | ||
|
||
quarkus.application.name=blog | ||
quarkus.http.port=9000 | ||
|
||
# Jackson | ||
# jackson | ||
quarkus.jackson.serialization-inclusion=non-null | ||
quarkus.jackson.accept-case-insensitive-enums=true | ||
|
||
# web-bundler | ||
quarkus.web-bundler.bundle.utils=true | ||
quarkus.web-bundler.bundle.utils.key=utils | ||
quarkus.web-bundler.bundle.utils.dir=utils | ||
|
||
quarkus.web-bundler.bundle.blog-page=true | ||
quarkus.web-bundler.bundle.blog-page.key=blogpage | ||
quarkus.web-bundler.bundle.blog-page.dir=blogpage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<p id="{value.replaceAll('\s','-').toLowerCase()}" class="h{heading} blog-header"> | ||
<a href="#{value.replaceAll('\s','-').toLowerCase()}" class="text-decoration-none link-opacity-75 link-opacity-100-hover">#</a> {value} | ||
<p id="{value.toHtmlIdentifier}" class="h{heading} blog-header"> | ||
<a href="#{value.toHtmlIdentifier}" class="text-decoration-none link-opacity-100 link-opacity-75-hover">#</a> {value.value} | ||
</p> |
2 changes: 1 addition & 1 deletion
2
component/src/main/resources/templates/blog/blog-hyperlink.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<a href="{hyperlink}" class="text-decoration-none link-opacity-75 link-opacity-100-hover" target="_blank">{value}</a> | ||
<a href="{hyperlink}" class="text-decoration-none link-opacity-100 link-opacity-75-hover" target="_blank">{value}</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div class="ps-index-{block.node} pb-index"> | ||
<a href="#{index.toHtmlIdentifier}" class="text-decoration-none">{{index.value}}</a> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import $ from 'jquery'; | ||
import '../utils/utils.js'; | ||
|
||
$(document).ready(function() { | ||
|
||
const headings = $("p.h1, p.h2, p.h3"); | ||
const indexLinks = $("#index a"); | ||
let activeIndex = undefined; | ||
|
||
function checkScrollPosition() { | ||
|
||
indexLinks.removeClass('active-index'); | ||
|
||
if (isBottomPage()) { | ||
activeIndex = indexLinks.length - 1; | ||
} else { | ||
headings.each(function(index) { | ||
if (isElementInView(this)) { | ||
activeIndex = index; | ||
return false; | ||
} | ||
}); | ||
} | ||
|
||
if (activeIndex !== undefined) { | ||
$(indexLinks[activeIndex]).addClass('active-index'); | ||
} | ||
} | ||
|
||
$(window).on('scroll', function() { | ||
checkScrollPosition(); | ||
}); | ||
|
||
checkScrollPosition(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import $ from 'jquery'; | ||
|
||
function isElementInView(element, fullyInView) { | ||
const pageTop = $(window).scrollTop(); | ||
const pageBottom = pageTop + $(window).height(); | ||
const elementTop = $(element).offset().top; | ||
const elementBottom = elementTop + $(element).height(); | ||
|
||
if (fullyInView === true) { | ||
return ((pageTop < elementTop) && (pageBottom > elementBottom)); | ||
} else { | ||
return ((elementTop <= pageBottom) && (elementBottom >= pageTop)); | ||
} | ||
} | ||
|
||
function isBottomPage() { | ||
const scrollPosition = $(window).scrollTop() + $(window).height(); | ||
const documentHeight = $(document).height(); | ||
return scrollPosition >= documentHeight - 5; | ||
} | ||
|
||
window.isElementInView = isElementInView; | ||
window.isBottomPage = isBottomPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters