Skip to content

Commit eb465f3

Browse files
committed
fix: fix docs
1 parent 7bc57fb commit eb465f3

File tree

2 files changed

+89
-9
lines changed

2 files changed

+89
-9
lines changed

.github/workflows/pkgdown.yaml

Lines changed: 78 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,82 @@ jobs:
3535
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
3636
shell: Rscript {0}
3737

38-
- name: Deploy to GitHub pages 🚀
39-
if: github.event_name != 'pull_request'
40-
uses: JamesIves/[email protected]
38+
- name: Checkout blog repository
39+
uses: actions/checkout@v4
4140
with:
42-
clean: false
43-
branch: gh-pages
44-
folder: docs
41+
repository: DiogoRibeiro7/DiogoRibeiro7.github.io
42+
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
43+
path: blog-repo
44+
45+
- name: Copy package docs to blog
46+
run: |
47+
# Create the packages directory in blog if it doesn't exist
48+
mkdir -p blog-repo/packages/myrpackage
49+
50+
# Copy the built documentation
51+
cp -r docs/* blog-repo/packages/myrpackage/
52+
53+
# Update navigation and create index page
54+
cd blog-repo
55+
56+
- name: Create package index page
57+
run: |
58+
cat > blog-repo/packages/index.md << 'EOF'
59+
---
60+
layout: single
61+
title: "R Packages"
62+
permalink: /packages/
63+
author_profile: true
64+
header:
65+
image: /assets/images/data_science_1.jpg
66+
overlay_image: /assets/images/data_science_1.jpg
67+
teaser: /assets/images/data_science_1.jpg
68+
show_overlay_excerpt: false
69+
twitter_image: /assets/images/data_science_1.jpg
70+
og_image: /assets/images/data_science_1.jpg
71+
seo_type: article
72+
---
73+
74+
# R Packages
75+
76+
This section contains documentation for R packages I've developed.
77+
78+
## Available Packages
79+
80+
### [myrpackage](/packages/myrpackage/)
81+
82+
A multilingual greeting and farewell package that demonstrates proper R package structure, documentation, and testing practices. It provides functions for greeting and saying farewell in multiple languages including English, Spanish, French, Portuguese, German, and Italian.
83+
84+
**Features:**
85+
- Multilingual greetings and farewells
86+
- Comprehensive documentation and examples
87+
- Full test coverage
88+
- Proper R package structure
89+
- CI/CD pipeline with GitHub Actions
90+
91+
[View Documentation →](/packages/myrpackage/)
92+
EOF
93+
94+
- name: Update main navigation
95+
run: |
96+
# Create navigation entry for packages if it doesn't exist
97+
if ! grep -q "packages" blog-repo/_data/navigation.yml; then
98+
cat >> blog-repo/_data/navigation.yml << 'EOF'
99+
100+
- title: "Packages"
101+
url: /packages/
102+
EOF
103+
fi
104+
105+
- name: Commit and push changes
106+
run: |
107+
cd blog-repo
108+
git config --local user.email "[email protected]"
109+
git config --local user.name "GitHub Action"
110+
git add .
111+
if git diff --staged --quiet; then
112+
echo "No changes to commit"
113+
else
114+
git commit -m "Update myrpackage documentation"
115+
git push
116+
fi

_pkgdown.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
url: https://diogoribeiro7.github.io/myrpackage/
1+
url: https://diogoribeiro7.github.io/packages/myrpackage/
22

33
template:
44
bootstrap: 5
@@ -21,7 +21,7 @@ authors:
2121
navbar:
2222
structure:
2323
left: [intro, reference, articles, news, tutorials]
24-
right: [search, github]
24+
right: [search, github, blog]
2525
components:
2626
articles:
2727
text: Articles
@@ -40,6 +40,9 @@ navbar:
4040
news:
4141
text: News
4242
href: news/index.html
43+
blog:
44+
text: "← Back to Blog"
45+
href: https://diogoribeiro7.github.io/
4346

4447
reference:
4548
- title: "Main Functions"
@@ -56,7 +59,7 @@ reference:
5659

5760
home:
5861
sidebar:
59-
structure: [links, license, community, citation, authors, dev]
62+
structure: [links, license, community, citation, authors, dev, blog_link]
6063
components:
6164
citation:
6265
title: Citation
@@ -66,3 +69,8 @@ home:
6669
text: >
6770
If you have questions or issues about the package, please file an issue on
6871
[GitHub](https://github.com/DiogoRibeiro7/myrpackage/issues).
72+
blog_link:
73+
title: "Data Science Blog"
74+
text: >
75+
Check out my [data science blog](https://diogoribeiro7.github.io/) for more content
76+
on statistics, machine learning, and R programming.

0 commit comments

Comments
 (0)