Giter Club home page Giter Club logo

jk-demainilpleut's Introduction

jk-demainilpleut

/!\ This repo is now archived, please see nowjveillet/demainilpleut.dev

Static HTML version of demainilpleut.dev using the static website generator Jekyll.

Installation

This project uses Node.js, Gulp, PostCSS as dependencies to build an minify the CSS and JS.

On the ruby side, this project uses Bundler.

With Docker

$ git clone [email protected]:jveillet/jk-demainilpleut.git
$ cd jk-demainilpleut/
# Build the docker container and install Gems dependencies and NPM dependencies
$ docker-compose build
# Run the tasks to build the CSS and JS
$ docker-compose run --rm web gulp build
# Lint the CSS and JS (required before commiting any CSS and/or JS updates).
$ docker-compose run --rm web gulp lint
# Launch the Jekyll build and start the server
$ docker-compose up
# (or)
$ docker-compose run --rm web bundle exec jekyll serve -H 0.0.0.0 --incremental
# The server will run on port 8080 (see docker-compose.yml)

On linux (Debian 8+)

# Add the latest node version to the sources
$ curl -sL https://deb.nodesource.com/setup_14.x | bash - \
# Install Node and Gulp
$ apt-get install -y nodejs
$ npm install -g gulp-cli
# Install the JS dependencies
$ npm install
# Run the tasks to build the CSS and JS
$ gulp build
# Lint the CSS and JS (required before commiting any CSS and/or JS updates).
$ gulp lint

On macOS (Sierra+)

$ brew install node
# Install Gulp
$ npm install -g gulp-cli
# Install the JS dependencies
$ npm install
# Run the tasks to build the CSS and JS
$ gulp build
# Lint the CSS and JS (required before commiting any CSS and/or JS updates).
$ gulp lint

Build and launch the Jekyll project (every OS)

$ git clone [email protected]:jveillet/jk-demainilpleut.git
$ cd jk-demainilpleut/
# Install the gem and dependecies the blog needs
$ bundle install
# Launch the Jekyll build and start the server
$ bundle exec jekyll serve --incremental
# The server will run on port 4000

Individual Tasks

# Building CSS (assets will be compiled and installed in assets/css/)
$ gulp build:css
# Building Javascript (assets will be compiled and installed in assets/js/)
$ gulp build:js
# Global build (CSS + JS, compiled and installed into their relative folders in assets/)
$ gulp build
# Linting CSS (lint every individual component from the _assets/css/ folder)
$ gulp lint:css
# Linting JS (lint every individual scripts from the _assets/js/ folder)
$ gulp lint:js
# Global codebase linting (CSS + JS)
$ gulp lint
# Delete bundled CSS and JS files
$ gulp clean

Tests

Basic tests are performed on the structure of the site (broken links, alt attributes on images,..), by using the html-proofer Ruby Gem.

They are launched automatically with every Pull Requests, via GitHub Actions (see cibuild.yml file).

You can run them manually via command line:

./bin/cibuild.sh

Or with Docker:

docker-compose run --rm web bin/cibuild.sh

Contributing

To the code

This project only accepts Pull Requests that references an issue.

  1. Fork it http://github.com/jveillet/jk-demainilpleut/fork
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Run the specs and our linter (bin/cibuild)
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create new Pull Request

To the articles

  1. Fork it http://github.com/jveillet/jk-demainilpleut/fork
  2. Create your feature branch for the new page (git checkout -b page/my-post-title)
  3. Create a post with the help of the command line: bundle exec jekyll post "My post title", or a draft: bundle exec jekyll draft "My post title"
  4. When you are ready, publish the post or draft: bundle exec jekyll publish _drafts/my-post-title.md. You can specify a date by using the --date argument.
  5. Push to the branch (git push origin page/my-post-title)
  6. Create new Pull Request

jk-demainilpleut's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar jveillet avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

jk-demainilpleut's Issues

Toggle visibility of the code snippets in the Styleguide

As a user of the styleguide, I want to be able to toggle the visibility of the code snippets.

Description

Add a link to toggle the visibility of the code snippets before every <code> block.
Make it default to hide the code snippet.
Change the text of the link to display "hide code snippet" when code snippet is visible. "display code snippet" should be displayed when the code snippet is visible.

References

Override the site URL at build time

As a developer, I would like to be able to override the site URL at build time, so that I can test fully locally without overriding the _config.yml and I can test also on CI or QA instance with a custom URL.

Goal

  • Create an environment variable SITE_URL with the desired URL to use.
  • Create an environment variable OVERRIDE_SITE_URL with values true|false.
  • Add these variables on the EnvironmentVariableGenerator class.

Add dev.to social icon

As a contributor, I would like to be able to add a link to my dev.to profile in the authors card.

  • Add icon for dev.to (svg and png format).
  • modify CSS to add the social item.
  • Add the markup in the templates (author template and post template).

Tags/categories are not displaying well on mobile

On a mobile device, and small screens, the tags are not staking well when there is 2 lines of them, they are overlapping on each other.

Design a better displaying mode, for example inlining them on small screens.

Add a link to RSS/Atom feed in the footer

As a reader, I would like to see a link to the RSS feed of the Blog.

  • Add an RSS feed link at the bottom of the website, in the footer section, under the Menu items.

Respect the "Do Not Track" (DNT) browser feature

As the website is collecting data for analytics using google analytics, it's important to respect the people that have set the "Do Not Track" feature included in their browsers.

Detect DNT using Javascript and therefor disable the GA tracking on the website.

Implement this in the analytics template file.

Liquid warnings in several files since v3.7.0

Description

There is several warnings during Jekyll build process, since the new version 3.7.0

Deprecation: The 'gems' configuration option has been renamed to 'plugins'. Please update your config file accordingly. web_1 | Source: /home/app web_1 | Destination: /home/app/_site web_1 | Incremental build: enabled web_1 | Generating... web_1 | Liquid Warning: Liquid syntax error (line 10): Unexpected character # in "{{ # site.data.authors }}" in author/index.html web_1 | Liquid Warning: Liquid syntax error (line 12): Expected id but found pipe in "{{ post.excerpt || strip_links || strip_imgs }}" in index.html web_1 | Liquid Warning: Liquid syntax error (line 17): Expected id but found pipe in "{{ post.excerpt || strip_links || strip_imgs }}" in /_layouts/archives-month.html web_1 | Liquid Warning: Liquid syntax error (line 17): Expected id but found pipe in "{{ post.excerpt || strip_links || strip_imgs }}" in /_layouts/archives-month.html web_1 | Liquid Warning: Liquid syntax error (line 17): Expected id but found pipe in "{{ post.excerpt || strip_links || strip_imgs }}" in /_layouts/archives-month.html web_1 | Liquid Warning: Liquid syntax error (line 17): Expected id but found pipe in "{{ post.excerpt || strip_links || strip_imgs }}" in /_layouts/archives-month.html web_1 | Liquid Warning: Liquid syntax error (line 17): Expected id but found pipe in "{{ post.excerpt || strip_links || strip_imgs }}" in /_layouts/archives-month.html web_1 | Liquid Warning: Liquid syntax error (line 17): Expected id but found pipe in "{{ post.excerpt || strip_links || strip_imgs }}" in /_layouts/archives-month.html web_1 | Liquid Warning: Liquid syntax error (line 12): Expected id but found pipe in "{{ post.excerpt || strip_links || strip_imgs }}" in page/2/index.html web_1 | Liquid Warning: Liquid syntax error (line 12): Expected id but found pipe in "{{ post.excerpt || strip_links || strip_imgs }}" in page/3/index.html

Create an assets directory

As a developer/maintainer, I would like to have all my static files (minus HTML) into an assets folder.

Goal

  • Create an assets folder at the root of the project.
  • Add a css folder into it and place it the generated CSS files.
  • Add a js folder into it and place it the generated JS files.
  • Add an images folder into it and place all the images of the project.
  • Rename the styles folder into css, then change the gulp tasks accordingly with the correct name for input folder, and output folder.

Remove time from the timestamp in the Articles

The articles pages are displaying the timestamp on the header, with dates and time of posting. The time part isn't bringing any value, so I suggest we remove it from the UI.

Ex: July 17, 2018 at 18:00 > July 17, 2018

Design a new layout for archives

The archives pages have a design that doesn't quite match the rest of the website.

Goal

Review how the design is done on the different archives pages and found a new layout that integrates better with the rest of the blog.

Update links on the pages with the host

The different links pointing to parts of the site are all relatives to the current path on the blog. We need to add the host to every one of them to make sure they point to an https resource.

Goal

  • Update links on the top bar.
  • Update links on the footer.
  • Update links in on the front page.
  • Update links in the archive pages.
  • Update links in the author pages.

Javascript error on an Article page

Context

When browsing a single page, there is a Javascript error displaying in the console, because a script is failing to display a marker on one menu item.

Error Message

Unhandled Promise Rejection: TypeError: null is not an object (evaluating '$(".page-"+path[1]).classList')

OS/Browser

  • MacOS High Sierra 10.13.6 (17G65)
  • Chrome v68.0.3440.106
  • Safari v11.1.2 (13605.3.8)

Steps to reproduce

  • Go on the Home Page
  • Click on one article to display it
  • See the error message displaying in the Console

Expected Result

The Console should be empty and the script should not fail. Nothing should be highlighted in the menu has we are in a subcategory.

Dockerfile is not building anymore

Since v1.0.3, the Dockerfile isn't building anymore on a local environment. NPM packages fails to install, and bundler dependencies cannot be installed after the container is built.

Fix this by making the Dockerfile more about development environment, using a sudo user.

Use a template to generate the responsive images markup

Today we are writing the responsive image markup manually into the posts, for each images we need in articles.

What we need to simplify things, is using a reusable template to simplify the process and having the same markup for responsive image everywhere.

References:

Missing Pull Request Template

Description

A Pull Request template file is missing for the repository.

Add a template with instructions on how to contribute to the project.

Remove the use of document.write

As Google lighthouse prescribe, do not use Javascript function document.write into the footer of the page. It can slow down the rendering of the page on slow connections.

Goal

Remove document.write, and use a native Ruby function to handle the generation of the footer date.

Create a template for authors links

As a maintainer, I would like to have a template for authors links, so that I don't have to modify everywhere in the code base when a change is made for authors.

Goal

  • Create a new layout for authors.
  • Call this new layout everywhere the author links appears.

Better handling of social accounts on the Author card

As a contributor, I want to display only the social account that I've set up in the authors.yml file.

Description

Present situation: the social icons displayed on the Author card are the same for all the potential contributors, even if they didn't set up the values on the authors.yml file.

Proposed solution

Add conditionals on all the possible social accounts to display or not the accounts based on the values of the authors.yml file.

Change Dockerfile build process

Description

  • Use Heroku 16 image instead of Heroku 16-build.
  • Use a non-root user to execute container.
  • Change the way to install Bundler and Nodejs.
  • Update Package.json
  • Don't install gems in a dedicated container (this will save space).

v2.1.0 Update Styleguide

Update the styleguide to reflect the UI changes introduced in the v2.1.0 complete with the code samples.

Upgrade to Heroku 18 Docker image

As the new Heroku environment is migrating to Heroku-18 (based on Ubuntu), use the new base Docker image to be aligned with Heroku.

Update Readme

Description

Update the README.md with new usage instruction for Docker.

Move icons for dev environment into a separate folder

As a maintainer, I want to not have the annoying warnings for icons when I am in development mode.

Goal

  • Add a sub-folder dev in the img folder.
  • Move the icons for development into this folder.
  • Change the meta tags to point to this new resource.

Change tags display on the footer

As a user, I want to be able to see at first sight the tags in the footer.

Change the link display of the footer tags to better distinguish them.

  • Add a hashtag (#) before the tag name.
  • Choose a different color for the hashtag, use the color-primary-darker from the Styleguide.

Separate every element of the UI into components

With the growing codebase of this blog, we need to separate every component into its CSS file.

  • Create a hierarchy of folders and file by component (ex: topbar/topbar.css)
  • Create a build task that combine/concatenate and minify this into a style.css or bundle.css

Add a DockerIgnore file

Description

Add a .dockerignore file to exclude certain directories and files from the Docker build process.

Study the possibility to build the css with Gulp on Heroku

Actual Behavior:
CSS file and it's minified version; plus the source maps, are hosted on the repository and have to be build locally and manually before pushing on the repo. If this step is not done, then we could have discrepencies between production and development.

Expected behavior:
We only host the base CSS file, and the sourcemap and the minified version are build when the app is built on Heroku.

References:

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.