From f5baf857d2f90abb7f9d72e3f09efccbfab8cee8 Mon Sep 17 00:00:00 2001 From: timurgordon Date: Wed, 3 Apr 2024 01:32:35 -0400 Subject: [PATCH 1/3] update documentation --- CONTRIBUTING.md | 18 ++++++++++++ README.md | 69 ++++++++++++++------------------------------ content/_index.md | 10 ------- playbook/1_define.md | 1 + playbook/2_people.md | 6 ++-- playbook/3_news.md | 12 ++++++++ start.sh | 28 ++++-------------- 7 files changed, 61 insertions(+), 83 deletions(-) create mode 100644 CONTRIBUTING.md delete mode 100644 content/_index.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..4f7ec432a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,18 @@ +![readme](https://user-images.githubusercontent.com/43240801/236867088-56c95abd-510c-4202-b0c5-317cdfb75cb3.png) + +It is highly important to follow this procedure to contribute to the website content.
+__WARNING__: DO NOT commit straight into the __master__ / __development__ branches. + +1. Feel free to [create a new issue](https://github.com/threefoldfoundation/www_threefold_io/issues/new) to report an error on the website, or if you have any suggestions on website improvements. + +2. Make your own branch from the __development__ branch. By creating a new branch from __development__ you will be provided with the latest copy of the live website content at the staging site, www2.threefold.io. + +3. Add your edits into your own branch via code editor locally, and push your local changes online. WARNING: DO NOT add your edits straight into __master__ / __development__ branch. + +5. Create a PR to merge your own branch into **development**, and assign one of [ThreeFold's Web Admins](https://github.com/orgs/threefoldfoundation/teams/team_web_admin) on your PR as reviewer, or assign @sasha-astiadi as reviewer. + +7. When PR is approved, you can see your changes on staging env on www2.threefold.io (development branch) + +8. Admin will then create a PR to merge **development** into into **master** (production branch) + +10. When PR is approved, you can see your changes live on production www.threefold.io (master branch). \ No newline at end of file diff --git a/README.md b/README.md index 0e0bf30b1..c1c84bebd 100644 --- a/README.md +++ b/README.md @@ -1,69 +1,42 @@ -# Welcome to Welcome to ThreeFold Website RepositoryWebsite Repository +# Threefold Website +Official website for Threefold. -![](./static/images/tf_logo.png) +**Administration & Access** -## About +This website is administered by [ThreeFold's Web Admins](https://github.com/orgs/threefoldfoundation/teams/team_web_admin). Publishing changes directly to `development` and `master` branches requires access for repository admins. Please see [contribution procedures](CONTRIBUTING.md) for more information. -The official website of ThreeFold Foundation.
+**Deployment** +- Production: [www.threefold.io](https://www.threefold.io) (`master` branch) +- Staging: [www2.threefold.io](https://www2.threefold.io) (`development` branch) -Production: [www.threefold.io](https://www.threefold.io) (master branch) +## Getting started -Staging: www2.threefold.io (development branch) +1. Install `hero` if you don't have it +```bash +curl https://raw.githubusercontent.com/freeflowuniverse/crystallib/development/scripts/installer_hero.sh > /tmp/hero_install.sh +bash /tmp/hero_install.sh +``` -Last Updated: May 2023 +1. Clone repository -## Administrators -[ThreeFold's Web Admins](https://github.com/orgs/threefoldfoundation/teams/team_web_admin) +2. edit content or playbook -## Contribution Procedure +3. run playbook to preview website in browser -![readme](https://user-images.githubusercontent.com/43240801/236867088-56c95abd-510c-4202-b0c5-317cdfb75cb3.png) +`hero zola -u https://github.com/threefoldfoundation/www_threefold_io/tree/development_zola/playbook` or `bash start.sh` -It is highly important to follow this procedure to contribute to the website content.
-__WARNING__: DO NOT commit straight into the __master__ / __development__ branches. - -1. Feel free to [create a new issue](https://github.com/threefoldfoundation/www_threefold_io/issues/new) to report an error on the website, or if you have any suggestions on website improvements. - -2. Make your own branch from the __development__ branch. By creating a new branch from __development__ you will be provided with the latest copy of the live website content at the staging site, www2.threefold.io. - -3. Add your edits into your own branch via code editor locally, and push your local changes online. WARNING: DO NOT add your edits straight into __master__ / __development__ branch. - -5. Create a PR to merge your own branch into **development**, and assign one of [ThreeFold's Web Admins](https://github.com/orgs/threefoldfoundation/teams/team_web_admin) on your PR as reviewer, or assign @sasha-astiadi as reviewer. - -7. When PR is approved, you can see your changes on staging env on www2.threefold.io (development branch) - -8. Admin will then create a PR to merge **development** into into **master** (production branch) - -10. When PR is approved, you can see your changes live on production www.threefold.io (master branch). +4. save and publish changes ## Development -While contributing content to this site doesn't strictly require setting up a development environment, it will allow you to preview your changes and that's super handy. +This website is built with `hero`, using `zola` under the hood. -To do that, the following prerequisites are needed: +Please see -* macOS or Linux -* [Zola](https://www.getzola.org/documentation/getting-started/installation/) - -Then clone the repository recursively to also pull in contents of `threefold_data`: - -``` -git clone --recursive https://github.com/threefoldfoundation/www_threefold_io.git -``` - -Now run `build.sh` to download Tailwind, build the CSS, and also build the site with Zola: - -``` -cd www_threefold_io -bash build.sh -``` Finally, start a browsable local copy of the site that will respond to changes in the source files like this: -``` -zola serve -``` Zola will display a local address such as `http://127.0.0.1:1111` which you can click or copy and paste into your browser to view the site on your own machine. -That's it—have fun! \ No newline at end of file +That's it—have fun! diff --git a/content/_index.md b/content/_index.md deleted file mode 100644 index a52f4f969..000000000 --- a/content/_index.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "Home" -description: "ThreeFold is the world’s first system enabling anyone to become a cloud and internet service provider." # quotation marks to allow colons where used -date: 2018-09-14T21:00:00-05:00 -updated: 2021-02-20T14:40:00-06:00 -draft: false -extra: - author: Your name here - imgPath: home/header_new.jpeg ---- \ No newline at end of file diff --git a/playbook/1_define.md b/playbook/1_define.md index 075209e26..e25e4c206 100644 --- a/playbook/1_define.md +++ b/playbook/1_define.md @@ -6,6 +6,7 @@ We first define our website and add our zola template to it. !!website.define name:'www2_threefold' title:'Threefold Development' + description: "ThreeFold is the world’s first system enabling anyone to become a cloud and internet service provider." !!website.template_add url:'https://github.com/freeflowuniverse/webcomponents/tree/main/zola' ``` diff --git a/playbook/2_people.md b/playbook/2_people.md index e0b6cdc92..67a77496a 100644 --- a/playbook/2_people.md +++ b/playbook/2_people.md @@ -1,9 +1,8 @@ ## People -Here, we add the people we want to display in the people page. The people we want to add are defined in the `people` collection, so we need to add the file from the `people` collection which defines the person. +In this page, we add the people we want to display in the people section. The people we want to add are defined in the `people` collection of `threefold_data`, so we need to add the file from the `people` collection which defines the person. - -Note that the order we add the people determines the order in which they are listed in. +First we define the title and description of our people section. ```js !!website.people_add @@ -13,6 +12,7 @@ Note that the order we add the people determines the order in which they are lis ``` +Note that above we chose to sort by the order we add the people. As such, the order below determines the order in which they are listed in. ```js !!website.person_add pointer:'people:kristof_de_spiegeleer.md' diff --git a/playbook/3_news.md b/playbook/3_news.md index 9a602ae5a..769c21409 100644 --- a/playbook/3_news.md +++ b/playbook/3_news.md @@ -1,5 +1,17 @@ ## News +We add a news section to our website: + +```js +!!website.news_add + title: 'News' + sort_by: date +``` + +Note that we chose the template + +we add the news articles we want to display in the news section section. The people we want to add are defined in the `people` collection of `threefold_data`, so we need to add the file from the `people` collection which defines the person. + ```js !!website.news_add pointer:'newsroom:2020_rewind_grid_24.md' !!website.news_add pointer:'newsroom:2021_review_2022_preview.md' diff --git a/start.sh b/start.sh index 4a8094af7..bcb2877f6 100755 --- a/start.sh +++ b/start.sh @@ -1,25 +1,9 @@ -# builds if executable isn't foound -if [ ! -f "tailwindcss" ] +# install hero if not installed +if [ ! -f "hero" ] then - sh build.sh + curl https://raw.githubusercontent.com/freeflowuniverse/crystallib/development/scripts/installer_hero.sh > /tmp/hero_install.sh + bash /tmp/hero_install.sh fi -# initialized and configures tailwind if not configured -if [ ! -f "tailwind.config.js" ] -then - ./tailwindcss init - sed -i '' "s| content: \\[\\],| content: \\['./templates/**/*.html'\\],|g" tailwind.config.js -fi - -# compiles tailwind css & launches locally -rm -rf public static/css -./tailwindcss -i css/index.css -o ./static/css/index.css --watch & zola serve & - -# compiles tailwind css for prod & builds project -./tailwindcss -i css/index.css -o ./static/css/index.css --minify -zola build - -# kills zola and tw bg processes on interrupt -trap 'kill $(jobs -p); exit 1' INT -wait - +# run playbook +hero zola -u https://github.com/threefoldfoundation/www_threefold_io/tree/development_zola/playbook From 1ea47ed1e2df34c3cace553af4e7143dfc92e8dc Mon Sep 17 00:00:00 2001 From: timurgordon Date: Wed, 3 Apr 2024 01:48:13 -0400 Subject: [PATCH 2/3] fix playbook --- playbook/3_news.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/playbook/3_news.md b/playbook/3_news.md index 769c21409..65780c9a5 100644 --- a/playbook/3_news.md +++ b/playbook/3_news.md @@ -1,15 +1,5 @@ ## News -We add a news section to our website: - -```js -!!website.news_add - title: 'News' - sort_by: date -``` - -Note that we chose the template - we add the news articles we want to display in the news section section. The people we want to add are defined in the `people` collection of `threefold_data`, so we need to add the file from the `people` collection which defines the person. ```js From 459629ddaf6752a0e5027c58f0c7075e4df6cd58 Mon Sep 17 00:00:00 2001 From: timurgordon Date: Wed, 3 Apr 2024 10:16:06 -0400 Subject: [PATCH 3/3] add pull param to script --- playbook/1_define.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/playbook/1_define.md b/playbook/1_define.md index e25e4c206..0629a51d0 100644 --- a/playbook/1_define.md +++ b/playbook/1_define.md @@ -8,7 +8,9 @@ We first define our website and add our zola template to it. title:'Threefold Development' description: "ThreeFold is the world’s first system enabling anyone to become a cloud and internet service provider." -!!website.template_add url:'https://github.com/freeflowuniverse/webcomponents/tree/main/zola' +!!website.template_add + url:'https://github.com/freeflowuniverse/webcomponents/tree/main/zola' + pull: true ``` Then we add the [doctrees]() we will use for the website. When we add a doctree, all [collections]() from the doctree are imported and available to be used in building our website. @@ -18,9 +20,15 @@ We use the following doctrees in our website: - `threefoldfoundation/www_threefold_io` for site content for pages. ```js // add collections to the website using their github url -!!website.doctree_add url:'https://github.com/threefoldfoundation/www_threefold_io/tree/development_zola/content' +!!website.doctree_add + url:'https://github.com/threefoldfoundation/www_threefold_io/tree/development_zola/content' + branch: development_zola + pull: true -!!website.doctree_add url:'https://github.com/threefoldfoundation/threefold_data/tree/development_zola/content' + +!!website.doctree_add + url:'https://github.com/threefoldfoundation/threefold_data/tree/development_zola/content' + pull: true ``` _Note that you can also use a specific branch for your doctrees_ \ No newline at end of file