mirror of https://github.com/luizdepra/hugo-coder.git

Luiz F. A. de Prá
4 days ago 011adf79ec795af29e06f393c9eb774a4b09cce4
Install tooling
4 files modified
5 files added
105 ■■■■ changed files
.editorconfig 33 ●●●●● patch | view | raw | blame | history
.github/pull_request_template.md 1 ●●●● patch | view | raw | blame | history
.gitignore 2 ●●●●● patch | view | raw | blame | history
.pre-commit-config.yaml 9 ●●●●● patch | view | raw | blame | history
.prettierignore 5 ●●●●● patch | view | raw | blame | history
Makefile 12 ●●●●● patch | view | raw | blame | history
package.json 20 ●●●●● patch | view | raw | blame | history
prettier.config.js 14 ●●●●● patch | view | raw | blame | history
stylelint.config.js 9 ●●●●● patch | view | raw | blame | history
.editorconfig
@@ -1,29 +1,24 @@
# https://editorconfig.org
# this file is the top-most editorconfig file
root = true
# all files
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
# markdown files
[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
# configuration files
[*.toml]
indent_size = 2
# web files
[*.{html,css,scss}]
indent_size = 2
[Makefile]
indent_style = tab
[*.md]
trim_trailing_whitespace = false
[*.scss]
indent_size = 2
[*.js]
indent_size = 2
[*.html]
indent_size = 2
.github/pull_request_template.md
@@ -26,6 +26,7 @@
#### Resources
- [ ] If you changed templates or styles, run `make format`
- [ ] If you have changed any SCSS code, run `make release` to regenerate all CSS files
#### Contributors
.gitignore
@@ -3,4 +3,6 @@
exampleSite/public/
exampleSite/resources/
*.lock
package-lock.json
node_modules
public
.pre-commit-config.yaml
New file
@@ -0,0 +1,9 @@
repos:
  - repo: local
    hooks:
      - id: lint
        name: npm run lint
        entry: npm run lint
        language: system
        pass_filenames: false
        always_run: true
.prettierignore
New file
@@ -0,0 +1,5 @@
node_modules/
resources/
exampleSite/resources/
assets/scss/font-awesome/
layouts/_markup/render-heading.html
Makefile
@@ -1,6 +1,6 @@
HUGO_BIN=hugo
.PHONY: build demo release
.PHONY: build demo release lint format setup
build:
    $(HUGO_BIN) --themesDir=../.. --source=exampleSite
@@ -10,3 +10,13 @@
release: build
    rm -rf ./resources && cp -r ./exampleSite/resources ./resources
setup:
    npm install
    prek install
lint:
    npm run lint
format:
    npm run format
package.json
New file
@@ -0,0 +1,20 @@
{
  "name": "hugo-coder",
  "private": true,
  "scripts": {
    "lint:html": "prettier --check \"layouts/**/*.html\" \"exampleSite/**/*.html\"",
    "lint:scss": "stylelint \"assets/scss/**/*.scss\"",
    "lint": "npm run lint:html && npm run lint:scss",
    "format:html": "prettier --write \"layouts/**/*.html\" \"exampleSite/**/*.html\"",
    "format:scss": "stylelint --fix \"assets/scss/**/*.scss\"",
    "format": "npm run format:html && npm run format:scss"
  },
  "devDependencies": {
    "postcss-scss": "^4.0.9",
    "prettier": "^3.3.3",
    "prettier-plugin-go-template": "^0.0.15",
    "stylelint": "^16.5.0",
    "stylelint-config-standard-scss": "^13.0.0",
    "stylelint-scss": "^6.5.0"
  }
}
prettier.config.js
New file
@@ -0,0 +1,14 @@
module.exports = {
  plugins: ["prettier-plugin-go-template"],
  printWidth: 100,
  tabWidth: 2,
  useTabs: false,
  overrides: [
    {
      files: ["*.html"],
      options: {
        parser: "go-template"
      }
    }
  ]
};
stylelint.config.js
New file
@@ -0,0 +1,9 @@
module.exports = {
  extends: ["stylelint-config-standard-scss"],
  customSyntax: "postcss-scss",
  ignoreFiles: [
    "assets/scss/font-awesome/**/*.scss",
    "resources/**/*.scss",
    "exampleSite/resources/**/*.scss"
  ]
};