Skip to content

Commit

Permalink
✨ 🌟 Nouveau thème hugo 🐍 🔥 (#105)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
linogaliana committed May 12, 2021
1 parent 175d377 commit 4cdb759
Show file tree
Hide file tree
Showing 66 changed files with 1,700 additions and 537 deletions.
6 changes: 5 additions & 1 deletion .Rprofile
Expand Up @@ -3,7 +3,8 @@ if (file.exists("~/.Rprofile")) {
}

options(blogdown.new_bundle = TRUE)
options(blogdown.hugo.version = "0.64.1")
options(blogdown.hugo.version = "0.83.0")
options(blogdown.method = 'markdown')


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


message("For local preview when the pages are built: blogdown::hugo_build(local = TRUE)")



20 changes: 20 additions & 0 deletions .editorconfig
@@ -0,0 +1,20 @@
# editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.toml]
max_line_length = 100

[*.md]
trim_trailing_whitespace = false

[layouts/shortcodes/*.html]
insert_final_newline = false
4 changes: 2 additions & 2 deletions .github/workflows/netlify-test.yaml
Expand Up @@ -22,9 +22,10 @@ jobs:
run: |
Rscript -e 'install.packages(c("rmarkdown"))'
- name: install hugo
run: Rscript -e 'blogdown::install_hugo()'
run: Rscript -e 'blogdown::install_hugo("0.83.0", force = TRUE)'
- name: Install Python
run: |
Rscript -e 'print(blogdown:::hugo_version())'
Rscript -e "install.packages(c('remotes', 'reticulate'))"
Rscript -e "install.packages(c('here'))"
- shell: bash -l {0}
Expand All @@ -34,7 +35,6 @@ jobs:
- name: Render blog
run: |
Rscript -e 'source("./build/build.R")'
Rscript -e 'blogdown::hugo_build(local = TRUE)'
- name: Install npm
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
uses: actions/setup-node@v2
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/prod.yml
Expand Up @@ -55,7 +55,7 @@ jobs:
run: |
Rscript -e 'install.packages(c("rmarkdown"))'
- name: install hugo
run: Rscript -e 'blogdown::install_hugo()'
run: Rscript -e 'blogdown::install_hugo("0.83.0")'
- name: Install Python
run: |
Rscript -e "install.packages(c('remotes', 'reticulate'))"
Expand All @@ -67,7 +67,6 @@ jobs:
- name: Render blog
run: |
Rscript -e 'source("./build/build.R")'
Rscript -e 'blogdown::hugo_build(local = TRUE)'
- name: Install npm
if: ${{ github.repository == 'linogaliana/python-datascientist' }}
uses: actions/setup-node@v2
Expand Down
11 changes: 10 additions & 1 deletion .gitignore
@@ -1,9 +1,15 @@
# Created by https://www.toptal.com/developers/gitignore/api/pycharm,venv
# Edit at https://www.toptal.com/developers/gitignore?templates=pycharm,venv

!themes/github.com/

.idea/
content/**/*.html
content/**/*.png
content/**/*.md
content/**/*.json
content/**/data/*

**/.ipynb_checkpoints/

temp/
Expand All @@ -15,9 +21,12 @@ Thumbs.db

.matplotlib/
__pycache__/
content/**/.png


# Hugo
resources/
jsconfig.json

### PyCharm ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
Expand Down
6 changes: 3 additions & 3 deletions .gitmodules
@@ -1,3 +1,3 @@
[submodule "themes/hugo-theme-techdoc"]
path = themes/hugo-theme-techdoc
url = https://github.com/linogaliana/hugo-theme-techdoc.git
[submodule "themes/github.com/wowchemy"]
path = themes/github.com/wowchemy
url = https://github.com/linogaliana/wowchemy-template.git
Empty file added assets/images/.gitkeep
Empty file.
Empty file.
118 changes: 118 additions & 0 deletions assets/scss/custom.scss
@@ -0,0 +1,118 @@
.panel-exercise,
.panel-warning,
.panel-caution,
.panel-danger,
.panel-error,
.panel-hint,
.panel-tip,
.panel-important,
.panel-note,
.panel-attention{
margin:1.5625emauto;
padding:0 .6rem .8rem!important;overflow:hidden;
page-break-inside:avoid;
/*border-left:.2rem solid #dc3545;*/
border-radius:.1rem;
box-shadow:0 .2rem .5rem rgba(0,0,0,.05),0 0 .05rem rgba(0,0,0,.1);
transition:color .25s,background-color .25s,border-color .25s
}
.panel-warning {
border-left:.2rem solid #dc3545;
}
.panel-caution {
border-left:.2rem solid #fd7e14;
}
.panel-danger {
border-left:.2rem solid #dc3545;
}
.panel-error {
border-left:.2rem solid #dc3545;
}
.panel-hint {
border-left:.2rem solid #ffc107;
}
.panel-tip {
border-left:.2rem solid #ffc107;
}
.panel-important {
border-left:.2rem solid #007bff;
}
.panel-note {
border-left:.2rem solid #007bff;
}
.panel-attention {
border-left:.2rem solid #fd7e14;
}
.panel-exercise {
border-left:.2rem solid #008000;
}

.panel-header-exercise,
.panel-header-warning,
.panel-header-caution,
.panel-header-danger,
.panel-header-error,
.panel-header-hint,
.panel-header-tip,
.panel-header-important,
.panel-header-note,
.panel-header-attention{
/*background-color:#fdf3f2;*/
position:relative;
margin:0 -.6rem!important;
padding:.4rem .6rem .4rem 2rem;
font-weight:700;
}


.panel-body-exercise,
.panel-body-warning,
.panel-body-caution,
.panel-body-danger,
.panel-body-error,
.panel-body-hint,
.panel-body-tip,
.panel-body-important,
.panel-body-note,
.panel-body-attention{
padding: 20px 0px;
}

.panel-header-exercise{
background-color:#98fb98
}
.panel-header-warning{
background-color:#dc3545
}
.panel-header-caution{
background-color:#fd7e14
}
.panel-header-error{
background-color:#dc3545
}
.panel-header-hint{
background-color:#fff6dd
}
.panel-header-tip{
background-color:#fff6dd
}
.panel-header-important{
background-color:#e7f2fa
}
.panel-header-note{
background-color:#e7f2fa
}
.panel-header-attention{
background-color:#ffedcc
}
.panel-header-danger{
background-color:#fdf3f2
}

.panel h3{
margin-top: 0rem;
}

a img{
display: inline;
}
50 changes: 46 additions & 4 deletions build/build.R
@@ -1,24 +1,66 @@
content_rmd <- list.files("./content", recursive = TRUE, pattern = "*.Rmd", full.names = TRUE)

file.remove(
gsub(
".Rmd",".html", list.files("./content", recursive = TRUE, pattern = "*.Rmd", full.names = TRUE)
".Rmd",".html", content_rmd
)
)

lapply(
list.files("./content", recursive = TRUE, pattern = "*.Rmd", full.names = TRUE), function(i){
content_rmd, function(i){
print(sprintf("Rendering %s", i))
rmarkdown::render(i, envir = new.env())
knitr::knit(i, envir = new.env(), output = gsub(".Rmd", ".md", i))
})

file.remove(
gsub(
".Rmd",".html", list.files("./content", recursive = TRUE, pattern = "*.Rmd", full.names = TRUE)
".Rmd",".html", content_rmd
)
)




Sys.setenv(HUGO_IGNOREERRORS = "error-remote-getjson",
HUGO_BASEURL = "/",
#HUGO_BASEURL = "https://linogaliana-teaching.netlify.app/",
HUGO_RELATIVEURLS = "false",
BLOGDOWN_POST_RELREF = "true",
BLOGDOWN_SERVING_DIR = here::here())

cmd = blogdown:::find_hugo()
cmd_args = c("--themesDir themes", "-t github.com")#, "--gc")#, "--minify")
system2(cmd, cmd_args)


#blogdown::stop_server()


# Sys.setenv(HUGO_RELATIVEURLS = "true",
# BLOGDOWN_POST_RELREF = "true")

# cmd = blogdown:::find_hugo()

#blogdown:::create_shortcode('postref.html', 'blogdown/postref', TRUE)

# cmd_args = c("--themesDir themes", "-t github.com")#, "--gc")#, "--minify")
# system2(cmd, cmd_args)

#blogdowntest::serve_site()

# file.remove(
# gsub(
# ".Rmd",".md", list.files("./content", recursive = TRUE, pattern = "*.Rmd", full.names = TRUE)
# )
# )

# file.remove(
# gsub(
# ".Rmd",".ipynb", list.files("./content", recursive = TRUE, pattern = "*.Rmd", full.names = TRUE)
# )
# )





0 comments on commit 4cdb759

Please sign in to comment.