Skip to content

Update libraries #50

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

Merged
merged 2 commits into from
May 18, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
highlight.js: 9.18.1 -> 10.0.3
  • Loading branch information
toshimaru committed May 18, 2020
commit f366f4a0c928a842abe6aa35390a96794547b599
4 changes: 2 additions & 2 deletions src/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<link href="/assets/css/style.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/styles/monokai.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.0.3/styles/monokai.min.css">
<link rel="apple-touch-icon" href="icon.png">
<meta name="theme-color" content="#fafafa">
<link href="https://fonts.googleapis.com/css?family=Asap" rel="stylesheet">
Expand Down Expand Up @@ -60,7 +60,7 @@

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.2.2/anchor.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/highlight.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.0.3/highlight.min.js"></script>
<script src="/assets/js/app.js"></script>
</body>
</html>
16 changes: 9 additions & 7 deletions src/assets/js/app.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
$(() => {
// anchor-js
anchors.options.visible = 'always';
anchors.add();

// highlight.js
hljs.initHighlighting();

$(".sidebar-sticky .icon").on("click", function (e) {
$(this).siblings("ul").toggle();
this.classList.toggle("icon-opened");
});

hljs.initHighlightingOnLoad();

anchors.options.visible = 'always';
anchors.add();

$(`.sidebar-content a[href='${window.location.pathname}']`)
.attr("class", "active-link")
.parents('ul').show();
.parents('ul')
.show();
});