Skip to content

Commit 7415436

Browse files
committed
setup blogdown
1 parent 2edeb0f commit 7415436

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

.Rprofile

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
if (file.exists("~/.Rprofile")) sys.source("~/.Rprofile", envir = environment())
22

33
options(
4-
servr.port = 4321L, blogdown.author = "黄湘云", blogdown.warn.future = FALSE,
5-
digits = 4, formatR.indent = 2, blogdown.yaml.empty = FALSE, blogdown.rename_file = TRUE,
4+
servr.port = 4321L,
5+
blogdown.author = "黄湘云",
6+
blogdown.warn.future = FALSE,
7+
blogdown.method = 'markdown',
8+
digits = 4, formatR.indent = 2,
9+
blogdown.yaml.empty = FALSE,
10+
blogdown.rename_file = TRUE,
611
blogdown.title_case = function(x) {
712
# if the title is pure ASCII, use title case
813
if (xfun::is_ascii(x)) tools::toTitleCase(x) else x
914
}, blogdown.hugo.server = c("--buildDrafts", "--buildFuture", "--navigateToChanged"),
1015
blogdown.publishDir = paste(getwd(), "public", sep = "-"),
16+
blogdown.hugo.version = "0.88.1",
17+
blogdown.files_filter = "content/post/",
1118
blogdown.draft.output = FALSE,
12-
blogdown.knit.on_save = FALSE,
19+
blogdown.knit.on_save = TRUE,
20+
blogdown.new_bundle = FALSE,
1321
blogdown.serve_site.startup = FALSE
1422
)

.gitattributes

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*.tex linguist-vendored
2+
*.cls linguist-vendored
3+
*.Rmd linguist-detectable
4+
*.Rmarkdown linguist-detectable

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,7 @@ vignettes/*.pdf
4040

4141
.DS_Store
4242
Thumbs.db
43-
public, resources
43+
44+
blogdown
45+
/public/
46+
/resources/

layouts/partials/footer.html

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script async src="/js/math-code.js"></script>
2+
<script async src="/js/center-img.js"></script>
23

34
<footer>
45
{{ partial "foot_custom.html" . }}
@@ -15,20 +16,16 @@
1516
</footer>
1617

1718
{{ if and (not .Params.disable_mathjax) (or (in (string .Content) "\\") (in (string .Content) "$")) }}
18-
<script async src="/js/center-img.js"></script>
1919
<script async src="//mathjax.rstudio.com/latest/MathJax.js?config=TeX-MML-AM_CHTML"></script>
2020
{{ end }}
2121

2222
{{ if and (not .Params.disable_highlight) (in (string .Content) "</pre>") }}
23-
<script src="//cdn.bootcss.com/highlight.js/9.12.0/highlight.min.js"></script>
24-
<script src="//cdn.bootcss.com/highlight.js/9.12.0/languages/r.min.js"></script>
23+
<script src="//cdn.bootcss.com/highlight.js/11.3.1/highlight.min.js"></script>
2524
<script>
26-
hljs.configure({languages: []});
25+
hljs.configure({languages: ["r", "yaml", "tex"]});
2726
hljs.initHighlightingOnLoad();
2827
</script>
2928
{{ end }}
3029

31-
{{ template "_internal/google_analytics.html" . }}
32-
3330
</body>
3431
</html>

0 commit comments

Comments
 (0)