Skip to content

Commit c0b5fa8

Browse files
authored
Merge pull request #86 from KWB-R/dev
Release v0.2.0
2 parents 6e92047 + ce65b1d commit c0b5fa8

16 files changed

Lines changed: 75 additions & 182 deletions

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ secrets.csv
1414
^R\\.add_author.R$
1515
^\.travis\.yml$
1616
^\.github$
17+
^pkgdown$

DESCRIPTION

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: kwb.pkgbuild
22
Title: R package for standardised development at KWB
3-
Version: 0.1.9
3+
Version: 0.2.0
44
Authors@R:
55
c(person(given = "Michael",
66
family = "Rustler",
@@ -19,7 +19,7 @@ Authors@R:
1919
Description: Helper functions for automating R package development at KWB
2020
to a predefined style.
2121
License: MIT + file LICENSE
22-
URL: https://github.com/KWB-R/kwb.pkgbuild
22+
URL: https://kwb-r.github.io/kwb.pkgbuild, https://github.com/KWB-R/kwb.pkgbuild
2323
BugReports: https://github.com/KWB-R/kwb.pkgbuild/issues
2424
Imports:
2525
callr,
@@ -36,7 +36,6 @@ Imports:
3636
rematch2,
3737
sessioninfo,
3838
stringr,
39-
travis,
4039
usethis,
4140
withr,
4241
yaml
@@ -50,9 +49,8 @@ VignetteBuilder:
5049
knitr
5150
Remotes:
5251
github::kwb-r/kwb.orcid,
53-
github::kwb-r/kwb.utils,
54-
github::ropenscilabs/travis@f2dd9a3640b0cd8266b0a813c8eaf6bf3775c83d
52+
github::kwb-r/kwb.utils
5553
ByteCompile: true
5654
Encoding: UTF-8
5755
LazyData: true
58-
RoxygenNote: 7.1.1
56+
RoxygenNote: 7.1.2

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MIT License
22

3-
Copyright (c) 2018-2021 Kompetenzzentrum Wasser Berlin gGmbH (KWB)
3+
Copyright (c) 2018-2022 Kompetenzzentrum Wasser Berlin gGmbH (KWB)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MIT License
22

3-
Copyright (c) 2018-2021 Kompetenzzentrum Wasser Berlin gGmbH (KWB)
3+
Copyright (c) 2018-2022 Kompetenzzentrum Wasser Berlin gGmbH (KWB)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

NAMESPACE

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export(get_pkgname)
1111
export(git_check_config)
1212
export(git_setup_user)
1313
export(set_github_user)
14-
export(use_appveyor)
1514
export(use_autopkgdown)
1615
export(use_badge_appveyor)
1716
export(use_badge_codecov)
@@ -36,7 +35,6 @@ export(use_pkg)
3635
export(use_pkg_skeleton)
3736
export(use_pkgdown)
3837
export(use_readme_md)
39-
export(use_travis)
4038
export(write_to_gitignore)
4139
export(write_to_rbuildignore)
4240
importFrom(callr,rcmd)
@@ -58,6 +56,7 @@ importFrom(httr,GET)
5856
importFrom(httr,status_code)
5957
importFrom(kwb.utils,catAndRun)
6058
importFrom(kwb.utils,defaultIfNULL)
59+
importFrom(kwb.utils,isNaOrEmpty)
6160
importFrom(kwb.utils,selectElements)
6261
importFrom(magrittr,"%>%")
6362
importFrom(openssl,base64_decode)
@@ -77,5 +76,3 @@ importFrom(usethis,use_pkgdown)
7776
importFrom(usethis,use_template)
7877
importFrom(utils,tail)
7978
importFrom(withr,with_dir)
80-
importFrom(yaml,as.yaml)
81-
importFrom(yaml,write_yaml)

NEWS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# [kwb.pkgbuild 0.2.0](https://github.com/KWB-R/kwb.pkgbuild/releases/tag/v0.2.0) <small>2022-01-20</small>
2+
3+
* Documentation website with `pkgdown (>= 2.0.2)` and new [KWB website](https://kompetenz-wasser.de): - Design: now using `bootstrap5` and colors slightly adapted to KWB design.
4+
- URL to KWB logo was updated due to new website.
5+
- **Attention: URLs to projects (including logos) need to be corrected manually (for old `_pkgdown.yml` files**
6+
7+
* Deleted functions for unused CIs `travis` and `appveyor`
8+
9+
110
# [kwb.pkgbuild 0.1.9](https://github.com/KWB-R/kwb.pkgbuild/releases/tag/v0.1.9) <small>2021-09-10</small>
211

312
* Fix `Rcmdcheck` workflow on GitHub Actions by explicitly adding default organisation `GITHUB_PAT`

R/use_appveyor.R

Lines changed: 0 additions & 43 deletions
This file was deleted.

R/use_pkg.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ use_pkg <- function(
6363
}
6464

6565
# Create PKGDOWN YML
66-
use_pkgdown(author, copyright_holder$name)
66+
use_pkgdown(author, copyright_holder$name, pkg, user, domain)
6767

6868
# Update Github Actions
6969
use_ghactions()

R/use_pkgdown.R

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,62 @@
44
#' kwb.pkgbuild:::kwb_author("rustler"))
55
#' @param copyright_holder_name name of copyright holder
66
#' (default: kwb.pkgbuild:::kwb_string())
7+
#' @param pkg name of KWB package (default: get_pkgname())
8+
#' @param user name of GitHub user/organisation (default: 'kwb-r')
9+
#' @param domain name of domain for webpage publishing (default: 'github')
710
#' @return performs usethis::use_pkgdown() and additionally writes _pkgdown.yml
811
#' based on KWB styling
912
#' @importFrom usethis use_pkgdown
13+
#' @importFrom kwb.utils isNaOrEmpty
1014
#' @export
1115
use_pkgdown <- function(
1216
author = kwb_author("rustler"),
13-
copyright_holder_name = kwb_string()
17+
copyright_holder_name = kwb_string(),
18+
pkg = get_pkgname(),
19+
user = "kwb-r",
20+
domain = "github"
1421
)
1522
{
1623
usethis::use_pkgdown()
1724

25+
pkgdown_url <- ""
26+
27+
if(domain == "github" & !kwb.utils::isNaOrEmpty(pkg) & !kwb.utils::isNaOrEmpty(user)) {
28+
pkgdown_url <- yaml::as.yaml(list(url = sprintf("https://%s.github.io/%s",
29+
tolower(user),
30+
tolower(pkg)))
31+
)
32+
}
33+
1834
authors <- stats::setNames(list(list(href = author$url)), author$name)
1935

2036
if (copyright_holder_name == kwb_string()) {
2137

2238
authors <- c(authors, stats::setNames(nm = copyright_holder_name, list(list(
2339
href = "http://www.kompetenz-wasser.de",
2440
html = paste0(
25-
"<img src='http://www.kompetenz-wasser.de/wp-content/uploads/",
26-
"2017/08/cropped-logo-kwb_klein-new.png' height='24' />")
41+
"<img src='https://publications.kompetenz-wasser.de/img/KWB-Logo.svg",
42+
" alt='KWB' width='72' />")
2743
))))
2844
}
2945

46+
47+
design <- list(bootstrap = 5L,
48+
bootswatch = "cerulean",
49+
bslib = list(bg = "#ffffff",
50+
fg = "#000000",
51+
primary = "#007aff",
52+
`border-radius` = "0.5rem",
53+
`btn-border-radius` = "0.25rem"))
54+
3055
pkgdown_yaml <- yaml::as.yaml(list(
3156
authors = authors,
32-
template = list(params = list(bootswatch = "cerulean")),
57+
template = design,
3358
development = list(mode = "auto")
3459
))
3560

61+
pkgdown_yaml <- paste0(pkgdown_url, pkgdown_yaml)
62+
3663
writeLines(pkgdown_yaml, "_pkgdown.yml")
3764

3865
write_to_rbuildignore("^_pkgdown\\.yml$")

R/use_travis.R

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)