Add small edit button to section heading line

This commit is contained in:
Bailey Tjiong
2022-02-25 21:50:24 +01:00
parent e7456c1341
commit 6bdce79bdd
2 changed files with 16 additions and 6 deletions

View File

@ -33,11 +33,8 @@ layout: default
{% if page.summary %}
<div class="summary">{{page.summary}}</div>
{% endif %}
<div id="inline-toc"><!-- empty, move TOC here when screen size too small --></div>
{% if site.github_editme_path %}
{% if site.github_editme_path %}
{% assign editmepath = page.path %}
{% if page.editmepath %}
@ -49,6 +46,8 @@ layout: default
{% endif %}
<div id="inline-toc"><!-- empty, move TOC here when screen size too small --></div>
{{content}}
<div class="tags">
@ -64,9 +63,16 @@ layout: default
</div>
{% if site.github_editme_path %}
This documentation is written in markdown. If there is something missing or can be improved, edit this page on github and create a PR:
This documentation is written in markdown. If there is something missing or can be improved, edit this page on github and create a PR:
{% unless page.editmepath == false %}
<a target="_blank" href="https://github.com/{{site.github_editme_path}}{{editmepath}}" class="btn btn-default githubEditButton" role="button"><i class="fa fa-github fa-lg"></i> Edit me</a>
<script>
$(document).ready ( function(){
$('div.post-content').find('h2').after(
' <a target="_blank" href="https://github.com/{{site.github_editme_path}}{{editmepath}}" class="btn btn-default btn-xs githubEditButton" role="button"><i class="fa fa-github fa-lg"></i></a>'
);
});
</script>
{% endunless %}
{% endif %}

View File

@ -1246,3 +1246,7 @@ h4.panel-title {
width: 100px;
height: 100px;
}
.post-content h2 {
display: inline-block;
}