GithubHelp home page GithubHelp logo

fspoettel / blaupause Goto Github PK

View Code? Open in Web Editor NEW
73.0 4.0 11.0 11.83 MB

[NOT MAINTAINED] Use https://github.com/netlify-templates/victor-hugo instead

Home Page: https://blaupause.felics.me/

License: MIT License

JavaScript 82.57% HTML 12.48% CSS 4.96%
hugo pwa npm-scripts starter-kit

blaupause's Introduction

blaupause

Greenkeeper badge

blaupause is a hugo starter kit based on npm scripts, webpack and postcss. It helps with setting up a modern web development stack and adds offline support via a service worker.

In the box

  • hugo with a layout boilerplate
  • build process managed via npm scripts
  • Development Mode: sourcemaps, browserSync live-reloading environment and debugging helpers
  • Production Mode: optimized builds, offline support via a service worker

JavaScript

CSS

Images/SVG

  • Automatic svg sprites via svg-sprite
  • Hugo partial to embed svg sprite

Dev Tools

Installation

This project depends on NodeJS being installed on your machine. If the Hugo binary is not yet available on your $PATH, it will be installed during npm install.

To initiate a new site, run:

  1. git clone https://github.com/felics/blaupause project
  2. cd project
  3. npm install
  4. npm start

Tasks & Task Configuration

Tasks are managed via nps and live in package-scripts.js. The following tasks are exposed in package.json:

npm start

Compiles all assets and starts a development server. Whenever you change a source file, the BrowserSync instance will reload your connected browsers with the changes. Sourcemaps are enabled.

npm run start:staging

Same as npm:start, but with production-ready assets. No sourcemaps, resources are optimized and gzipped.

npm run build

Builds all content and assets from src to public. Generates a production-ready build:

  • The production baseUrl is applied by hugo
  • Draft entries are not included
  • Source maps are omitted
  • JS & CSS is minified, NODE_ENV=production is passed to the javascript build
  • A service worker is added to the build
  • Debug console statement called with utils/debug are stripped

npm run build:clean

Removes the public-folder (executed automatically when running npm run build or npm start).

npm run lint

Runs eslint & stylelint against your code.

npm run test

Runs jest unit tests

Hugo Partials

image/svg

Reference a SVG-symbol from /static/svg/sprite.symbol.svg by ID. The SVG build task will look for .svg-files in src/img and sub-directories. Usage:

  <div class="icon">{{ partial "media/svg" (dict "id" "the-icon" "class" "optional-class") }}</div>

Offline Support

The service worker in src provides basic offline capabilities and follows a networkFirst strategy for static files and a cacheFirst strategy for google fonts and images. This means that visitors will always see the latest content and styles when a network connection is available. After the first visit, webfonts and images will be served from the cache and visited pages will work offline. The last cached version of the page will be served in the event that a user has no network connection. If you do not have dynamic content and changing static files, consider configuring workbox to use precaching. That way, your whole page will work offline once a single URL is visited.

Deploying to Netlify

Netlify is the easiest deploy option for blaupause. To get started, you have to:

Now Netlify will build and deploy your site whenever you push to git.

You can also click this button:

Deploy to Netlify

It is also possible to roll your own deploy with CircleCI and AWS as an alternative.

Adding Netlify CMS

To add Netlify CMS, add the following files to the repo and configure according to the netlify-cms docs.

/hugo/static/admin/index.html

<!doctype html>
<html>
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Content Manager</title>

  <!-- Include the styles for the Netlify CMS UI, after your own styles -->
  <link rel="stylesheet" href="https://unpkg.com/netlify-cms@^0.7.0/dist/cms.css" />

</head>
<body>
  <!-- Include the script that builds the page and powers Netlify CMS -->
  <script src="https://unpkg.com/netlify-cms@^0.7.0/dist/cms.js"></script>
</body>
</html>

/hugo/static/admin/config.yml

backend:
  name: github # git-gateway if using Netlify Identity integration
  repo:  fspoettel/blaupause
  branch: master
  base_url: # See https://github.com/vencax/netlify-cms-github-oauth-provider or remove if using Netlify Identity
publish_mode: editorial_workflow
media_folder: "hugo/static/assets"
public_folder: "/assets"
collections: # See netlify-cms docs

blaupause's People

Contributors

felics avatar fspoettel avatar greenkeeper[bot] avatar greenkeeperio-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

blaupause's Issues

Test flexbox-grid fork

So far: Firefox 24+**
Chrome 32+
Safari 7+
IE 8_/9_/10
iOS 6_/7_
Android 4.0-4.2.2*

  • = Uses fallback-grid with display: block / display: inline-block

** = Uses fallback until FF 26 due to lack of flex-flow & flex-wrap support

2.0

  • Mobile: manifest.json, service workers, meta-tags
  • SSG: Add hugo
  • Meta: Add humans.txt & robots.txt
  • Structure: Restructure folders
  • SCSS: Add family.scss
  • Tests: Add AVA Unit Tests

Gulp tasks

  • Default: only build
    • Watch: Watch & hint
    • Hint: hint

Flex-box grid--rev allows opposite source-ordering

On browsers that support flexbox, .grid--rev turns the source-order around. it falls back to reversed rows on non-flexbox. Should this behavious be kept or should flex .grid--rev lose this feature in favor of consistency?
Main concern: FF >28, Mobile

Look into uncss

gulp-uncss could be used to prevent %extends tendency to make bullshit selectors on large pages with lots of grids and grid-modifiers.

Remove hint-task

  • Should be done in the editor, not on the output
  • Can be added back on a per-project basis

Hugo watch sometimes crashes and does not recover

  • browserSync cannot handle *.html without a <body> so a full reload is needed. This is not a bug
  • file-system warnings are a bug in node.js and generally do not crash the build task as they do not seem to trigger an event.js error anymore (fixed?)

This issue may be reopened once more errors in this domain are found

Leverage new Hugo Features (0.17-0.19)

  • Take advantage of the fact that HomePage is now a Page
  • Check if adding GitInfo to content makes sense
  • Check whether additional config should be provided for i18n Features
  • Set kind attribute on pages

Modernizr grid support

1.) Introduce a variable $grid__useModernizr.
2. ) Default it to false.
3.) if checked, remove flex-box-styles from .grid-classes into .flexbox .grid...
4.) Maybe isolate FF bug with this?

Reason: Seperate flexbox from fallback-grid.

Add grid-tests

Since this project uses a fork of csswizardry-grids based on flexbox w/ fallbacks, tests are needed

An in-range update of stylelint is breaking the build 🚨

Version 7.11.1 of stylelint just got published.

Branch Build failing 🚨
Dependency stylelint
Current Version 7.11.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As stylelint is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Release Notes 7.11.1
  • Fixed: media-feature-name-*list now accept arrays for their primary options (#2632).
  • Fixed: selector-* now ignore custom property sets (#2634).
  • Fixed: selector-pseudo-class-no-unknown now ignores Less :extend (#2625).
Commits

The new version differs by 10 commits.

  • 3ae1b72 Add an ignorePattern example for URL in comments in max-line-length (#2635)
  • c0b3e17 Prepare 7.11.1
  • 239e749 Add an ignorePattern test for URLs in comments in max-line-length (#2636)
  • d092c46 Create CHANGELOG.md
  • 9baf0d0 Fixed: ignore custom property sets in selector rules. (#2634)
  • f3f4fd2 Create CHANGELOG.md
  • 861a1bd Fixed: media-feature-name-whitelist and media-feature-name-blacklist now accept array as first option. (#2632)
  • 76df61d Create CHANGELOG.md
  • 93fb065 Fixed: ignore less :extend in selector-pseudo-class-no-unknown. (#2625)
  • d229a67 chore(package): update del to version 3.0.0 (#2616)

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Look into Assemble

Assemble could be a viable alternative for small pages and generated with gulp. Using yeoman, one could then distinguish between Statamic or Assemble or nothing pages.

Add a thorough readme / wiki

Should contain:

  • File structure / reasoning
  • scss principles, structure, defaults
  • Information about Gulp-process

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.