Skip to content

Latest commit

 

History

History
100 lines (72 loc) · 2.95 KB

File metadata and controls

100 lines (72 loc) · 2.95 KB

Creating posts

You can use the initpost.sh to create your new posts. Just follow the command:

./initpost.sh -c Post Title

The new file will be created at _posts with this format date-title.md.

Front-matter

When you create a new post, you need to fill the post information in the front-matter, follow this example:

---
layout: post
title: "Falando sobre RSCSS"
image: '/assets/img/rscss/rscss.png'
main-class: 'css'
tags:
- css
- metodologia
- frontend
categoriesintroduction: 'Escrevendo CSS sem perder a sanidade. Com essa introdução, Rico St. Cruz o criador chama a atenção de todos sobre uma metodologia melhor para se escrever CSS.'
---

Running the blog in local

Windows quick setup

PowerShell (run as administrator once to allow package installs):

# clone repo if you haven't already
# git clone https://github.com/rubygsoc/rubygsoc.github.io.git
Set-Location rubygsoc.github.io
npm run setup:local          # installs tools, ruby gems and npm deps
npm run verify:local         # sanity-check environment + security heuristics

If you'd prefer to run the steps manually:

# install system tools via winget
winget install --id RubyInstallerTeam.RubyWithDevKit.3.3 --silent
winget install --id CoreyButler.NVMforWindows --silent

# open a new terminal after nvm installation, then:

nvm install 12.22.12
nvm use 12.22.12             # required for gulp@3 compatibility

ruby -v                     # should show a 3.x interpreter
gem install bundler jekyll   # install jekyll locally
npm install                  # fetch Javascript dependencies
npx gulp js                  # build minified JS
npx gulp stylus              # compile stylus -> css
jekyll build                 # generate the site

Note: the blog uses an old Gulp 3 pipeline which only works reliably with Node 12.22.12. You will need to switch to that version using nvm use 12.22.12 before running gulp tasks.

Security verification

Two helper scripts have been added to catch common issues:

node .\scripts\check_search_json.js        # warns if search.json output looks unsafe
node .\scripts\check_target_blank_rel.js . # ensure external links include rel noopener/noreferrer

They are invoked automatically by npm run verify:local.

If you see the following error during Linux setup:

Error: watch /path_to_folder/rubygsoc.github.io/src/styl/ ENOSPC

you need to increase system limit on the number of files you can monitor (Read more):

sudo sysctl fs.inotify.max_user_watches=524288

Adding a new main-class

main-class is used to categorize projects. If you need a new main-class

  • add it in themes in src/styl/_theme-colors.styl:
themes = {
    post-bundler: #0e8ab3,
    post-jruby: #2DA0C3,
    ...
    post-newclass: #hexcolor
}
  • create a category template for your new main-class: category/newclass.html