From beb2156b47d7cf3e1052e4350fda999e668cfff4 Mon Sep 17 00:00:00 2001 From: Ronny Abraham Date: Thu, 11 Apr 2019 01:51:25 +0300 Subject: [PATCH] updated readmes and added new ones --- share/templates/readmes/aws.md | 13 ++- share/templates/readmes/fontawesome.md | 35 ++++++++ share/templates/readmes/foundation.md | 109 +++++++++++++++++++++++++ share/templates/readmes/sass.md | 2 + 4 files changed, 155 insertions(+), 4 deletions(-) create mode 100644 share/templates/readmes/fontawesome.md create mode 100644 share/templates/readmes/foundation.md diff --git a/share/templates/readmes/aws.md b/share/templates/readmes/aws.md index dde69de..eaffcfe 100644 --- a/share/templates/readmes/aws.md +++ b/share/templates/readmes/aws.md @@ -147,9 +147,8 @@ replace it with: ssh-keygen -y -f /path/to/myinstance.pem -2. copy the above results. on osx this would look like: +2. copy the above results - ssh-keygen -y -f /path/to/myinstance.pem | pbcopy 3. log in to the ubuntu instance using default ubuntu user 4. change users to the custom username @@ -162,9 +161,15 @@ replace it with: mkdir .ssh touch .ssh/authorized_keys vim ~/.ssh/authorized_keys + +6. change the permissions -6. now paste in the public_key you got in step 1 -7. log out and test with the username + chown -R username:username_gropus .ssh + chmod 700 .ssh + chmod 600 .ssh/authorized_keys + +7. now paste in the public_key you got in step 1 +8. log out and test with the username ssh username@instance.domain diff --git a/share/templates/readmes/fontawesome.md b/share/templates/readmes/fontawesome.md new file mode 100644 index 0000000..556e0c9 --- /dev/null +++ b/share/templates/readmes/fontawesome.md @@ -0,0 +1,35 @@ +###specify the font path to the "webfonts directory" + +$fa-font-path: "../node_modules/@fortawesome/fontawesome-free/webfonts" !default; + +###when importing from an app-local installation: + +in this case "coffesshop" is the name of the app + +`@import 'coffeeshop/node_modules/\@fortawesome/fontawesome-free/scss/fontawesome'` +`@import 'coffeeshop/node_modules/\@fortawesome/fontawesome-free/scss/solid'` +`@import 'coffeeshop/node_modules/\@fortawesome/fontawesome-free/scss/brands'` + +### when importing from a shared directory + +#### set the location in static and sass + +`STATICFILES_DIRS = [ + os.path.join( + PROJECT_ROOT, + 'share/media/node_modules/@fortawesome'), +]` + +`SASS_PROCESSOR_INCLUDE_DIRS = [ + os.path.join( + PROJECT_ROOT, + 'share/media/node_modules/@fortawesome'), +]` + +#### now import directly from where you set loc above + +`@import 'fontawesome-free/scss/fontawesome'` +`@import 'fontawesome-free/scss/solid'` +`@import 'fontawesome-free/scss/brands'` + + diff --git a/share/templates/readmes/foundation.md b/share/templates/readmes/foundation.md new file mode 100644 index 0000000..5a4a1cd --- /dev/null +++ b/share/templates/readmes/foundation.md @@ -0,0 +1,109 @@ +# How to install Foundation Zurb + +## Resources +* [node js](https://nodejs.org/en/download/) +* [foundation zurb](foundation.zurb.com) + + +## install nodeenv + +[how to install nodeenv](https://calvinx.com/2013/07/11/python-virtualenv-with-node-environment-via-nodeenv/) + +1. mkvirtualenv myproject1 +2. pip install nodeenv +3. nodeenv -p +4. deactivate; workon myproject1 +5. npm install -g foundation-cli +6. npm install -g autoprefixer +7. npm install -g generate +8. npm install -g postcss-cli + +## install django sass processor + +github url [django sass processor](https://github.com/jrief/django-sass-processor) + +`pip install django-sass-processor` + +### add to installed apps + +`sass_processor` + +### additional configuration settings + +#### set extensions to look for + +sass processor searches template files to find links to sass stylesheets. If using templates with a .django extension, you have to set the ext types you want the processor to search + +`SASS_TEMPLATE_EXTS = ['.django', '.html']` + +#### file search root directory + +set the root value for which sass processor will search for sass files (set to the same value as static root) + +`SASS_PROCESSOR_ROOT = STATIC_ROOT` + +#### add cssfinder to static file finders + +we need to tell the static finders thingie to use sass_processor + +`STATICFILES_FINDERS = [` +` 'django.contrib.staticfiles.finders.FileSystemFinder',` +` 'django.contrib.staticfiles.finders.AppDirectoriesFinder', ` +` 'sass_processor.finders.CssFinder', ]` + +#### directories to look through + +you must tell django wher eto find static files that you want to look through if you want to use them in a template + +you must also tell the sass processor where those files are if you want the sass processor to be able to do anything with it + +`STATICFILES_DIRS = [` +` ('node_modules', os.path.join(PROJECT_ROOT, 'share/media/node_modules/')),` +` os.path.join(PROJECT_ROOT,'share/media/node_modules/foundation-sites/scss'), ]` + +`SASS_PROCESSOR_INCLUDE_DIRS = [` +` os.path.join(PROJECT_ROOT, 'share/media/node_modules'),` +` os.path.join(PROJECT_ROOT, 'share/media/node_modules/foundation-sites/scss'), ]` + +Notice how "node modules" is attached without a prefix. + +also, I add direct links to the scss of the underlying packages so I can import them with a direct command + +`@import foundation` + +_instead of_ + +`@import foundation-sites/scss/foundation` + +When you want to import sass modules underneath the "node_modules" directory you must refer to the directory structure _underneath_ the node modules structure: + +`@import foundation-sites/scss/foundation` + +however, to directly import the foundation sass library, you must do so through the "assets" directory referenced in static. + +so foundation-sites/assets refers to what will be used in static, and foundation-sites/scss/foundation refers to compiling + +### Usage + +`{% load sass_tags %}` + +`` + + +## installing Zurb Foundation Template + +[how to install foundation with django](https://www.physics.utoronto.ca/~icom/workshop/django-install/foundation.html) + +either open up the virtualenv that contains foundation-cli or create one, or just install foundation-cli + +create a new template +`foundation new` + +## installing via foundation-sites + +npm install foundation-sites + + + + diff --git a/share/templates/readmes/sass.md b/share/templates/readmes/sass.md index 8841319..ce517ae 100644 --- a/share/templates/readmes/sass.md +++ b/share/templates/readmes/sass.md @@ -15,6 +15,8 @@ let g:syntastic_sass_sass_args=" -I /Full/share/media/projectwide_sass_files" ```` +you can also add multiple directories to the -I directive. Separate them with a space + [fixing syntastic check args](http://stackoverflow.com/questions/29041876/fixing-syntasticcheck-bootstrap-error-vim-syntastic-plugin) [syntastic manual](https://github.com/vim-syntastic/syntastic/blob/master/doc/syntastic.txt) \ No newline at end of file