Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/check_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.7
python-version: 3.9

- name: install dependencies
run: pip3 install pyyaml
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ Thumbs.db
_/images/Thumbs.db
settings.ini
.vscode/settings.json
new_blog/
.kiro/
65 changes: 65 additions & 0 deletions _includes/custom-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,68 @@
elem.forEach(e => (e.innerHTML = '<i class="fas fa-link fa-xs"></i>'));
});
</script>

<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>

<style>
.post-container {
display: flex;
position: relative;
}

.toc-sidebar {
position: fixed;
right: 20px;
top: 20px;
width: 250px;
max-height: calc(100vh - 40px);
overflow-y: auto;
background: #f6f8fa;
border: 1px solid #d0d7de;
border-radius: 6px;
padding: 16px;
z-index: 100;
box-shadow: 0 1px 3px rgba(27, 31, 36, 0.1);
font-size: 14px;
}

.toc-sidebar h2 {
font-size: 16px;
margin-top: 0;
color: #24292f;
}

.toc-sidebar ul {
list-style: none;
padding-left: 0;
}

.toc-sidebar li {
margin: 4px 0;
}

.toc-sidebar a {
color: #0969da;
text-decoration: none;
}

.toc-sidebar a:hover {
text-decoration: underline;
}

.post-main {
margin-right: 280px;
flex: 1;
max-width: calc(100% - 280px);
}

@media (max-width: 768px) {
.toc-sidebar {
display: none;
}
.post-main {
margin-right: 0;
max-width: 100%;
}
}
</style>
29 changes: 18 additions & 11 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h1 class="post-title p-name" itemprop="name headline">{{ page.title | escape }}
{{ page.date | date: date_format }}
</time>
{%- if page.modified_date -%}
~
~
{%- assign mdate = page.modified_date | date_to_xmlschema -%}
<time class="dt-modified" datetime="{{ mdate }}" itemprop="dateModified">
{{ mdate | date: date_format }}
Expand All @@ -35,7 +35,7 @@ <h1 class="post-title p-name" itemprop="name headline">{{ page.title | escape }}
</p>

{% if page.categories.size > 0 and site.show_tags %}
<p class="category-tags"><i class="fas fa-tags category-tags-icon"></i></i>
<p class="category-tags"><i class="fas fa-tags category-tags-icon"></i></i>
{% for category in page.categories %}
<a class="category-tags-link" href="{{site.baseurl}}/categories/#{{category|slugize}}">{{category}}</a>
{% unless forloop.last %}&nbsp;{% endunless %}
Expand All @@ -54,14 +54,21 @@ <h1 class="post-title p-name" itemprop="name headline">{{ page.title | escape }}
{% endif -%}
</header>

<div class="post-content e-content" itemprop="articleBody">
{{ content | toc }}
<div class="post-container">
<aside class="toc-sidebar">
{% include toc.html %}
</aside>
<main class="post-main">
<div class="post-content e-content" itemprop="articleBody">
{{ content }}
</div>
{%- if page.comments -%}
{%- include utterances.html -%}
{%- endif -%}
{%- if site.disqus.shortname -%}
{%- include disqus_comments.html -%}
{%- endif -%}
<a class="u-url" href="{{ page.url | relative_url }}" hidden></a>
</main>
</div>
{%- if page.comments -%}
{%- include utterances.html -%}
{%- endif -%}
{%- if site.disqus.shortname -%}
{%- include disqus_comments.html -%}
{%- endif -%}
<a class="u-url" href="{{ page.url | relative_url }}" hidden></a>
</article>