浏览代码

Improve support for Markdown footnotes (fix #61)

George Cushen 8 年之前
父节点
当前提交
605902a884
共有 3 个文件被更改,包括 12 次插入2 次删除
  1. 1 0
      exampleSite/config.toml
  2. 9 0
      exampleSite/content/post/writing-markdown-latex.md
  3. 2 2
      static/css/hugo-academic.css

+ 1 - 0
exampleSite/config.toml

@@ -4,6 +4,7 @@ copyright = "© 2016 Your Name"
 languageCode = "en-us"
 theme = "academic"
 enableEmoji = true
+footnotereturnlinkcontents = "<sup>^</sup>"
 
 # Enable comments by entering your Disqus shortname
 disqusShortname = ""

+ 9 - 0
exampleSite/content/post/writing-markdown-latex.md

@@ -70,6 +70,15 @@ I :heart: Academic :smile:
 
 > This is a blockquote.
 
+## Footnotes
+
+    I have more [^1] to say.
+    
+    [^1]: Footnote example.
+
+I have more [^1] to say.
+[^1]: Footnote example.
+
 ## Code highlighting
 
 Pass the *language* of the code, such as `python`, as a parameter after three backticks:

+ 2 - 2
static/css/hugo-academic.css

@@ -772,7 +772,7 @@ footer a#back_to_top i {
 }
 
 /* Prevent navbar hiding initial content when jumping to in-page anchor. */
-*[id]:before {
+*[id]:not([id^="fn"]):before {
   display: block;
   content: " ";
   margin-top: -70px;
@@ -828,7 +828,7 @@ nav#navbar-main li {
   }
 
   /* Prevent navbar hiding initial content when jumping to in-page anchor. */
-  *[id]:before {
+  *[id]:not([id^="fn"]):before {
     margin-top: -50px;
     height: 50px;
   }