Skip to content

Commit 4cdb759

Browse files
authored
✨ 🌟 Nouveau thème hugo 🐍 🔥 (#105)
Adaptation du site web à un thème wowchemy 😣 Rendu plus ergonomique ✨ 🌟 avec des améliorations notables: * intégration des figures plotly * TOC à gauche et droite * tags * boutons next/previous * ensemble plus lisible
1 parent 175d377 commit 4cdb759

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1700
-537
lines changed

.Rprofile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ if (file.exists("~/.Rprofile")) {
33
}
44

55
options(blogdown.new_bundle = TRUE)
6-
options(blogdown.hugo.version = "0.64.1")
6+
options(blogdown.hugo.version = "0.83.0")
7+
options(blogdown.method = 'markdown')
78

89

910
reminder_jupyter <- function(file = "./content/getting-started/06_rappels_classes.Rmd",
@@ -95,3 +96,6 @@ reminder_box <- function(boxtype = "warning", type = c("html","markdown")){
9596

9697

9798
message("For local preview when the pages are built: blogdown::hugo_build(local = TRUE)")
99+
100+
101+

.editorconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
indent_size = 2
9+
indent_style = space
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[*.toml]
14+
max_line_length = 100
15+
16+
[*.md]
17+
trim_trailing_whitespace = false
18+
19+
[layouts/shortcodes/*.html]
20+
insert_final_newline = false

.github/workflows/netlify-test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ jobs:
2222
run: |
2323
Rscript -e 'install.packages(c("rmarkdown"))'
2424
- name: install hugo
25-
run: Rscript -e 'blogdown::install_hugo()'
25+
run: Rscript -e 'blogdown::install_hugo("0.83.0", force = TRUE)'
2626
- name: Install Python
2727
run: |
28+
Rscript -e 'print(blogdown:::hugo_version())'
2829
Rscript -e "install.packages(c('remotes', 'reticulate'))"
2930
Rscript -e "install.packages(c('here'))"
3031
- shell: bash -l {0}
@@ -34,7 +35,6 @@ jobs:
3435
- name: Render blog
3536
run: |
3637
Rscript -e 'source("./build/build.R")'
37-
Rscript -e 'blogdown::hugo_build(local = TRUE)'
3838
- name: Install npm
3939
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
4040
uses: actions/setup-node@v2

.github/workflows/prod.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
run: |
5656
Rscript -e 'install.packages(c("rmarkdown"))'
5757
- name: install hugo
58-
run: Rscript -e 'blogdown::install_hugo()'
58+
run: Rscript -e 'blogdown::install_hugo("0.83.0")'
5959
- name: Install Python
6060
run: |
6161
Rscript -e "install.packages(c('remotes', 'reticulate'))"
@@ -67,7 +67,6 @@ jobs:
6767
- name: Render blog
6868
run: |
6969
Rscript -e 'source("./build/build.R")'
70-
Rscript -e 'blogdown::hugo_build(local = TRUE)'
7170
- name: Install npm
7271
if: ${{ github.repository == 'linogaliana/python-datascientist' }}
7372
uses: actions/setup-node@v2

.gitignore

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
# Created by https://www.toptal.com/developers/gitignore/api/pycharm,venv
22
# Edit at https://www.toptal.com/developers/gitignore?templates=pycharm,venv
33

4+
!themes/github.com/
45

56
.idea/
67
content/**/*.html
8+
content/**/*.png
9+
content/**/*.md
10+
content/**/*.json
11+
content/**/data/*
12+
713
**/.ipynb_checkpoints/
814

915
temp/
@@ -15,9 +21,12 @@ Thumbs.db
1521

1622
.matplotlib/
1723
__pycache__/
18-
content/**/.png
1924

2025

26+
# Hugo
27+
resources/
28+
jsconfig.json
29+
2130
### PyCharm ###
2231
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
2332
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

.gitmodules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
[submodule "themes/hugo-theme-techdoc"]
2-
path = themes/hugo-theme-techdoc
3-
url = https://github.com/linogaliana/hugo-theme-techdoc.git
1+
[submodule "themes/github.com/wowchemy"]
2+
path = themes/github.com/wowchemy
3+
url = https://github.com/linogaliana/wowchemy-template.git

assets/images/.gitkeep

Whitespace-only changes.

assets/images/icon-pack/.gitkeep

Whitespace-only changes.

assets/scss/custom.scss

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
.panel-exercise,
2+
.panel-warning,
3+
.panel-caution,
4+
.panel-danger,
5+
.panel-error,
6+
.panel-hint,
7+
.panel-tip,
8+
.panel-important,
9+
.panel-note,
10+
.panel-attention{
11+
margin:1.5625emauto;
12+
padding:0 .6rem .8rem!important;overflow:hidden;
13+
page-break-inside:avoid;
14+
/*border-left:.2rem solid #dc3545;*/
15+
border-radius:.1rem;
16+
box-shadow:0 .2rem .5rem rgba(0,0,0,.05),0 0 .05rem rgba(0,0,0,.1);
17+
transition:color .25s,background-color .25s,border-color .25s
18+
}
19+
.panel-warning {
20+
border-left:.2rem solid #dc3545;
21+
}
22+
.panel-caution {
23+
border-left:.2rem solid #fd7e14;
24+
}
25+
.panel-danger {
26+
border-left:.2rem solid #dc3545;
27+
}
28+
.panel-error {
29+
border-left:.2rem solid #dc3545;
30+
}
31+
.panel-hint {
32+
border-left:.2rem solid #ffc107;
33+
}
34+
.panel-tip {
35+
border-left:.2rem solid #ffc107;
36+
}
37+
.panel-important {
38+
border-left:.2rem solid #007bff;
39+
}
40+
.panel-note {
41+
border-left:.2rem solid #007bff;
42+
}
43+
.panel-attention {
44+
border-left:.2rem solid #fd7e14;
45+
}
46+
.panel-exercise {
47+
border-left:.2rem solid #008000;
48+
}
49+
50+
.panel-header-exercise,
51+
.panel-header-warning,
52+
.panel-header-caution,
53+
.panel-header-danger,
54+
.panel-header-error,
55+
.panel-header-hint,
56+
.panel-header-tip,
57+
.panel-header-important,
58+
.panel-header-note,
59+
.panel-header-attention{
60+
/*background-color:#fdf3f2;*/
61+
position:relative;
62+
margin:0 -.6rem!important;
63+
padding:.4rem .6rem .4rem 2rem;
64+
font-weight:700;
65+
}
66+
67+
68+
.panel-body-exercise,
69+
.panel-body-warning,
70+
.panel-body-caution,
71+
.panel-body-danger,
72+
.panel-body-error,
73+
.panel-body-hint,
74+
.panel-body-tip,
75+
.panel-body-important,
76+
.panel-body-note,
77+
.panel-body-attention{
78+
padding: 20px 0px;
79+
}
80+
81+
.panel-header-exercise{
82+
background-color:#98fb98
83+
}
84+
.panel-header-warning{
85+
background-color:#dc3545
86+
}
87+
.panel-header-caution{
88+
background-color:#fd7e14
89+
}
90+
.panel-header-error{
91+
background-color:#dc3545
92+
}
93+
.panel-header-hint{
94+
background-color:#fff6dd
95+
}
96+
.panel-header-tip{
97+
background-color:#fff6dd
98+
}
99+
.panel-header-important{
100+
background-color:#e7f2fa
101+
}
102+
.panel-header-note{
103+
background-color:#e7f2fa
104+
}
105+
.panel-header-attention{
106+
background-color:#ffedcc
107+
}
108+
.panel-header-danger{
109+
background-color:#fdf3f2
110+
}
111+
112+
.panel h3{
113+
margin-top: 0rem;
114+
}
115+
116+
a img{
117+
display: inline;
118+
}

build/build.R

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,66 @@
1+
content_rmd <- list.files("./content", recursive = TRUE, pattern = "*.Rmd", full.names = TRUE)
12

23
file.remove(
34
gsub(
4-
".Rmd",".html", list.files("./content", recursive = TRUE, pattern = "*.Rmd", full.names = TRUE)
5+
".Rmd",".html", content_rmd
56
)
67
)
78

89
lapply(
9-
list.files("./content", recursive = TRUE, pattern = "*.Rmd", full.names = TRUE), function(i){
10+
content_rmd, function(i){
1011
print(sprintf("Rendering %s", i))
11-
rmarkdown::render(i, envir = new.env())
12+
knitr::knit(i, envir = new.env(), output = gsub(".Rmd", ".md", i))
1213
})
1314

1415
file.remove(
1516
gsub(
16-
".Rmd",".html", list.files("./content", recursive = TRUE, pattern = "*.Rmd", full.names = TRUE)
17+
".Rmd",".html", content_rmd
1718
)
1819
)
1920

21+
22+
23+
24+
Sys.setenv(HUGO_IGNOREERRORS = "error-remote-getjson",
25+
HUGO_BASEURL = "/",
26+
#HUGO_BASEURL = "https://linogaliana-teaching.netlify.app/",
27+
HUGO_RELATIVEURLS = "false",
28+
BLOGDOWN_POST_RELREF = "true",
29+
BLOGDOWN_SERVING_DIR = here::here())
30+
31+
cmd = blogdown:::find_hugo()
32+
cmd_args = c("--themesDir themes", "-t github.com")#, "--gc")#, "--minify")
33+
system2(cmd, cmd_args)
34+
35+
36+
#blogdown::stop_server()
37+
38+
39+
# Sys.setenv(HUGO_RELATIVEURLS = "true",
40+
# BLOGDOWN_POST_RELREF = "true")
41+
42+
# cmd = blogdown:::find_hugo()
43+
44+
#blogdown:::create_shortcode('postref.html', 'blogdown/postref', TRUE)
45+
46+
# cmd_args = c("--themesDir themes", "-t github.com")#, "--gc")#, "--minify")
47+
# system2(cmd, cmd_args)
48+
49+
#blogdowntest::serve_site()
50+
2051
# file.remove(
2152
# gsub(
2253
# ".Rmd",".md", list.files("./content", recursive = TRUE, pattern = "*.Rmd", full.names = TRUE)
2354
# )
2455
# )
56+
57+
# file.remove(
58+
# gsub(
59+
# ".Rmd",".ipynb", list.files("./content", recursive = TRUE, pattern = "*.Rmd", full.names = TRUE)
60+
# )
61+
# )
62+
63+
64+
65+
66+

0 commit comments

Comments
 (0)