Giter Club home page Giter Club logo

hugo-c's Introduction

Partial-based (Component-based) Workspace for Hugo CMS Development

Rules

  • Do not code HTML, SCSS, JS in the global, shortcodes, [type]/[layout] folders.
  • For shortcodes and [content type]/[layout.html], you must include partials to render the template in HTML.

Global Rules

1. The src/layouts/global/global.scss file is only for:

  • Defining global SCSS variables for the partials.
  • Importing functions, mixins and variables from src/layouts/vendor/[library] folder.
  • Writing global code for all partials and pages. However, be careful!

2. The src/layouts/global/global.js file is only for:

  • Defining global JavaScript constants, variables for the partials.
  • Writing global code for all partials and pages. However, be careful!

Partial Rules

Only code HTML, SCSS, JS in the src/layouts/partials/app-[partial name] folders.

1. For app-[partial name].html, the HTML files should have comments likes this.

<section class="app-post-single">
  {{- .Content -}}
</section>
<!-- /.app-post-single -->

You can use this Emmet shortcut section.app-post-single|c and press tab to create the comments more quickly.

2. For app-[partial name].scss, your code must be in :host { ... } to avoid the CSS conflicts.

:host {
  color: black;
  background: white;
}
// Do not write your code out here.

3. For app-[partial name].js, you will use $(this) to select the current partial in DOM.

$(this).css('color', 'blue');
const partial = this;

$(partial).find('button').click(function() {
  $(partial).css('color', 'blue');
});

hugo-c's People

Contributors

viendinhcom avatar

Watchers

James Cloos avatar  avatar  avatar

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.