Code Monkey home page Code Monkey logo

bitrock-website's Introduction

bitrock-website

./src/.vuepress/public/BitrockLogo.svg

Build Status

This website is a VuePress instance with a custom theme applied on it, you can read the official documentation to learn how to edit contents or how the theme works.

Requisites

You need the following software installed in your machine in order to get started:

  • Node.js latest stable
  • Yarn package manager Both can be installed via Homebrew on MacOS & Linux environments.

Create a local development environment

Clone the repo locally

$ git clone [email protected]:bitrockteam/bitrock-website.git

Move on the folder and install dependencies with Yarn

$ cd bitrock-website && yarn

Start the development webserver on localhost:8080

$ yarn start

Authoring

Content is provided via Markdown files in the ./src folder, there is no built-in visual editor so they can be authored wherever you want, but in order. Vue components are supported within the Markdown content and it may be considered to add some custom components to enable authors with extra capabilities. Metadata are provided using the Frontmatter specification.

Add a page

Create a subfolder in the ./src path and then create a readme.md file within it, on top of the file add the following data:

---
layout: Page
---

Example: the ./src/about-us/readme.md file will become the https://bitrock.it/about-us page.

To add a page in the navigation menu the ./src/.vuepress/config.js must be updated.

Add a blog post

Create a subfolder in the ./src/blog path and then create a readme.md file within it, on top of the file add the following data:

---
title: Hello world!
image: /img/hello.jpg
author: writer
publish: 2018-12-21
layout: Post
category: news
tags:
  - greetings
  - hello
---

Example: the ./src/blog/hello-world/readme.md file will become the https://bitrock.it/blog/hello-world page.

Posts will be displayed on reversed-chronological order (latest first) on the main page.

Images

Site-wide images must be added in the ´./src/.vuepress/public/img´ folder. Note that if you add an image within a post or page folder, it will not be reachable outside of the page url using a relative path.

There isn't an automated optimization process so be careful on the size of the images you are publishing.

Development

All of the development source files are located within the ./src/.vuepress/theme folder.

The ./src/.vuepress/public is where to put any kind of assets that needs to be available as static resources on the root level of the deploy domain. Subfolders will be preserved.

Vuepress plugins

  • @vuepress/plugin-google-analytics giving the Google Analytics monitoring ID, it will inject in the pages the required code.
  • @vuepress/plugin-pwa it generates a Services Worker on build phase mapping all the static assets for offline caching. It will not generate the webmanifest required to trigger PWA functionalities, which is authored manually and served in the public folder.
  • @vuepress/plugin-back-to-top it simply add the back to top arrow button after scrolling down a bit from the initial viewport.
  • @vuepress/nprogress adds the progress bar on top of the pages when loading new content, similar to what happens in YouTube.

JS utilities

The main dependency here is the Vue.js library which is used to build the components, everything else is Vanilla Javascript.

CSS utilities

We are using this CSS libraries:

  • normalize.css makes browsers render all elements more consistently and in line with modern standards.
  • typebase.css a starting point for web typography.
  • hamburgers CSS-animated hamburgers menu.

Branching policy

This project follows a simple branching policy:

  • master contains only stable code, and should not be updated directly
  • development where evolved or experimental code is written
  • gh-pages where the distributable static files are deployed but ** you should avoid to directly commit/push here**

Do NOT merge directly development into master (it's admin-locked...), always send a PR to have a review.

Update & deploy

Every time the master branch get updated (a direct commit or a merged PR) a new Travis CI job is triggered and it composed of these steps:

  1. install dependencies
  2. Vuepress builds the website with all related files on /dist folder
  3. if build is successful the /dist folder is then deployed on GitHub Pages
  4. the new deploy is available at bitrock.it

There is an NPM script available to manually deploy in the gh-pages branch from your local machine (you must first build the project locally):

$ yarn gh:pages

But please use it only if it is really needed.

License

The Databiz Group, Bitrock and Radicalbit logos are registered trademarks. Code is distributed under the GNU AGPLv3 license. Included stock photos have been provided by Unsplash.

bitrock-website's People

Contributors

alessandromenini avatar asm72 avatar axys avatar dependabot[bot] avatar erikfazio avatar gargangela avatar moebiusmania avatar mzzfederico avatar ripmace avatar stiv avatar stivbitrock avatar zhango90 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bitrock-website's Issues

v3.0 checklist

Things to keep in mind for the next major iteration:

  • all main issues from v2.x resolved
  • updated UI
    • cards with only image and title
    • different masonry layout
    • based on the Amber Design System
    • filter & search posts in home page
    • better preload animation/effect
  • Content
    • add "cluster" custom taxonomy

some of this stuff may (or may not) be resolved before the v3.0 milestone.

SSR on bot requests

Create a service that could server-side-render (using Puppeteer) a specific route of the application and serve it on request's by bots (social network's link preview fetch, non-Google search engine, complements with #8 ).

Can be developed right now but it depends on #2 to be deployed and integrated.

Mirror databiz.it project structure

  • update and version-lock dependencies (resolve GitHub warning)
  • migrate from webpack-dev-server to webpack-serve
  • migrate from standalone Workbox module to workbox-webpack-plugin
  • remove unneeded actions and modules

3 columns layout in homepage

I think the UX could be a little bit better with 3-column layout in homepage instead of the actual 4-column one. The cards could be a little bit shorter and the texts more legible.

remove hash (#) from routing

After resolving #2 , we can remove the hash from the routing and use the pushStateAPI, so we can resolve urls like https://bitrock.it/academy

  • remove useHash: true from Router5 conf
  • ~~~add a 404.html file which will be a copy of index.html ~~~

Pagination

Design and implement a basic pagination for posts at the bottom of the home page, and reset the post-per-page request to 9.

update readme

Better explains project structure, workflows and how to update things.
A bit clean-up of the project would be useful too...

Back to home breaks everything

Changing page and trying to go back to home (via browser history or click on logo) throws a Javascript exception that trigger an incosistent and blocking state.

screen shot 2018-09-04 at 18 03 12

Http redirect to https

Whenver the site is not loaded from https or loads a non https resource, browsers may throw warnings or exception.
It is needed to redirect each http request to https in order to prevent this kind of issues.

adopt http-pwa-server

For the deploy strategy we are moving from serving a static page on a simple http server to serving it on a Node.js server, since we need to have a server that:

  • supports client-side routing (without hash, see #16 )
  • redirect requests from http to https (see #4 )
  • supports server-side rendering with Puppeteer
  • detects bots/spider/crawler request and serve SSR pages (see #9 )

and the http-pwa-server module does almost everything of this (except the http redirect part, but we can easily add it).

This are also the reasons why we are moving from the previous proposal of GitHub Pages to Heroku (see #2 ).

On local development the webpack-dev-server is still fine.

Reordering problem on "Load more" in news section

The news loading is first vertical and then horizontal, this means that once the first column is filled it start to put elements on the second column. The problem is once I click on "Load more", the items will be reordered and the news on the second column are moved to the first column and so on. This could cause some confusion to the visitor.

pre

post

"update available" notification

Add this functionality for PWA version users to let them update theri local version, like this

https://deanhume.com/content/images/2018/05/new-version-available.PNG

@RipMace may be our man here, since he has already done some research on the topic.

add tablet media query

Adding a tablet media query allow some rules specific for tablet devices. For example the homepage could have 3 columns on desktops, 2 columns on tablets and 1 column on mobile phones.

refactor to VuePress

Motivation:

Giving the nature of a simple corporate website with few updates a nice solution to achieve simplicity, performance and separation of contents from (dynamic) templates can be found in VuePress, since we are now growing quite confindents with it.

Switching to VuePress we can return to publish the website on GitHub pages since the result will be a static page, removing the need of a platform (and costs) as Heroku + SiteGround and the maintenance of a dedicated WordPress instance, while keeping al current advantages.

We can also add and external CMS UI to let non-technical users editing the contents of the website.

Taskslist:

  • create a branch to setup the new VuePress v1.0 project
  • move contents to static .md files
  • plugins to install
  • custom components to develop
  • apply CSS from current version
  • add in public folder
    • static assets
  • update TravisCI config to new build pipeline
  • PWA compliant
  • update readme
  • bitrock.it domain to point GitHub page

og metadata

Updates the page Openg Graph's metadata (used by social network to fetch data and render link preview) on route change.

The PWA-helpers package has a nice utility for this.

tests setup

Define tests setup and a couple of examples

  • Unit tests: Ava
  • E2E: Cypress
  • add in Travis CI build pipeline

Move to Heroku and add CI

Point the domain https://bitrock.it to the GitHub Page related to this repo (https://bitrockteam.github.io/bitrock-website/) and add Travis CI integration to automate the update & deploy process.

  • bitrock.it domain pointing to Heroku deploy
  • add Travis CI config
  • build pipeline working
  • Travis deploying to Heroku

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.