marineenergy / www

Marine hydrokinetic energy & environmental compliance, website
https://marineenergy.app
MIT License
1 stars 1 forks source link

upgrade to bootstrap4 using bslib #23

Closed bbest closed 2 years ago

bbest commented 3 years ago

Currently, this www website, especially the index.html, uses the html output of Rmarkdown with bootstrap 3 with then the bootstrap 4 (that added cards functionality) hard coded into the page by dept-11.com and Ben.

Ideally, we could have an Rmarkdown website still generating the home page and others using the _site.yml for generating nav menus and Bootstrap 4 now made available via bslib.

I recommend building up to the current site from a plain Rmd website rather than pare down from existing. Let's start with a new repo.

bbest commented 3 years ago

Ok, starting with new repo www_bs4

bbest commented 3 years ago

Per https://github.com/marineenergy/www_bs4/commit/40e7fea4c482f5062830d8ac5a986e5bc2550033 added nav bar, body, footer and images for homepage:

image ... image

bbest commented 3 years ago

Turned on Github Pages, so now it's visible here:

https://marineenergy.github.io/www_bs4

bbest commented 3 years ago

Needed to manually modify site_libs/bootstrap-4.5.3/bootstrap.min.css/bootstrap.min.css so it imports relative to current page:

@import url(../../libs/styles-dept11-bs4.css)

not absolute file reference to my machine (must be a bug in bslib?):

@import url(/Users/bbest/github/marineenergy/www_bs4/libs/styles-dept11-bs4.css)

to avoid error in JS Console at https://marineenergy.github.io/www_bs4

GET https://marineenergy.github.io/Users/bbest/github/marineenergy/www_bs4/libs/styles-dept11-bs4.css net::ERR_ABORTED 404
bbest commented 3 years ago

Also interesting and worthwhile backgrounder on SASS/CSS with R Shiny/Rmd:

bbest commented 3 years ago

Doh! Having trouble installing bslib on server....


> install.packages("bslib")
Installing package into ‘/usr/local/lib/R/site-library’ (as ‘lib’ is unspecified) Warning in install.packages :   package ‘bslib’ is not available (for R version 4.0.2)

> remotes::install_github("rstudio/bslib")
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
  namespace ‘htmltools’ 0.5.0 is being loaded, but >= 0.5.1 is required
Calls: <Anonymous> ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace
Execution halted
ERROR: lazy loading failed for package ‘sass’
* removing ‘/usr/local/lib/R/site-library/sass’
* restoring previous ‘/usr/local/lib/R/site-library/sass’
Error: Failed to install 'bslib' from GitHub:
  Failed to install 'sass' from GitHub:
  (converted from warning) installation of package ‘/tmp/Rtmp5m2v2z/filee6f4639b70f/sass_0.3.1.9001.tar.gz’ had non-zero exit status
geocoug commented 2 years ago

Integrated bslib locally, but having trouble installing on server: https://github.com/marineenergy/www/issues/23#issuecomment-813669543

Started new app splash under branch splash_dev

Splash page using bslib and Bootstrap v5. See latest @ https://github.com/marineenergy/apps/commit/0b255d49a70b0c9fd0f46af687e534f8c51d24e9#commitcomment-57202933

bbest commented 2 years ago

Hey @geocoug,

Ok, I got bslib installed on the server with the following sequence of dependent source R package installs:

remotes::install_github("r-lib/fastmap")
remotes::install_github("rstudio/htmltools")
remotes::install_github("rstudio/sass")
remotes::install_github("rstudio/bslib")
geocoug commented 2 years ago

Done per 60fceb8fc924791e13e537450f22dffb882a0635. Follow #24 for additional updates.